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;
}
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;
}
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);
}
Aggregations