use of org.eclipse.ui.IWorkbench in project tdi-studio-se by Talend.
the class ShowComponentSettingViewerAction method run.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
try {
page.showView(getViewId());
} catch (PartInitException e) {
// TODO Auto-generated catch block
// e.printStackTrace();
ExceptionHandler.process(e);
}
}
use of org.eclipse.ui.IWorkbench in project tdi-studio-se by Talend.
the class ShowJobSettingsViewAction method isEnabled.
@Override
public boolean isEnabled() {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
ISelection selection = CorePlugin.getDefault().getDiagramModelService().getBusinessEditorSelection(page.getActiveEditor());
if (selection instanceof IStructuredSelection) {
Object obj = ((IStructuredSelection) selection).getFirstElement();
if (obj != null) {
return true;
}
}
return false;
}
use of org.eclipse.ui.IWorkbench in project tdi-studio-se by Talend.
the class GenericRepositoryContentHandler method newSchemaWizard.
@Override
public IWizard newSchemaWizard(IWorkbench workbench, boolean creation, IRepositoryViewObject object, MetadataTable metadataTable, String[] existingNames, boolean forceReadOnly) {
if (object == null) {
return null;
}
IWorkbench wb = workbench;
if (wb == null) {
wb = PlatformUI.getWorkbench();
}
MetadataTable table = metadataTable;
if (table == null && object instanceof MetadataTableRepositoryObject) {
MetadataTableRepositoryObject metaTableRepObj = (MetadataTableRepositoryObject) object;
table = metaTableRepObj.getTable();
}
if (table == null) {
return null;
}
ConnectionItem connectionItem = (ConnectionItem) object.getProperty().getItem();
table = SchemaUtils.getMetadataTable(connectionItem.getConnection(), table.getLabel(), table.eContainer().getClass());
return new GenericSchemaWizard(wb, creation, object, connectionItem, table, forceReadOnly);
}
use of org.eclipse.ui.IWorkbench in project tdi-studio-se by Talend.
the class BindingActions method registerActions.
/**
* DOC smallet Comment method "registerActions".
*/
private void registerActions() {
IContextService contextService = (IContextService) PlatformUI.getWorkbench().getAdapter(IContextService.class);
//$NON-NLS-1$
contextService.activateContext("talend.global");
IWorkbench workbench = PlatformUI.getWorkbench();
IHandlerService handlerService = (IHandlerService) workbench.getService(IHandlerService.class);
IHandler handler;
for (IAction action : actions) {
handler = new ActionHandler(action);
handlerService.activateHandler(action.getActionDefinitionId(), handler);
}
}
use of org.eclipse.ui.IWorkbench in project tdi-studio-se by Talend.
the class BootTalendAction method run.
public void run(IAction action) {
IWorkbench workbench = PlatformUI.getWorkbench();
if (store.getInt(LOGIN_COUNTER) > 1) {
boolean openConfirm = MessageDialog.openConfirm(Display.getDefault().getActiveShell(), "Confirm", "Are you want to switch to another project");
if (!openConfirm) {
return;
}
// workbench.restart();
}
int counter = store.getInt(LOGIN_COUNTER);
store.setValue(LOGIN_COUNTER, ++counter);
IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow();
if (activeWorkbenchWindow == null) {
return;
}
IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
if (activePage == null) {
return;
}
IPerspectiveDescriptor pDescriptor = activePage.getPerspective();
if (!pDescriptor.getId().equals(TALEND_PERSPECTIVE_ID)) {
pDescriptor = getPerspective(TALEND_PERSPECTIVE_ID);
activePage.setPerspective(pDescriptor);
}
SwitchProjectAction switchAction = new SwitchProjectAction();
switchAction.run();
return;
}
Aggregations