Search in sources :

Example 6 with ClosableWizardDialog

use of org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog in project subclipse by subclipse.

the class CreateRemoteFolderAction method execute.

/* (non-Javadoc)
   * @see org.tigris.subversion.subclipse.ui.actions.SVNAction#execute(org.eclipse.jface.action.IAction)
   */
protected void execute(IAction action) {
    ISVNRemoteFolder remoteFolder = null;
    if (selection.getFirstElement() instanceof ISVNRemoteFolder)
        remoteFolder = (ISVNRemoteFolder) selection.getFirstElement();
    else if (selection.getFirstElement() instanceof ISVNRepositoryLocation)
        remoteFolder = ((ISVNRepositoryLocation) selection.getFirstElement()).getRootFolder();
    else if (selection.getFirstElement() instanceof ISVNRemoteFile)
        remoteFolder = ((ISVNRemoteFile) selection.getFirstElement()).getParent();
    NewRemoteFolderWizard wizard = new NewRemoteFolderWizard(remoteFolder);
    WizardDialog dialog = new ClosableWizardDialog(shell, wizard);
    wizard.setParentDialog(dialog);
    dialog.open();
}
Also used : ISVNRepositoryLocation(org.tigris.subversion.subclipse.core.ISVNRepositoryLocation) NewRemoteFolderWizard(org.tigris.subversion.subclipse.ui.wizards.NewRemoteFolderWizard) ISVNRemoteFile(org.tigris.subversion.subclipse.core.ISVNRemoteFile) ClosableWizardDialog(org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog) ISVNRemoteFolder(org.tigris.subversion.subclipse.core.ISVNRemoteFolder) WizardDialog(org.eclipse.jface.wizard.WizardDialog) ClosableWizardDialog(org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog)

Example 7 with ClosableWizardDialog

use of org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog in project subclipse by subclipse.

the class CheckoutWizardAction method execute.

/* (non-Javadoc)
   * @see org.eclipse.team.internal.ccvs.ui.actions.CVSAction#execute(org.eclipse.jface.action.IAction)
   */
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
    CheckoutWizard wizard = new CheckoutWizard();
    WizardDialog dialog = new ClosableWizardDialog(shell, wizard);
    dialog.open();
}
Also used : ClosableWizardDialog(org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog) WizardDialog(org.eclipse.jface.wizard.WizardDialog) ClosableWizardDialog(org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog) CheckoutWizard(org.tigris.subversion.subclipse.ui.wizards.CheckoutWizard)

Example 8 with ClosableWizardDialog

use of org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog in project subclipse by subclipse.

the class MoveRemoteResourceAction method execute.

/* (non-Javadoc)
   * @see org.tigris.subversion.subclipse.ui.actions.SVNAction#execute(org.eclipse.jface.action.IAction)
   */
protected void execute(IAction action) {
    MoveRemoteResourceWizard wizard = new MoveRemoteResourceWizard((ISVNRemoteResource) selection.getFirstElement());
    WizardDialog dialog = new ClosableWizardDialog(shell, wizard);
    wizard.setParentDialog(dialog);
    dialog.open();
}
Also used : MoveRemoteResourceWizard(org.tigris.subversion.subclipse.ui.wizards.MoveRemoteResourceWizard) ClosableWizardDialog(org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog) WizardDialog(org.eclipse.jface.wizard.WizardDialog) ClosableWizardDialog(org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog)

Example 9 with ClosableWizardDialog

use of org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog in project subclipse by subclipse.

the class RelocateAction method execute.

protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
    Iterator iter = selection.iterator();
    while (iter.hasNext()) {
        Object object = iter.next();
        if (object instanceof SVNRepositoryLocation) {
            SVNRepositoryLocation repository = (SVNRepositoryLocation) object;
            RelocateWizard wizard = new RelocateWizard(repository);
            WizardDialog dialog = new ClosableWizardDialog(shell, wizard);
            dialog.open();
            break;
        }
    }
}
Also used : RelocateWizard(org.tigris.subversion.subclipse.ui.wizards.RelocateWizard) Iterator(java.util.Iterator) SVNRepositoryLocation(org.tigris.subversion.subclipse.core.repo.SVNRepositoryLocation) ClosableWizardDialog(org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog) WizardDialog(org.eclipse.jface.wizard.WizardDialog) ClosableWizardDialog(org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog)

Example 10 with ClosableWizardDialog

use of org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog in project subclipse by subclipse.

the class SVNHistoryPage method getCreateTagFromRevisionChangedPathAction.

private IAction getCreateTagFromRevisionChangedPathAction() {
    if (createTagFromRevisionChangedPathAction == null) {
        createTagFromRevisionChangedPathAction = new // $NON-NLS-1$
        Action() {

            public void run() {
                SVNRevision selectedRevision = null;
                ISelection selection = changePathsViewer.getSelection();
                if (!(selection instanceof IStructuredSelection))
                    return;
                IStructuredSelection sel = (IStructuredSelection) selection;
                ISVNRemoteResource remoteResource = null;
                if (sel.getFirstElement() instanceof LogEntryChangePath) {
                    try {
                        remoteResource = ((LogEntryChangePath) sel.getFirstElement()).getRemoteResource();
                        selectedRevision = remoteResource.getRevision();
                    } catch (SVNException e) {
                    }
                } else if (sel.getFirstElement() instanceof HistoryFolder) {
                    HistoryFolder historyFolder = (HistoryFolder) sel.getFirstElement();
                    Object[] children = historyFolder.getChildren();
                    if (children != null && children.length > 0 && children[0] instanceof LogEntryChangePath) {
                        LogEntryChangePath changePath = (LogEntryChangePath) children[0];
                        try {
                            remoteResource = changePath.getRemoteResource().getRepository().getRemoteFolder(historyFolder.getPath());
                            selectedRevision = getSelectedRevision();
                        } catch (SVNException e) {
                        }
                    }
                }
                if (remoteResource == null)
                    return;
                ISVNRemoteResource[] remoteResources = { remoteResource };
                BranchTagWizard wizard = new BranchTagWizard(remoteResources);
                wizard.setRevisionNumber(Long.parseLong(selectedRevision.toString()));
                WizardDialog dialog = new ClosableWizardDialog(getSite().getShell(), wizard);
                if (dialog.open() == WizardDialog.OK) {
                    final SVNUrl sourceUrl = wizard.getUrl();
                    final SVNUrl destinationUrl = wizard.getToUrl();
                    final String message = wizard.getComment();
                    final SVNRevision revision = wizard.getRevision();
                    final boolean makeParents = wizard.isMakeParents();
                    try {
                        BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {

                            public void run() {
                                ISVNClientAdapter client = null;
                                try {
                                    client = SVNProviderPlugin.getPlugin().getSVNClientManager().getSVNClient();
                                    client.copy(sourceUrl, destinationUrl, message, revision, makeParents);
                                    SVNUIPlugin.getPlugin().getRepositoryManager().resourceCreated(null, null);
                                } catch (Exception e) {
                                    MessageDialog.openError(getSite().getShell(), Policy.bind("HistoryView.createTagFromRevision"), // $NON-NLS-1$
                                    e.getMessage());
                                } finally {
                                    SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
                                }
                            }
                        });
                    } catch (Exception e) {
                        MessageDialog.openError(getSite().getShell(), Policy.bind("HistoryView.createTagFromRevision"), // $NON-NLS-1$
                        e.getMessage());
                    }
                }
            // SvnWizardBranchTagPage branchTagPage = new
            // SvnWizardBranchTagPage(remoteResource);
            // 
            // branchTagPage.setRevisionNumber(Long.parseLong(selectedRevision.toString()));
            // SvnWizard wizard = new SvnWizard(branchTagPage);
            // SvnWizardDialog dialog = new SvnWizardDialog(getSite().getShell(),
            // wizard);
            // wizard.setParentDialog(dialog);
            // if (!(dialog.open() == SvnWizardDialog.OK)) return;
            // final SVNUrl sourceUrl = branchTagPage.getUrl();
            // final SVNUrl destinationUrl = branchTagPage.getToUrl();
            // final String message = branchTagPage.getComment();
            // final SVNRevision revision = branchTagPage.getRevision();
            // final boolean makeParents = branchTagPage.isMakeParents();
            // try {
            // BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
            // public void run() {
            // try {
            // ISVNClientAdapter client =
            // SVNProviderPlugin.getPlugin().getSVNClientManager().createSVNClient();
            // client.copy(sourceUrl, destinationUrl, message, revision,
            // makeParents);
            // } catch(Exception e) {
            // MessageDialog.openError(getSite().getShell(),
            // Policy.bind("HistoryView.createTagFromRevision"), e
            // .getMessage());
            // }
            // }
            // });
            // } catch(Exception e) {
            // MessageDialog.openError(getSite().getShell(),
            // Policy.bind("HistoryView.createTagFromRevision"), e
            // .getMessage());
            // }
            }
        };
    }
    ISelection selection = changePathsViewer.getSelection();
    if (selection instanceof IStructuredSelection) {
        IStructuredSelection sel = (IStructuredSelection) selection;
        SVNRevision selectedRevision = null;
        if (sel.size() == 1) {
            // ISVNRemoteResource remoteResource = null;
            if (sel.getFirstElement() instanceof LogEntryChangePath && ((LogEntryChangePath) sel.getFirstElement()).getAction() != 'D') {
                // try {
                // remoteResource = ((LogEntryChangePath)sel.getFirstElement()).getRemoteResource();
                selectedRevision = ((LogEntryChangePath) sel.getFirstElement()).getRevision();
            // selectedRevision = remoteResource.getRevision();
            // } catch (SVNException e) {}
            } else if (sel.getFirstElement() instanceof HistoryFolder) {
                HistoryFolder historyFolder = (HistoryFolder) sel.getFirstElement();
                Object[] children = historyFolder.getChildren();
                if (children != null && children.length > 0 && children[0] instanceof LogEntryChangePath) {
                    selectedRevision = getSelectedRevision();
                }
            }
            createTagFromRevisionChangedPathAction.setEnabled(selectedRevision != null);
            if (selectedRevision == null) {
                createTagFromRevisionChangedPathAction.setText(Policy.bind("HistoryView.createTagFromRevision", // $NON-NLS-1$ //$NON-NLS-2$
                "" + ((LogEntryChangePath) sel.getFirstElement()).getRevision()));
            } else {
                createTagFromRevisionChangedPathAction.setText(Policy.bind("HistoryView.createTagFromRevision", // $NON-NLS-1$ //$NON-NLS-2$
                "" + selectedRevision));
            }
        }
    }
    createTagFromRevisionChangedPathAction.setImageDescriptor(SVNUIPlugin.getPlugin().getImageDescriptor(ISVNUIConstants.IMG_MENU_BRANCHTAG));
    return createTagFromRevisionChangedPathAction;
}
Also used : LogEntryChangePath(org.tigris.subversion.subclipse.core.history.LogEntryChangePath) SVNUrl(org.tigris.subversion.svnclientadapter.SVNUrl) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ISVNRemoteResource(org.tigris.subversion.subclipse.core.ISVNRemoteResource) SVNException(org.tigris.subversion.subclipse.core.SVNException) CoreException(org.eclipse.core.runtime.CoreException) SVNException(org.tigris.subversion.subclipse.core.SVNException) PartInitException(org.eclipse.ui.PartInitException) InvocationTargetException(java.lang.reflect.InvocationTargetException) TeamException(org.eclipse.team.core.TeamException) ParseException(java.text.ParseException) BranchTagWizard(org.tigris.subversion.subclipse.ui.wizards.BranchTagWizard) IWorkspaceRunnable(org.eclipse.core.resources.IWorkspaceRunnable) ISelection(org.eclipse.jface.viewers.ISelection) ClosableWizardDialog(org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog) SVNRevision(org.tigris.subversion.svnclientadapter.SVNRevision) WizardDialog(org.eclipse.jface.wizard.WizardDialog) ClosableWizardDialog(org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog) SvnWizardDialog(org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardDialog) ISVNClientAdapter(org.tigris.subversion.svnclientadapter.ISVNClientAdapter)

Aggregations

WizardDialog (org.eclipse.jface.wizard.WizardDialog)11 ClosableWizardDialog (org.tigris.subversion.subclipse.ui.wizards.ClosableWizardDialog)11 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)3 BranchTagWizard (org.tigris.subversion.subclipse.ui.wizards.BranchTagWizard)3 SvnWizardDialog (org.tigris.subversion.subclipse.ui.wizards.dialogs.SvnWizardDialog)3 ISVNClientAdapter (org.tigris.subversion.svnclientadapter.ISVNClientAdapter)3 SVNRevision (org.tigris.subversion.svnclientadapter.SVNRevision)3 SVNUrl (org.tigris.subversion.svnclientadapter.SVNUrl)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 ParseException (java.text.ParseException)2 IWorkspaceRunnable (org.eclipse.core.resources.IWorkspaceRunnable)2 CoreException (org.eclipse.core.runtime.CoreException)2 Action (org.eclipse.jface.action.Action)2 ISelection (org.eclipse.jface.viewers.ISelection)2 TeamException (org.eclipse.team.core.TeamException)2 PartInitException (org.eclipse.ui.PartInitException)2 ISVNRemoteFolder (org.tigris.subversion.subclipse.core.ISVNRemoteFolder)2 ISVNRemoteResource (org.tigris.subversion.subclipse.core.ISVNRemoteResource)2 ISVNRepositoryLocation (org.tigris.subversion.subclipse.core.ISVNRepositoryLocation)2 SVNException (org.tigris.subversion.subclipse.core.SVNException)2