use of org.tigris.subversion.subclipse.core.ISVNRemoteFolder in project subclipse by subclipse.
the class CheckoutWizardCheckoutAsWithProjectFilePage method getCommonParent.
private ISVNRemoteResource getCommonParent() {
ISVNRemoteFolder[] remoteFolders = ((CheckoutWizard) getWizard()).getRemoteFolders();
if (remoteFolders.length == 1)
return remoteFolders[0];
ISVNRemoteResource commonParent = null;
ISVNRemoteResource parent = remoteFolders[0];
while (commonParent == null) {
parent = parent.getParent();
if (parent == null)
break;
for (int i = 1; i < remoteFolders.length; i++) {
if (!remoteFolders[i].getUrl().toString().startsWith(parent.getUrl().toString()))
break;
}
commonParent = parent;
}
return commonParent;
}
use of org.tigris.subversion.subclipse.core.ISVNRemoteFolder in project subclipse by subclipse.
the class CheckoutWizardCheckoutAsWithProjectFilePage method createControl.
public void createControl(Composite parent) {
CheckoutWizard wizard = (CheckoutWizard) getWizard();
ISVNRemoteFolder[] remoteFolders = wizard.getRemoteFolders();
Composite outerContainer = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 1;
outerContainer.setLayout(layout);
outerContainer.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
textLabel = new Label(outerContainer, SWT.NONE);
GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
textLabel.setLayoutData(data);
if (remoteFolders != null) {
textLabel.setText(Policy.bind("CheckoutWizardCheckoutAsPage.single", // $NON-NLS-1$
remoteFolders[0].getName()));
}
wizardButton = new Button(outerContainer, SWT.RADIO);
// $NON-NLS-1$
wizardButton.setText(Policy.bind("CheckoutWizardCheckoutAsPage.wizard"));
wizardButton.setEnabled(false);
Label notAvailableLabel = new Label(outerContainer, SWT.NONE);
notAvailableLabel.setText(// $NON-NLS-1$
Policy.bind("CheckoutWizardCheckoutAsPage.notAvailable"));
notAvailableLabel.setEnabled(false);
projectButton = new Button(outerContainer, SWT.RADIO);
// $NON-NLS-1$
projectButton.setText(Policy.bind("CheckoutWizardCheckoutAsPage.project"));
Composite projectGroup = new Composite(outerContainer, SWT.NONE);
GridLayout projectLayout = new GridLayout();
projectLayout.numColumns = 2;
projectGroup.setLayout(projectLayout);
projectGroup.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
Label projectLabel = new Label(projectGroup, SWT.NONE);
// $NON-NLS-1$
projectLabel.setText(Policy.bind("CheckoutWizardCheckoutAsPage.projectName"));
projectText = new Text(projectGroup, SWT.BORDER);
data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
projectText.setLayoutData(data);
if (projectName == null) {
if (remoteFolders != null)
projectText.setText(remoteFolders[0].getName());
} else
projectText.setText(projectName);
projectText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
CheckoutWizard wizard = (CheckoutWizard) getWizard();
wizard.setProjectName(projectText.getText().trim());
setPageComplete(canFinish());
}
});
existingButton = new Button(outerContainer, SWT.RADIO);
// $NON-NLS-1$
existingButton.setText(Policy.bind("CheckoutWizardCheckoutAsPage.existing"));
existingButton.setEnabled(false);
existingButton.setVisible(false);
projectButton.setSelection(true);
Composite revisionGroup = new Composite(outerContainer, SWT.NULL);
GridLayout revisionLayout = new GridLayout();
revisionLayout.numColumns = 3;
revisionLayout.marginWidth = 0;
revisionLayout.marginHeight = 0;
revisionGroup.setLayout(revisionLayout);
data = new GridData(SWT.FILL, SWT.FILL, true, false);
revisionGroup.setLayoutData(data);
headButton = new Button(revisionGroup, SWT.CHECK);
// $NON-NLS-1$
headButton.setText(Policy.bind("CheckoutWizard.head"));
data = new GridData();
data.horizontalSpan = 3;
headButton.setLayoutData(data);
headButton.setSelection(true);
Label revisionLabel = new Label(revisionGroup, SWT.NONE);
// $NON-NLS-1$
revisionLabel.setText(Policy.bind("CheckoutWizard.revision"));
revisionText = new Text(revisionGroup, SWT.BORDER);
data = new GridData();
data.widthHint = REVISION_WIDTH_HINT;
revisionText.setLayoutData(data);
revisionText.setEnabled(false);
Button logButton = new Button(revisionGroup, SWT.PUSH);
// $NON-NLS-1$
logButton.setText(Policy.bind("MergeDialog.showLog"));
logButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
showLog();
}
});
SelectionListener revisionListener = new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
revisionText.setEnabled(!headButton.getSelection());
if (!headButton.getSelection()) {
revisionText.selectAll();
revisionText.setFocus();
}
}
};
headButton.addSelectionListener(revisionListener);
SelectionListener selectionListener = new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
projectText.setEnabled(projectButton.getSelection());
if (projectButton.getSelection()) {
projectText.selectAll();
projectText.setFocus();
}
setPageComplete(canFinish());
}
};
wizardButton.addSelectionListener(selectionListener);
projectButton.addSelectionListener(selectionListener);
existingButton.addSelectionListener(selectionListener);
Group parameterGroup = new Group(outerContainer, SWT.NULL);
GridLayout parameterLayout = new GridLayout();
parameterLayout.numColumns = 2;
parameterGroup.setLayout(parameterLayout);
data = new GridData(SWT.FILL, SWT.FILL, true, false, 3, 1);
parameterGroup.setLayoutData(data);
Label depthLabel = new Label(parameterGroup, SWT.NONE);
// $NON-NLS-1$
depthLabel.setText(Policy.bind("SvnDialog.depth"));
depthCombo = new Combo(parameterGroup, SWT.READ_ONLY);
DepthComboHelper.addDepths(depthCombo, false, ISVNUIConstants.DEPTH_INFINITY);
ignoreExternalsButton = new Button(parameterGroup, SWT.CHECK);
// $NON-NLS-1$
ignoreExternalsButton.setText(Policy.bind("SvnDialog.ignoreExternals"));
data = new GridData();
data.horizontalSpan = 2;
ignoreExternalsButton.setLayoutData(data);
forceButton = new Button(parameterGroup, SWT.CHECK);
// $NON-NLS-1$
forceButton.setText(Policy.bind("SvnDialog.force"));
data = new GridData();
data.horizontalSpan = 2;
forceButton.setLayoutData(data);
forceButton.setSelection(true);
// $NON-NLS-1$
setMessage(Policy.bind("CheckoutWizardCheckoutAsPage.text"));
setControl(outerContainer);
}
use of org.tigris.subversion.subclipse.core.ISVNRemoteFolder in project subclipse by subclipse.
the class CheckoutWizardCheckoutAsWithoutProjectFilePage method createControl.
public void createControl(Composite parent) {
CheckoutWizard wizard = (CheckoutWizard) getWizard();
ISVNRemoteFolder[] remoteFolders = wizard.getRemoteFolders();
Composite outerContainer = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 1;
outerContainer.setLayout(layout);
outerContainer.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
textLabel = new Label(outerContainer, SWT.NONE);
GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
textLabel.setLayoutData(data);
if (remoteFolders != null) {
textLabel.setText(Policy.bind("CheckoutWizardCheckoutAsPage.single", // $NON-NLS-1$
remoteFolders[0].getName()));
}
wizardButton = new Button(outerContainer, SWT.RADIO);
// $NON-NLS-1$
wizardButton.setText(Policy.bind("CheckoutWizardCheckoutAsPage.wizard"));
projectButton = new Button(outerContainer, SWT.RADIO);
// $NON-NLS-1$
projectButton.setText(Policy.bind("CheckoutWizardCheckoutAsPage.project"));
Composite projectGroup = new Composite(outerContainer, SWT.NONE);
GridLayout projectLayout = new GridLayout();
projectLayout.numColumns = 2;
projectGroup.setLayout(projectLayout);
projectGroup.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
Label projectLabel = new Label(projectGroup, SWT.NONE);
// $NON-NLS-1$
projectLabel.setText(Policy.bind("CheckoutWizardCheckoutAsPage.projectName"));
projectText = new Text(projectGroup, SWT.BORDER);
data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
projectText.setLayoutData(data);
if (remoteFolders != null)
projectText.setText(remoteFolders[0].getName());
projectText.setEnabled(false);
projectText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
CheckoutWizard wizard = (CheckoutWizard) getWizard();
wizard.setProjectName(projectText.getText().trim());
setPageComplete(canFinish());
}
});
existingButton = new Button(outerContainer, SWT.RADIO);
// $NON-NLS-1$
existingButton.setText(Policy.bind("CheckoutWizardCheckoutAsPage.existing"));
existingButton.setEnabled(false);
existingButton.setVisible(false);
wizardButton.setSelection(true);
Composite revisionGroup = new Composite(outerContainer, SWT.NULL);
GridLayout revisionLayout = new GridLayout();
revisionLayout.numColumns = 3;
revisionLayout.marginWidth = 0;
revisionLayout.marginHeight = 0;
revisionGroup.setLayout(revisionLayout);
data = new GridData(SWT.FILL, SWT.FILL, true, false);
revisionGroup.setLayoutData(data);
headButton = new Button(revisionGroup, SWT.CHECK);
// $NON-NLS-1$
headButton.setText(Policy.bind("CheckoutWizard.head"));
data = new GridData();
data.horizontalSpan = 3;
headButton.setLayoutData(data);
headButton.setSelection(true);
Label revisionLabel = new Label(revisionGroup, SWT.NONE);
// $NON-NLS-1$
revisionLabel.setText(Policy.bind("CheckoutWizard.revision"));
revisionText = new Text(revisionGroup, SWT.BORDER);
data = new GridData();
data.widthHint = REVISION_WIDTH_HINT;
revisionText.setLayoutData(data);
revisionText.setEnabled(false);
Button logButton = new Button(revisionGroup, SWT.PUSH);
// $NON-NLS-1$
logButton.setText(Policy.bind("MergeDialog.showLog"));
logButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
showLog();
}
});
SelectionListener revisionListener = new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
revisionText.setEnabled(!headButton.getSelection());
if (!headButton.getSelection()) {
revisionText.selectAll();
revisionText.setFocus();
}
}
};
headButton.addSelectionListener(revisionListener);
SelectionListener selectionListener = new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
projectText.setEnabled(projectButton.getSelection());
if (projectButton.getSelection()) {
projectText.selectAll();
projectText.setFocus();
}
setPageComplete(canFinish());
}
};
wizardButton.addSelectionListener(selectionListener);
projectButton.addSelectionListener(selectionListener);
existingButton.addSelectionListener(selectionListener);
Group parameterGroup = new Group(outerContainer, SWT.NULL);
GridLayout parameterLayout = new GridLayout();
parameterLayout.numColumns = 2;
parameterGroup.setLayout(parameterLayout);
data = new GridData(SWT.FILL, SWT.FILL, true, false, 3, 1);
parameterGroup.setLayoutData(data);
Label depthLabel = new Label(parameterGroup, SWT.NONE);
// $NON-NLS-1$
depthLabel.setText(Policy.bind("SvnDialog.depth"));
depthCombo = new Combo(parameterGroup, SWT.READ_ONLY);
DepthComboHelper.addDepths(depthCombo, false, ISVNUIConstants.DEPTH_INFINITY);
ignoreExternalsButton = new Button(parameterGroup, SWT.CHECK);
// $NON-NLS-1$
ignoreExternalsButton.setText(Policy.bind("SvnDialog.ignoreExternals"));
data = new GridData();
data.horizontalSpan = 2;
ignoreExternalsButton.setLayoutData(data);
forceButton = new Button(parameterGroup, SWT.CHECK);
// $NON-NLS-1$
forceButton.setText(Policy.bind("SvnDialog.force"));
data = new GridData();
data.horizontalSpan = 2;
forceButton.setLayoutData(data);
forceButton.setSelection(true);
// $NON-NLS-1$
setMessage(Policy.bind("CheckoutWizardCheckoutAsPage.text"));
setControl(outerContainer);
}
use of org.tigris.subversion.subclipse.core.ISVNRemoteFolder in project subclipse by subclipse.
the class CheckoutWizardCheckoutAsWithoutProjectFilePage method getCommonParent.
private ISVNRemoteResource getCommonParent() {
ISVNRemoteFolder[] remoteFolders = ((CheckoutWizard) getWizard()).getRemoteFolders();
if (remoteFolders.length == 1)
return remoteFolders[0];
ISVNRemoteResource commonParent = null;
ISVNRemoteResource parent = remoteFolders[0];
while (commonParent == null) {
parent = parent.getParent();
if (parent == null)
break;
for (int i = 1; i < remoteFolders.length; i++) {
if (!remoteFolders[i].getUrl().toString().startsWith(parent.getUrl().toString()))
break;
}
commonParent = parent;
}
return commonParent;
}
use of org.tigris.subversion.subclipse.core.ISVNRemoteFolder in project subclipse by subclipse.
the class CheckoutWizardSelectionPage method refreshViewerNode.
protected void refreshViewerNode() {
IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
Iterator iter = selection.iterator();
while (iter.hasNext()) {
Object object = iter.next();
if (object instanceof ISVNRepositoryLocation)
((ISVNRepositoryLocation) object).refreshRootFolder();
if (object instanceof ISVNRemoteFolder)
((ISVNRemoteFolder) object).refresh();
treeViewer.refresh(object);
}
}
Aggregations