Usages of

com.microsoft.tfs.core.clients.versioncontrol.soapextensions.Item.setServerItem(?)
/** * Create the composite * * @param parent * @param style */ public BranchesPropertiesControl(final Composite parent, final int style) { super(parent, style); stackLayout = new StackLayout(); setLayout(stackLayout); /* No branch page */ noBranchHistoryComposite = new Composite(this, SWT.NONE); final GridLayout noBranchHistoryCompositeLayout = new GridLayout(); noBranchHistoryCompositeLayout.marginWidth = 0; noBranchHistoryCompositeLayout.marginHeight = 0; noBranchHistoryCompositeLayout.horizontalSpacing = getHorizontalSpacing(); noBranchHistoryCompositeLayout.verticalSpacing = getVerticalSpacing(); noBranchHistoryComposite.setLayout(noBranchHistoryCompositeLayout); final Label noBranchesLabel = new Label(noBranchHistoryComposite, SWT.NONE); noBranchesLabel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false)); noBranchesLabel.setText(Messages.getString("BranchesPropertiesControl.NoBranchesLabelText")); //$NON-NLS-1$ /* Error page */ errorComposite = new Composite(this, SWT.NONE); final GridLayout errorCompositeLayout = new GridLayout(); errorCompositeLayout.marginWidth = 0; errorCompositeLayout.marginHeight = 0; errorCompositeLayout.horizontalSpacing = getHorizontalSpacing(); errorCompositeLayout.verticalSpacing = getVerticalSpacing(); errorComposite.setLayout(errorCompositeLayout); errorLabel = new Label(errorComposite, SWT.NONE); errorLabel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false)); errorLabel.setText(Messages.getString("BranchesPropertiesControl.ErrorLabelText")); //$NON-NLS-1$ /* Message page */ final Composite messageComposite = new Composite(this, SWT.NONE); final GridLayout messageCompositeLayout = new GridLayout(); messageCompositeLayout.marginWidth = 0; messageCompositeLayout.marginHeight = 0; messageCompositeLayout.horizontalSpacing = getHorizontalSpacing(); messageCompositeLayout.verticalSpacing = getVerticalSpacing(); messageComposite.setLayout(messageCompositeLayout); final Label messagesLabel = new Label(messageComposite, SWT.NONE); messagesLabel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false)); messagesLabel.setText(Messages.getString("BranchesPropertiesControl.MessagesLabelText")); //$NON-NLS-1$ /* Branch history page */ branchHistoryComposite = new Composite(this, SWT.NONE); final GridLayout branchHistoryCompositeLayout = new GridLayout(); branchHistoryCompositeLayout.marginWidth = 0; branchHistoryCompositeLayout.marginHeight = 0; branchHistoryCompositeLayout.horizontalSpacing = getHorizontalSpacing(); branchHistoryCompositeLayout.verticalSpacing = getVerticalSpacing(); branchHistoryComposite.setLayout(branchHistoryCompositeLayout); final Label branchesLabel = new Label(branchHistoryComposite, SWT.NONE); branchesLabel.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false)); branchesLabel.setText(Messages.getString("BranchesPropertiesControl.BranchesLabelText")); //$NON-NLS-1$ tableTreeViewer = new TableTreeViewer(branchHistoryComposite, SWT.BORDER); tableTree = tableTreeViewer.getTableTree(); table = tableTree.getTable(); table.setHeaderVisible(true); table.setLinesVisible(true); createTableColumns(table); tableTree.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); tableTreeViewer.setContentProvider(new BranchesPropertiesContentProvider()); tableTreeViewer.setLabelProvider(new BranchesPropertiesLabelProvider()); final BranchHistoryTreeItem dummyItem = new BranchHistoryTreeItem(); final Item item = new Item(); item.setChangeSetID(0); item.setServerItem(""); //$NON-NLS-1$ dummyItem.setItem(item); tableTreeViewer.setInput(dummyItem); stackLayout.topControl = messageComposite; }
public Item getItem(String serverPath, VersionSpec version, DeletedState deletedState, GetItemsOptions options) { // only changeset version or latest version are accepted // deleted state and get options are ignored int versionChangesetNumber = getChangesetNumberFromVersion(version); if (versionChangesetNumber == INVALID_CHANGESET_NUMBER) { return null; } for (int backwardChangesetCounter = versionChangesetNumber; backwardChangesetCounter > 0; backwardChangesetCounter--) { if (!itemData.containsKey(new Integer(versionChangesetNumber))) { continue; } HashSet<String> changesetData = itemData.get(new Integer(backwardChangesetCounter)); if (!DoesChangesetDataHasServerPath(changesetData, serverPath)) { continue; } Item toReturn = new Item(); toReturn.setChangeSetID(backwardChangesetCounter); toReturn.setServerItem(serverPath); toReturn.setItemType(ItemType.FOLDER); return toReturn; } return null; }
@Test public void assertLoggingWhenChangeset() throws Exception { final User user = mock(User.class); when(user.getId()).thenReturn("piedefer"); final UserLookup userLookup = mock(UserLookup.class); when(userLookup.find("piedefer")).thenReturn(user); final Item item = new Item(); item.setServerItem("Arithmetica.iTeX"); item.setItemType(ItemType.FILE); final Change serverChange = new Change(item, ChangeType.EDIT, null); final Changeset serverChangeset = new Changeset( new Change[]{serverChange}, "I have discovered a truly marvellous proof of this, which this margin is too narrow to contain.", null, null, "piedefer", "Pierre de Fermat", fixedPointInTime.getDate(), 1637, "piedefer", "Pierre de Fermat", null ); final Changeset[] serverChangesets = new Changeset[]{serverChangeset}; when(vcc.queryHistory( isA(String.class), isA(VersionSpec.class), anyInt(), isA(RecursionType.class), (String) isNull(), (VersionSpec) isNull(), (VersionSpec) isNull(), anyInt(), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean())).thenReturn(serverChangesets); final RemoteChangesetVersionCommand command = new RemoteChangesetVersionCommand(server, "$/RemotePath", LatestVersionSpec.INSTANCE) { @Override public Server createServer() { return server; } }; final Callable<Integer, Exception> callable = command.getCallable(); final Integer actual = callable.call(); Assert.assertNotNull(actual); Assert.assertEquals(1637, (int)actual); assertLog( "Querying for remote changeset at '$/RemotePath' as of 'T'...", "Query result is: Changeset #1637 by 'piedefer' on '2013-07-02T15:40:50Z'." ); }
Usage snippet has been bookmarked! Review your bookmarks
Thank you! Review your likes