use of org.eclipse.jface.viewers.StructuredSelection in project generator by mybatis.
the class RunGeneratorAction method selectionChanged.
public void selectionChanged(IAction action, ISelection selection) {
StructuredSelection ss = (StructuredSelection) selection;
ConfigurationFileAdapter adapter = (ConfigurationFileAdapter) ss.getFirstElement();
if (adapter != null) {
selectedFile = adapter.getBaseFile();
}
}
use of org.eclipse.jface.viewers.StructuredSelection in project tdi-studio-se by Talend.
the class OpenJobAction method run.
@Override
public void run() {
List<ERepositoryObjectType> repObjectTypes = new ArrayList<ERepositoryObjectType>();
repObjectTypes.add(ERepositoryObjectType.PROCESS);
if (PluginChecker.isStormPluginLoader()) {
repObjectTypes.add(ERepositoryObjectType.PROCESS_STORM);
}
if (PluginChecker.isMapReducePluginLoader()) {
repObjectTypes.add(ERepositoryObjectType.PROCESS_MR);
}
final OpenJobSelectionDialog dialog = new OpenJobSelectionDialog(window.getShell(), repObjectTypes);
if (dialog.open() == RepositoryReviewDialog.OK) {
EditProcess editProcess = new EditProcess() {
/*
* (non-Javadoc)
*
* @see org.talend.repository.ui.actions.AContextualAction#getSelection()
*/
@Override
public ISelection getSelection() {
return new StructuredSelection(dialog.getResult());
}
};
editProcess.run();
}
}
use of org.eclipse.jface.viewers.StructuredSelection in project tdi-studio-se by Talend.
the class ProcessView method selectTab.
public void selectTab(final EComponentCategory category) {
if (tabFactory.getSelection().getCategory().equals(category)) {
return;
}
List<TalendPropertyTabDescriptor> allTabs = tabFactory.getInput();
final List<TalendPropertyTabDescriptor> selection = new ArrayList<TalendPropertyTabDescriptor>();
for (TalendPropertyTabDescriptor talendPropertyTabDescriptor : allTabs) {
if (talendPropertyTabDescriptor.getCategory().equals(category)) {
dc = new ProcessComposite(tabFactory.getTabComposite(), SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS);
// createBasicComposite(tabFactory.getTabComposite(), element, null);
refresh();
selection.add(talendPropertyTabDescriptor);
}
}
tabFactory.setSelection(new StructuredSelection() {
@Override
public List toList() {
return selection;
}
});
}
use of org.eclipse.jface.viewers.StructuredSelection in project tdi-studio-se by Talend.
the class ConfigureChartDialog method createSeriesConfigControls.
/**
* Creates the controls for series configuration.
*
* @param parent The parent composite
*/
private void createSeriesConfigControls(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, false);
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
Label label = new Label(composite, SWT.NONE);
label.setText(Messages.monitoredAttributesLabel);
GridData gridData = new GridData();
gridData.horizontalSpan = 2;
label.setLayoutData(gridData);
attributesViewer = createAttributesViewer(composite);
createButtons(composite);
if (attributes.size() > 0) {
attributesViewer.setSelection(new StructuredSelection(attributes.get(0)));
}
}
use of org.eclipse.jface.viewers.StructuredSelection in project tdi-studio-se by Talend.
the class ConfigureChartDialog method removeAttribute.
/**
* Removes the given attribute.
*
* @param attribute The monitored attribute
*/
void removeAttribute(MBeanAttribute attribute) {
attributes.remove(attribute);
attributesViewer.setInput(attributes.toArray(new MBeanAttribute[attributes.size()]));
removedAttributes.add(attribute);
if (attributes.size() > 0) {
attributesViewer.setSelection(new StructuredSelection(attributes.get(0)));
}
}
Aggregations