Search in sources :

Example 1 with OpenAnotherVersionResrouceWizard

use of org.talend.designer.camel.resource.ui.wizards.OpenAnotherVersionResrouceWizard in project tesb-studio-se by Talend.

the class OpenAnotherVersionResourceAction method doRun.

@Override
protected void doRun() {
    final IRepositoryNode node = (RepositoryNode) ((IStructuredSelection) getSelection()).getFirstElement();
    IPath path = RepositoryNodeUtilities.getPath(node);
    String originalName = node.getObject().getLabel();
    RepositoryObject repositoryObj = new RepositoryObject(node.getObject().getProperty());
    repositoryObj.setRepositoryNode(node.getObject().getRepositoryNode());
    OpenAnotherVersionResrouceWizard wizard = new OpenAnotherVersionResrouceWizard(repositoryObj);
    WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
    dialog.setPageSize(300, 250);
    //$NON-NLS-1$
    dialog.setTitle("Open another version");
    if (dialog.open() == Dialog.OK) {
        refresh(node);
        // refresh the corresponding editor's name
        IEditorPart part = getCorrespondingEditor(node);
        if (part != null && part instanceof IUIRefresher) {
            ((IUIRefresher) part).refreshName();
        } else {
            processRoutineRenameOperation(originalName, node, path);
        }
    }
}
Also used : IRepositoryNode(org.talend.repository.model.IRepositoryNode) IPath(org.eclipse.core.runtime.IPath) RepositoryObject(org.talend.core.model.repository.RepositoryObject) OpenAnotherVersionResrouceWizard(org.talend.designer.camel.resource.ui.wizards.OpenAnotherVersionResrouceWizard) IEditorPart(org.eclipse.ui.IEditorPart) RepositoryNode(org.talend.repository.model.RepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) WizardDialog(org.eclipse.jface.wizard.WizardDialog) IUIRefresher(org.talend.core.services.IUIRefresher)

Aggregations

IPath (org.eclipse.core.runtime.IPath)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 IEditorPart (org.eclipse.ui.IEditorPart)1 RepositoryObject (org.talend.core.model.repository.RepositoryObject)1 IUIRefresher (org.talend.core.services.IUIRefresher)1 OpenAnotherVersionResrouceWizard (org.talend.designer.camel.resource.ui.wizards.OpenAnotherVersionResrouceWizard)1 IRepositoryNode (org.talend.repository.model.IRepositoryNode)1 RepositoryNode (org.talend.repository.model.RepositoryNode)1