use of org.eclipse.jface.viewers.StructuredSelection in project tdi-studio-se by Talend.
the class TalendZipFileExportWizard2 method init.
public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
this.selection = currentSelection;
List selectedResources = IDE.computeSelectedResources(currentSelection);
if (!selectedResources.isEmpty()) {
this.selection = new StructuredSelection(selectedResources);
}
// setWindowTitle(DataTransferMessages.DataTransfer_export);
//$NON-NLS-1$
setWindowTitle(Messages.getString("DataTransferMessages.DataTransfer_export"));
// setDefaultPageImageDescriptor(IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/exportzip_wiz.png"));//$NON-NLS-1$
setDefaultPageImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(IDEWorkbenchPlugin.IDE_WORKBENCH, //$NON-NLS-1$
"$nl$/icons/full/wizban/exportzip_wiz.png"));
setNeedsProgressMonitor(true);
}
use of org.eclipse.jface.viewers.StructuredSelection in project tesb-studio-se by Talend.
the class RouteResourceSelectionDialog method createContents.
@Override
protected Control createContents(Composite parent) {
final Control c = super.createContents(parent);
getButton(IDialogConstants.OK_ID).setEnabled(false);
// avoid NPE in ISelectionChangedListener
if (null != selectedNodeId) {
final IRepositoryNode node = getNodeById((IRepositoryNode) repositoryTreeViewer.getInput(), selectedNodeId);
if (null != node) {
repositoryTreeViewer.setSelection(new StructuredSelection(node), true);
}
}
return c;
}
use of org.eclipse.jface.viewers.StructuredSelection in project tesb-studio-se by Talend.
the class OpenJobAction method init.
@Override
public void init(TreeViewer viewer, IStructuredSelection selection) {
if (selection.size() != 1) {
setEnabled(false);
return;
}
IRepositoryNode node = (IRepositoryNode) selection.getFirstElement();
if (!ERepositoryObjectType.SERVICESOPERATION.equals((ERepositoryObjectType) node.getProperties(EProperties.CONTENT_TYPE)) || !WSDLUtils.isOperationInBinding(node)) {
// not enabled if the operation doesn't define in binding
setEnabled(false);
return;
}
String jobId = getReferenceJobId(node);
if (jobId == null) {
setEnabled(false);
return;
}
IRepositoryNode repoNode = RepositorySeekerManager.getInstance().searchRepoViewNode(jobId, false);
jobNode = repoNode == null ? null : (RepositoryNode) repoNode;
if (jobNode == null) {
removeReferenecJobId(node);
setEnabled(false);
return;
}
final IStructuredSelection jobSelection = new StructuredSelection(jobNode);
setSpecialSelection(new ISelectionProvider() {
public void setSelection(ISelection arg0) {
}
public void removeSelectionChangedListener(ISelectionChangedListener arg0) {
}
public ISelection getSelection() {
return jobSelection;
}
public void addSelectionChangedListener(ISelectionChangedListener arg0) {
}
});
super.init(viewer, jobSelection);
}
use of org.eclipse.jface.viewers.StructuredSelection in project tdi-studio-se by Talend.
the class JobScriptsExportWizard method init.
/*
* (non-Javadoc) Method declared on IWorkbenchWizard.
*/
@Override
public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
selection = currentSelection;
List selectedResources = IDE.computeSelectedResources(currentSelection);
if (!selectedResources.isEmpty()) {
selection = new StructuredSelection(selectedResources);
}
populateUIMessage();
}
use of org.eclipse.jface.viewers.StructuredSelection in project tdi-studio-se by Talend.
the class PublishOnSpagoExportWizard method init.
/*
* (non-Javadoc) Method declared on IWorkbenchWizard.
*/
public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
this.selection = currentSelection;
List selectedResources = IDE.computeSelectedResources(currentSelection);
if (!selectedResources.isEmpty()) {
this.selection = new StructuredSelection(selectedResources);
}
//$NON-NLS-1$
setWindowTitle(Messages.getString("PublishOnSpagoExportWizard.publishJob"));
// setDefaultPageImageDescriptor(IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/exportzip_wiz.png"));//$NON-NLS-1$
setDefaultPageImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(IDEWorkbenchPlugin.IDE_WORKBENCH, //$NON-NLS-1$
"$nl$/icons/full/wizban/exportzip_wiz.png"));
setNeedsProgressMonitor(true);
}
Aggregations