use of org.eclipse.jface.viewers.IStructuredSelection in project tdi-studio-se by Talend.
the class EditRoutineAction method doRun.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
protected void doRun() {
if (repositoryNode == null) {
repositoryNode = (RepositoryNode) ((IStructuredSelection) getSelection()).getFirstElement();
}
RoutineItem routineItem = (RoutineItem) repositoryNode.getObject().getProperty().getItem();
try {
openRoutineEditor(routineItem, false);
refresh(repositoryNode);
// CorePlugin.getDefault().getLibrariesService().resetModulesNeeded();
CorePlugin.getDefault().getRunProcessService().updateLibraries(new HashSet<ModuleNeeded>(), null);
} catch (PartInitException e) {
MessageBoxExceptionHandler.process(e);
} catch (SystemException e) {
MessageBoxExceptionHandler.process(e);
}
}
use of org.eclipse.jface.viewers.IStructuredSelection in project tdi-studio-se by Talend.
the class ReadRoutineAction method doRun.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
protected void doRun() {
if (repositoryNode == null && getSelection() != null) {
repositoryNode = (RepositoryNode) ((IStructuredSelection) getSelection()).getFirstElement();
}
RoutineItem routineItem = (RoutineItem) repositoryNode.getObject().getProperty().getItem();
Property updatedProperty = null;
try {
updatedProperty = ProxyRepositoryFactory.getInstance().getLastVersion(new Project(ProjectManager.getInstance().getProject(routineItem)), routineItem.getProperty().getId()).getProperty();
// repositoryNode.getObject().setProperty(updatedProperty);
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
routineItem = (RoutineItem) repositoryNode.getObject().getProperty().getItem();
try {
openRoutineEditor(routineItem, true);
} catch (PartInitException e) {
MessageBoxExceptionHandler.process(e);
} catch (SystemException e) {
MessageBoxExceptionHandler.process(e);
}
}
use of org.eclipse.jface.viewers.IStructuredSelection in project tdi-studio-se by Talend.
the class DetecteViewImpactAction method doRun.
@Override
protected void doRun() {
RepositoryNode node = getCurrentRepositoryNode();
if (node == null) {
return;
}
IStructuredSelection selection = new StructuredSelection(node);
// try to check via extension point first.
UpdateManagerProviderDetector.INSTANCE.updateForRepository(selection, true);
}
use of org.eclipse.jface.viewers.IStructuredSelection in project tdi-studio-se by Talend.
the class ConnectionFormComposite method getRepository.
public IRepositoryFactory getRepository() {
IRepositoryFactory repositoryFactory = null;
IStructuredSelection sel = (IStructuredSelection) repositoryCombo.getSelection();
repositoryFactory = (IRepositoryFactory) sel.getFirstElement();
return repositoryFactory;
}
use of org.eclipse.jface.viewers.IStructuredSelection in project tdi-studio-se by Talend.
the class AbstractSection method setInput.
@Override
public void setInput(IWorkbenchPart part, ISelection selection) {
super.setInput(part, selection);
Assert.isTrue(selection instanceof IStructuredSelection);
Object input = ((IStructuredSelection) selection).getFirstElement();
if (!(input instanceof RepositoryNode)) {
if (input instanceof IAdaptable) {
// see ProcessPart.getAdapter()
IAdaptable adaptable = (IAdaptable) input;
input = adaptable.getAdapter(RepositoryNode.class);
}
}
Assert.isTrue(input instanceof RepositoryNode);
repositoryNode = (RepositoryNode) input;
repositoryObject = repositoryNode.getObject();
if (repositoryObject == null) {
repositoryObject = new EmptyRepositoryObject();
enableControls(false);
showControls(false);
return;
}
manageLock();
ERepositoryObjectType type = repositoryObject.getRepositoryObjectType();
showControls(type != ERepositoryObjectType.METADATA_CON_TABLE);
}
Aggregations