use of org.eclipse.jface.viewers.ComboViewer in project tdi-studio-se by Talend.
the class HL7OutputLinkUI method createCombo.
/*
* (non-Javadoc)
*
* @see org.talend.designer.hl7.ui.HL7UI#createCombo(org.eclipse.swt.widgets.Composite)
*/
@Override
protected void createCombo(Composite mainComposite) {
metaTableViewer = new ComboViewer(mainComposite, SWT.NONE | SWT.READ_ONLY);
metaTableViewer.setContentProvider(new ArrayContentProvider());
metaTableViewer.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
if (element instanceof IConnection) {
return ((IConnection) element).getUniqueName();
}
return super.getText(element);
}
});
List<? extends IConnection> incomingConnections = NodeUtil.getIncomingConnections(externalNode, IConnectionCategory.FLOW);
metaTableViewer.setInput(incomingConnections);
final Combo combo = metaTableViewer.getCombo();
combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
combo.select(0);
combo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (hl7Manager != null) {
((HL7OutputManager) hl7Manager).setCurrentSchema(combo.getText());
}
IStructuredSelection selection = (IStructuredSelection) metaTableViewer.getSelection();
Object obj = selection.getFirstElement();
xmlViewer.refresh();
xmlViewer.expandAll();
schemaViewer.setInput(((IConnection) obj).getMetadataTable().getListColumns());
initlinkers();
}
});
}
use of org.eclipse.jface.viewers.ComboViewer in project tdi-studio-se by Talend.
the class FOXMultiSchemaUI method createCombo.
/*
* (non-Javadoc)
*
* @see org.talend.designer.fileoutputxml.ui.FOXUI#createCombo(org.eclipse.swt.widgets.Composite)
*/
@Override
protected void createCombo(Composite parent) {
metaTableViewer = new ComboViewer(parent, SWT.NONE);
metaTableViewer.setContentProvider(new ArrayContentProvider());
metaTableViewer.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
if (element instanceof IConnection) {
return ((IConnection) element).getUniqueName();
}
return super.getText(element);
}
});
List<? extends IConnection> incomingConnections = NodeUtil.getIncomingConnections(externalNode, IConnectionCategory.FLOW);
metaTableViewer.setInput(incomingConnections);
final Combo combo = metaTableViewer.getCombo();
combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
combo.select(0);
combo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
IStructuredSelection selection = (IStructuredSelection) metaTableViewer.getSelection();
Object obj = selection.getFirstElement();
if (obj instanceof IConnection) {
foxManager.setCurrentSchema(combo.getText());
// xmlViewer.setInput(foxManager.getTreeData());
xmlViewer.refresh();
schemaViewer.setInput(((IConnection) obj).getMetadataTable().getListColumns());
// record the schema
// refreshXMLViewer(null);
redrawLinkers();
}
}
});
}
use of org.eclipse.jface.viewers.ComboViewer in project tdi-studio-se by Talend.
the class DeploymentComposite method createControl.
private void createControl() {
setLayout(new GridLayout());
setBackground(getParent().getBackground());
Composite composite = new Composite(this, SWT.NONE);
GridLayout layout = new GridLayout(2, false);
layout.horizontalSpacing = 10;
layout.verticalSpacing = 10;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
groupIdCheckbox = //$NON-NLS-1$
widgetFactory.createButton(//$NON-NLS-1$
composite, //$NON-NLS-1$
Messages.getString("DeploymentComposite.gourpIdLabel"), SWT.CHECK);
groupIdCheckbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
groupIdText = new Text(composite, SWT.BORDER);
GridData groupIdTextData = new GridData(GridData.FILL_HORIZONTAL);
groupIdTextData.widthHint = 200;
groupIdText.setLayoutData(groupIdTextData);
versionCheckbox = //$NON-NLS-1$
widgetFactory.createButton(//$NON-NLS-1$
composite, //$NON-NLS-1$
Messages.getString("DeploymentComposite.versionLabel"), SWT.CHECK);
versionCheckbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
versionText = new Text(composite, SWT.BORDER);
GridData versionTextData = new GridData(GridData.FILL_HORIZONTAL);
versionTextData.widthHint = 200;
versionText.setLayoutData(versionTextData);
//$NON-NLS-1$
buildTypeLabel = widgetFactory.createLabel(composite, Messages.getString("DeploymentComposite.buildTypeLabel"));
buildTypeLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
buildTypeCombo = new ComboViewer(widgetFactory.createCCombo(composite, SWT.READ_ONLY | SWT.BORDER));
final Control buildTypeControl = buildTypeCombo.getControl();
GridData buildTypeComboData = new GridData(GridData.FILL_HORIZONTAL);
buildTypeComboData.widthHint = 200;
buildTypeControl.setLayoutData(buildTypeComboData);
buildTypeCombo.setContentProvider(ArrayContentProvider.getInstance());
buildTypeCombo.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
if (element instanceof BuildType) {
return ((BuildType) element).getLabel();
}
return super.getText(element);
}
});
}
use of org.eclipse.jface.viewers.ComboViewer in project bndtools by bndtools.
the class RunFrameworkPart method createSection.
final void createSection(Section section, FormToolkit tk) {
section.setText("Core Runtime");
Composite composite = tk.createComposite(section);
section.setClient(composite);
Label lblFramework = new Label(composite, SWT.NONE);
tk.adapt(lblFramework, true, true);
lblFramework.setText("OSGi Framework:");
cmbFramework = new Combo(composite, SWT.DROP_DOWN);
tk.adapt(cmbFramework);
tk.paintBordersFor(cmbFramework);
cmbFramework.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
frameworkViewer = new ComboViewer(cmbFramework);
frameworkViewer.setUseHashlookup(true);
frameworkViewer.setContentProvider(fwkContentProvider);
Label lblExecEnv = tk.createLabel(composite, "Execution Env.:");
cmbExecEnv = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
ControlDecoration eeDecor = new ControlDecoration(cmbExecEnv, SWT.LEFT | SWT.TOP, composite);
eeDecor.setImage(FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION).getImage());
eeDecor.setDescriptionText("The runtime Java Virtual Machine will be required/assumed " + "\nto support this Execution Environment");
eeViewer = new ComboViewer(cmbExecEnv);
eeViewer.setContentProvider(ArrayContentProvider.getInstance());
eeViewer.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
return ((EE) element).getEEName();
}
});
eeViewer.setInput(EE.values());
// Listeners
cmbFramework.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
lock.ifNotModifying(new Runnable() {
@Override
public void run() {
markDirty();
selectedFramework = cmbFramework.getText();
}
});
}
});
frameworkViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
lock.ifNotModifying(new Runnable() {
@Override
public void run() {
Object element = ((IStructuredSelection) frameworkViewer.getSelection()).getFirstElement();
if (element instanceof LoadingContentElement) {
return;
}
markDirty();
if (element == null)
selectedFramework = null;
else
selectedFramework = element.toString();
}
});
}
});
eeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(final SelectionChangedEvent event) {
lock.ifNotModifying(new Runnable() {
@Override
public void run() {
markDirty();
selectedEE = (EE) ((IStructuredSelection) event.getSelection()).getFirstElement();
}
});
}
});
GridLayout layout = new GridLayout(2, false);
layout.horizontalSpacing = 10;
composite.setLayout(layout);
lblFramework.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
GridData gd;
gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
gd.widthHint = 20;
gd.heightHint = 20;
cmbFramework.setLayoutData(gd);
lblExecEnv.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
gd.widthHint = 20;
gd.heightHint = 20;
cmbExecEnv.setLayoutData(gd);
}
use of org.eclipse.jface.viewers.ComboViewer in project bndtools by bndtools.
the class NewDSComponentWizardPage method createLifecycleMethodStubControls.
protected void createLifecycleMethodStubControls(Composite composite, int nColumns) {
fLifecycleMethodDialogField.doFillIntoGrid(composite, nColumns - 1);
DialogField.createEmptySpace(composite);
Combo cmbActivateStub = fLifecycleMethodDialogField.getComboControl(composite);
vwrActivateStub = new ComboViewer(cmbActivateStub);
vwrActivateStub.setContentProvider(ArrayContentProvider.getInstance());
vwrActivateStub.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
return ((ActivateSignature) element).label;
}
});
vwrActivateStub.setInput(EnumSet.allOf(ActivateSignature.class));
vwrActivateStub.setSelection(new StructuredSelection(activateSignature), true);
vwrActivateStub.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
ISelection sel = event.getSelection();
if (!sel.isEmpty() && sel instanceof IStructuredSelection) {
activateSignature = (ActivateSignature) ((IStructuredSelection) sel).getFirstElement();
} else {
activateSignature = ActivateSignature.NoActivate;
}
activateSignatureStatus = activateSignatureChanged();
handleFieldChanged("activateSignature");
}
});
}
Aggregations