Search in sources :

Example 1 with ProcessVersionComposite

use of org.talend.designer.core.ui.views.jobsettings.tabs.ProcessVersionComposite in project tdi-studio-se by Talend.

the class JobSettingsView method getSelection.

/*
     * (non-Javadoc)
     *
     * @see org.talend.designer.core.ui.views.properties.IJobSettingsView#getSelection()
     */
@Override
public ISelection getSelection() {
    ISVNUiProviderService service = null;
    if (PluginChecker.isSVNProviderPluginLoaded()) {
        service = (ISVNUiProviderService) GlobalServiceRegister.getDefault().getService(ISVNUiProviderService.class);
    }
    if (currentSelectedTab == null) {
        return null;
    }
    IDynamicProperty dc = currentSelectedTab.getPropertyComposite();
    if (dc instanceof ProcessVersionComposite) {
        return ((ProcessVersionComposite) dc).getSelection();
    } else if (service != null && service.isSVNHistoryComposite(dc)) {
        return service.getSVNHistorySelection(dc);
    } else if (CorePlugin.getDefault().getDiagramModelService().isInstanceOfBusinessAssignmentComposite(dc)) {
        IRepositoryView repositoryView = RepositoryManagerHelper.findRepositoryView();
        if (repositoryView != null) {
            return repositoryView.getViewer().getSelection();
        }
    }
    return null;
}
Also used : ProcessVersionComposite(org.talend.designer.core.ui.views.jobsettings.tabs.ProcessVersionComposite) IDynamicProperty(org.talend.core.ui.properties.tab.IDynamicProperty) ISVNUiProviderService(org.talend.core.ui.services.ISVNUiProviderService) IRepositoryView(org.talend.repository.ui.views.IRepositoryView)

Example 2 with ProcessVersionComposite

use of org.talend.designer.core.ui.views.jobsettings.tabs.ProcessVersionComposite in project tdi-studio-se by Talend.

the class JobSettingsView method createTabComposite.

private IDynamicProperty createTabComposite(Composite parent, Object data, EComponentCategory category) {
    final int style = SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS;
    IDynamicProperty dynamicComposite = null;
    if (EComponentCategory.EXTRA.equals(category)) {
        // achen modify to fix bug 0006241
        Process process = getElement();
        boolean isJoblet = AbstractProcessProvider.isExtensionProcessForJoblet(process);
        if (isJoblet) {
            dynamicComposite = new MultipleThreadDynamicComposite(parent, style, category, (Element) data, true);
        } else {
            dynamicComposite = new ExtraComposite(parent, style, category, (Element) data, true);
            CoreUIPlugin.setCSSId(dynamicComposite.getComposite(), //$NON-NLS-1$
            "org-talend-designer-core-ui-views-jobsettings-JobSettingsView-ExtraComposite");
        }
    } else if (EComponentCategory.STATSANDLOGS.equals(category)) {
        dynamicComposite = new StatsAndLogsComposite(parent, style, category, (Element) data);
        CoreUIPlugin.setCSSId(dynamicComposite.getComposite(), //$NON-NLS-1$
        "org-talend-designer-core-ui-views-jobsettings-JobSettingsView-StatsAndLogsComposite");
    } else if (EComponentCategory.CONTEXT.equals(category)) {
    // TODO
    // dynamicComposite = new ContextDynamicComposite(parent, style, category, element);
    } else if (EComponentCategory.MAIN.equals(category)) {
        dynamicComposite = new MainComposite(parent, SWT.NONE, tabFactory, (IRepositoryViewObject) data);
    } else if (EComponentCategory.VERSIONS.equals(category)) {
        if (allowVerchange) {
            dynamicComposite = new ProcessVersionComposite(parent, SWT.NONE, tabFactory.getWidgetFactory(), (IRepositoryViewObject) data);
        }
    } else if (EComponentCategory.HEADERFOOTER.equals(category)) {
        if (GlobalServiceRegister.getDefault().isServiceRegistered(IHeaderFooterProviderService.class)) {
            IHeaderFooterProviderService headerFooterService = (IHeaderFooterProviderService) GlobalServiceRegister.getDefault().getService(IHeaderFooterProviderService.class);
            if (headerFooterService.isVisible()) {
                dynamicComposite = new HeaderFooterComposite(parent, SWT.NONE, tabFactory.getWidgetFactory(), (IRepositoryViewObject) data);
            }
        }
    } else if (EComponentCategory.SVNHISTORY.equals(category) && svnUIService != null) {
        dynamicComposite = svnUIService.createProcessSVNHistoryComposite(parent, tabFactory.getWidgetFactory(), (IRepositoryViewObject) data);
    } else if (EComponentCategory.GITHISTORY.equals(category) && gitUIService != null) {
        dynamicComposite = gitUIService.createProcessGitHistoryComposite(parent, this, tabFactory.getWidgetFactory(), (IRepositoryViewObject) data);
    } else if (EComponentCategory.APPEARANCE.equals(category)) {
        dynamicComposite = (IDynamicProperty) CorePlugin.getDefault().getDiagramModelService().getBusinessAppearanceComposite(parent, SWT.NONE, tabFactory.getWidgetFactory(), selectedModel);
    } else if (EComponentCategory.RULERS_AND_GRID.equals(category)) {
        dynamicComposite = (IDynamicProperty) CorePlugin.getDefault().getDiagramModelService().getBusinessRulersAndGridComposite(parent, SWT.NONE, tabFactory.getWidgetFactory(), null);
    } else if (EComponentCategory.ASSIGNMENT.equals(category)) {
        dynamicComposite = (IDynamicProperty) CorePlugin.getDefault().getDiagramModelService().getBusinessAssignmentComposite(parent, SWT.NONE, tabFactory.getWidgetFactory(), selectedModel);
    } else if (EComponentCategory.DEPLOYMENT.equals(category)) {
        dynamicComposite = new DeploymentComposite(parent, SWT.NONE, tabFactory.getWidgetFactory(), (IRepositoryViewObject) data);
    }
    if (dynamicComposite != null) {
        dynamicComposite.refresh();
    }
    currentSelectedTab.setPropertyComposite(dynamicComposite);
    return dynamicComposite;
}
Also used : IDynamicProperty(org.talend.core.ui.properties.tab.IDynamicProperty) Element(org.talend.core.model.process.Element) IProcess(org.talend.core.model.process.IProcess) Process(org.talend.designer.core.ui.editor.process.Process) StatsAndLogsComposite(org.talend.designer.core.ui.views.statsandlogs.StatsAndLogsComposite) MultipleThreadDynamicComposite(org.talend.designer.core.ui.views.properties.MultipleThreadDynamicComposite) ProcessVersionComposite(org.talend.designer.core.ui.views.jobsettings.tabs.ProcessVersionComposite) HeaderFooterComposite(org.talend.designer.core.ui.views.jobsettings.tabs.HeaderFooterComposite) DeploymentComposite(org.talend.designer.core.ui.views.jobsettings.tabs.DeploymentComposite) IHeaderFooterProviderService(org.talend.core.ui.IHeaderFooterProviderService) MainComposite(org.talend.designer.core.ui.views.jobsettings.tabs.MainComposite) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject)

Example 3 with ProcessVersionComposite

use of org.talend.designer.core.ui.views.jobsettings.tabs.ProcessVersionComposite in project tdi-studio-se by Talend.

the class OpenExistVersionProcessPage method createControl.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
     */
public void createControl(Composite parent) {
    parent.setLayout(new GridLayout());
    versionListComposite = new ProcessVersionComposite(parent, SWT.NULL, null, processObject);
    versionListComposite.setParentWizard(this);
    versionListComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    setControl(versionListComposite);
    versionListComposite.refresh();
    Composite createNewVersionButtonComposite = new Composite(parent, SWT.NONE);
    createNewVersionButtonComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    createNewVersionButtonComposite.setLayout(new FormLayout());
    createNewVersionButton = new Button(createNewVersionButtonComposite, SWT.CHECK);
    //$NON-NLS-1$
    createNewVersionButton.setText(Messages.getString("OpenExistVersionProcessPage.textContent"));
    createNewVersionButton.setEnabled(!alreadyEditedByUser && !isContainedRefProject());
    IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
    if (factory.isUserReadOnlyOnCurrentProject()) {
        createNewVersionButton.setEnabled(false);
    }
    GC gc = new GC(createNewVersionButton);
    //$NON-NLS-1$
    Point labelSize = gc.stringExtent(Messages.getString("OpenExistVersionProcessPage.textContent"));
    gc.dispose();
    FormData date = new FormData();
    date.left = new FormAttachment(0, 0);
    date.right = new FormAttachment(0, labelSize.x);
    date.top = new FormAttachment(0, 0);
    date.bottom = new FormAttachment(100, 0);
    createNewVersionButton.setLayoutData(date);
    Label redLabel = new Label(createNewVersionButtonComposite, SWT.NONE);
    redLabel.setText(Messages.getString("OpenExistVersionProcessPage.labelContent"));
    gc = new GC(redLabel);
    //$NON-NLS-1$
    labelSize = gc.stringExtent(Messages.getString("OpenExistVersionProcessPage.labelContent"));
    gc.dispose();
    date = new FormData();
    date.left = new FormAttachment(createNewVersionButton, 10, SWT.RIGHT);
    date.right = new FormAttachment(createNewVersionButton, 10 + labelSize.x, SWT.RIGHT);
    date.top = new FormAttachment(0, 0);
    date.bottom = new FormAttachment(100, 0);
    redLabel.setLayoutData(date);
    redLabel.setForeground(redLabel.getDisplay().getSystemColor(SWT.COLOR_RED));
    redLabel.setVisible(!createNewVersionButton.getEnabled());
    Composite bc = new Composite(parent, SWT.NULL);
    bc.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    bc.setLayout(layout);
    // Create Version
    Label versionLab = new Label(bc, SWT.NONE);
    //$NON-NLS-1$
    versionLab.setText(Messages.getString("PropertiesWizardPage.Version"));
    versionModifComposite = new Composite(bc, SWT.NONE);
    versionModifComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    GridLayout versionLayout = new GridLayout(3, false);
    versionLayout.marginHeight = 0;
    versionLayout.marginWidth = 0;
    versionLayout.horizontalSpacing = 0;
    versionModifComposite.setLayout(versionLayout);
    versionText = new Text(versionModifComposite, SWT.BORDER);
    versionText.setEnabled(false);
    versionText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    versionMajorBtn = new Button(versionModifComposite, SWT.PUSH);
    //$NON-NLS-1$
    versionMajorBtn.setText(Messages.getString("PropertiesWizardPage.Version.Major"));
    versionMajorBtn.setEnabled(!alreadyEditedByUser && !isContainedRefProject() && createNewVersionButton.getSelection());
    versionMinorBtn = new Button(versionModifComposite, SWT.PUSH);
    //$NON-NLS-1$
    versionMinorBtn.setText(Messages.getString("PropertiesWizardPage.Version.Minor"));
    versionMinorBtn.setEnabled(!alreadyEditedByUser && !isContainedRefProject() && createNewVersionButton.getSelection());
    versionText.setText(getProperty().getVersion());
    addListener();
    setPageComplete(false);
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) ProcessVersionComposite(org.talend.designer.core.ui.views.jobsettings.tabs.ProcessVersionComposite) Composite(org.eclipse.swt.widgets.Composite) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) Point(org.eclipse.swt.graphics.Point) ProcessVersionComposite(org.talend.designer.core.ui.views.jobsettings.tabs.ProcessVersionComposite) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) GC(org.eclipse.swt.graphics.GC) IProxyRepositoryFactory(org.talend.repository.model.IProxyRepositoryFactory) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Aggregations

ProcessVersionComposite (org.talend.designer.core.ui.views.jobsettings.tabs.ProcessVersionComposite)3 IDynamicProperty (org.talend.core.ui.properties.tab.IDynamicProperty)2 GC (org.eclipse.swt.graphics.GC)1 Point (org.eclipse.swt.graphics.Point)1 FormAttachment (org.eclipse.swt.layout.FormAttachment)1 FormData (org.eclipse.swt.layout.FormData)1 FormLayout (org.eclipse.swt.layout.FormLayout)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Button (org.eclipse.swt.widgets.Button)1 Composite (org.eclipse.swt.widgets.Composite)1 Label (org.eclipse.swt.widgets.Label)1 Text (org.eclipse.swt.widgets.Text)1 Element (org.talend.core.model.process.Element)1 IProcess (org.talend.core.model.process.IProcess)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 IHeaderFooterProviderService (org.talend.core.ui.IHeaderFooterProviderService)1 ISVNUiProviderService (org.talend.core.ui.services.ISVNUiProviderService)1 Process (org.talend.designer.core.ui.editor.process.Process)1 DeploymentComposite (org.talend.designer.core.ui.views.jobsettings.tabs.DeploymentComposite)1