Search in sources :

Example 16 with ISVNRemoteFolder

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;
}
Also used : ISVNRemoteResource(org.tigris.subversion.subclipse.core.ISVNRemoteResource) ISVNRemoteFolder(org.tigris.subversion.subclipse.core.ISVNRemoteFolder)

Example 17 with ISVNRemoteFolder

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);
}
Also used : Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) Combo(org.eclipse.swt.widgets.Combo) ISVNRemoteFolder(org.tigris.subversion.subclipse.core.ISVNRemoteFolder) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 18 with ISVNRemoteFolder

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);
}
Also used : Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) Combo(org.eclipse.swt.widgets.Combo) ISVNRemoteFolder(org.tigris.subversion.subclipse.core.ISVNRemoteFolder) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 19 with ISVNRemoteFolder

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;
}
Also used : ISVNRemoteResource(org.tigris.subversion.subclipse.core.ISVNRemoteResource) ISVNRemoteFolder(org.tigris.subversion.subclipse.core.ISVNRemoteFolder)

Example 20 with ISVNRemoteFolder

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);
    }
}
Also used : ISVNRepositoryLocation(org.tigris.subversion.subclipse.core.ISVNRepositoryLocation) Iterator(java.util.Iterator) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ISVNRemoteFolder(org.tigris.subversion.subclipse.core.ISVNRemoteFolder)

Aggregations

ISVNRemoteFolder (org.tigris.subversion.subclipse.core.ISVNRemoteFolder)33 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)12 InvocationTargetException (java.lang.reflect.InvocationTargetException)11 SVNException (org.tigris.subversion.subclipse.core.SVNException)9 ArrayList (java.util.ArrayList)8 ISVNRepositoryLocation (org.tigris.subversion.subclipse.core.ISVNRepositoryLocation)7 IResource (org.eclipse.core.resources.IResource)6 TeamException (org.eclipse.team.core.TeamException)6 ISVNRemoteResource (org.tigris.subversion.subclipse.core.ISVNRemoteResource)6 Iterator (java.util.Iterator)5 IProject (org.eclipse.core.resources.IProject)5 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)5 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)5 GridData (org.eclipse.swt.layout.GridData)5 Composite (org.eclipse.swt.widgets.Composite)5 List (java.util.List)4 CoreException (org.eclipse.core.runtime.CoreException)4 GridLayout (org.eclipse.swt.layout.GridLayout)4 ISVNLocalResource (org.tigris.subversion.subclipse.core.ISVNLocalResource)4 File (java.io.File)3