Search in sources :

Example 1 with IUIRefresher

use of org.talend.core.services.IUIRefresher in project tdi-studio-se by Talend.

the class OpenExistVersionProcessAction method doRun.

@Override
protected void doRun() {
    ISelection selection = getSelection();
    Object obj = ((IStructuredSelection) selection).getFirstElement();
    RepositoryNode node = (RepositoryNode) obj;
    IPath path = RepositoryNodeUtilities.getPath(node);
    String originalName = node.getObject().getLabel();
    RepositoryObject repositoryObj = new RepositoryObject(node.getObject().getProperty());
    repositoryObj.setRepositoryNode(node.getObject().getRepositoryNode());
    OpenExistVersionProcessWizard wizard = new OpenExistVersionProcessWizard(repositoryObj);
    WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
    dialog.setPageSize(300, 250);
    //$NON-NLS-1$
    dialog.setTitle(Messages.getString("OpenExistVersionProcess.open.dialog"));
    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 : IPath(org.eclipse.core.runtime.IPath) RepositoryObject(org.talend.core.model.repository.RepositoryObject) OpenExistVersionProcessWizard(org.talend.designer.core.ui.wizards.OpenExistVersionProcessWizard) ISelection(org.eclipse.jface.viewers.ISelection) RepositoryObject(org.talend.core.model.repository.RepositoryObject) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) 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)

Example 2 with IUIRefresher

use of org.talend.core.services.IUIRefresher 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)

Example 3 with IUIRefresher

use of org.talend.core.services.IUIRefresher in project tesb-studio-se by Talend.

the class OpenCamelExistVersionProcessAction method doRun.

@Override
protected void doRun() {
    ISelection selection = getSelection();
    Object obj = ((IStructuredSelection) selection).getFirstElement();
    IRepositoryNode node = (IRepositoryNode) obj;
    IPath path = RepositoryNodeUtilities.getPath(node);
    String originalName = node.getObject().getLabel();
    RepositoryObject repositoryObj = new RepositoryObject(node.getObject().getProperty());
    repositoryObj.setRepositoryNode(node.getObject().getRepositoryNode());
    OpenCamelExistVersionProcessWizard wizard = new OpenCamelExistVersionProcessWizard(repositoryObj);
    WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
    dialog.setHelpAvailable(false);
    dialog.setPageSize(300, 250);
    //$NON-NLS-1$
    dialog.setTitle(Messages.getString("OpenExistVersionProcess.open.dialog"));
    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) ISelection(org.eclipse.jface.viewers.ISelection) RepositoryObject(org.talend.core.model.repository.RepositoryObject) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IEditorPart(org.eclipse.ui.IEditorPart) OpenCamelExistVersionProcessWizard(org.talend.camel.designer.ui.wizards.OpenCamelExistVersionProcessWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog) IUIRefresher(org.talend.core.services.IUIRefresher)

Example 4 with IUIRefresher

use of org.talend.core.services.IUIRefresher in project tdi-studio-se by Talend.

the class EditPropertiesAction method doRun.

@Override
protected void doRun() {
    ISelection selection = getSelection();
    Object obj = ((IStructuredSelection) selection).getFirstElement();
    IRepositoryNode node = (IRepositoryNode) obj;
    // try {
    // ProxyRepositoryFactory.getInstance().initialize();
    // } catch (PersistenceException e1) {
    // ExceptionHandler.process(e1);
    // }
    IRepositoryViewObject object = node.getObject();
    IPath path = RepositoryNodeUtilities.getPath(node);
    String originalName = object.getLabel();
    final PropertiesWizard wizard;
    if (ERepositoryObjectType.ROUTINES == object.getRepositoryObjectType() || isInstanceofCamelBeans(object.getRepositoryObjectType())) {
        wizard = new EditRoutinePropertiesWizard(object, path, true);
    } else if (ERepositoryObjectType.PROCESS == object.getRepositoryObjectType()) {
        wizard = new EditProcessPropertiesWizard(object, path, true);
    } else {
        wizard = getPropertiesWizard(object, path);
    }
    WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
    if (dlg.open() == Window.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);
        }
        // rename the job launch, for bug 8878
        IDesignerCoreService designerCoreService = RepositoryPlugin.getDefault().getDesignerCoreService();
        if (designerCoreService != null) {
            designerCoreService.renameJobLaunch(node.getObject(), originalName);
            // TDI-24863:reset the job problem list if rename the job item
            designerCoreService.resetJobProblemList(node.getObject(), originalName);
        }
        // refresh ...
        IViewPart jobSettingView = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IJobSettingsView.ID);
        if (jobSettingView != null && jobSettingView instanceof IJobSettingsView) {
            ((IJobSettingsView) jobSettingView).refreshCurrentViewTab();
        }
        if (node.getObjectType() == ERepositoryObjectType.ROUTINES) {
            RepositoryManager.syncRoutineAndJoblet(ERepositoryObjectType.ROUTINES);
            if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
                IRunProcessService service = (IRunProcessService) GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
                ITalendProcessJavaProject talendProcessJavaProject = service.getTalendProcessJavaProject();
                if (talendProcessJavaProject != null) {
                    talendProcessJavaProject.updateRoutinesPom(true, true);
                }
            }
        }
        if (node.getObjectType().getType().equals("SERVICES")) {
            //$NON-NLS-1$
            ConnectionItem connectionItem = (ConnectionItem) node.getObject().getProperty().getItem();
            RepositoryUpdateManager.updateServices(connectionItem);
            if (GlobalServiceRegister.getDefault().isServiceRegistered(IESBService.class)) {
                IESBService service = (IESBService) GlobalServiceRegister.getDefault().getService(IESBService.class);
                if (service != null) {
                    service.refreshComponentView(connectionItem);
                }
            }
        }
    }
}
Also used : IJobSettingsView(org.talend.repository.ui.views.IJobSettingsView) IViewPart(org.eclipse.ui.IViewPart) IRepositoryNode(org.talend.repository.model.IRepositoryNode) IPath(org.eclipse.core.runtime.IPath) EditRoutinePropertiesWizard(org.talend.repository.ui.wizards.routines.EditRoutinePropertiesWizard) ConnectionItem(org.talend.core.model.properties.ConnectionItem) IRunProcessService(org.talend.designer.runprocess.IRunProcessService) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IEditorPart(org.eclipse.ui.IEditorPart) EditProcessPropertiesWizard(org.talend.metadata.managment.ui.wizard.process.EditProcessPropertiesWizard) ITalendProcessJavaProject(org.talend.core.runtime.process.ITalendProcessJavaProject) EditProcessPropertiesWizard(org.talend.metadata.managment.ui.wizard.process.EditProcessPropertiesWizard) EditRoutinePropertiesWizard(org.talend.repository.ui.wizards.routines.EditRoutinePropertiesWizard) PropertiesWizard(org.talend.metadata.managment.ui.wizard.PropertiesWizard) IESBService(org.talend.core.IESBService) ISelection(org.eclipse.jface.viewers.ISelection) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) IDesignerCoreService(org.talend.designer.core.IDesignerCoreService) WizardDialog(org.eclipse.jface.wizard.WizardDialog) IUIRefresher(org.talend.core.services.IUIRefresher)

Aggregations

IPath (org.eclipse.core.runtime.IPath)4 WizardDialog (org.eclipse.jface.wizard.WizardDialog)4 IEditorPart (org.eclipse.ui.IEditorPart)4 IUIRefresher (org.talend.core.services.IUIRefresher)4 IRepositoryNode (org.talend.repository.model.IRepositoryNode)4 ISelection (org.eclipse.jface.viewers.ISelection)3 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)3 RepositoryObject (org.talend.core.model.repository.RepositoryObject)3 RepositoryNode (org.talend.repository.model.RepositoryNode)2 IViewPart (org.eclipse.ui.IViewPart)1 OpenCamelExistVersionProcessWizard (org.talend.camel.designer.ui.wizards.OpenCamelExistVersionProcessWizard)1 IESBService (org.talend.core.IESBService)1 ConnectionItem (org.talend.core.model.properties.ConnectionItem)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 ITalendProcessJavaProject (org.talend.core.runtime.process.ITalendProcessJavaProject)1 OpenAnotherVersionResrouceWizard (org.talend.designer.camel.resource.ui.wizards.OpenAnotherVersionResrouceWizard)1 IDesignerCoreService (org.talend.designer.core.IDesignerCoreService)1 OpenExistVersionProcessWizard (org.talend.designer.core.ui.wizards.OpenExistVersionProcessWizard)1 IRunProcessService (org.talend.designer.runprocess.IRunProcessService)1 PropertiesWizard (org.talend.metadata.managment.ui.wizard.PropertiesWizard)1