use of org.eclipse.ui.IWorkbench in project tesb-studio-se by Talend.
the class ExportServiceAction method doRun.
@Override
protected void doRun() {
try {
if (!isAllOperationsAssignedJob(serviceItem)) {
boolean isContinue = MessageDialog.openQuestion(shell, Messages.ExportServiceAction_noJobDialogTitle, Messages.ExportServiceAction_noJobDialogMsg);
if (!isContinue) {
return;
}
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
ServiceExportWizard processWizard = new ServiceExportWizard(serviceItem);
IWorkbench workbench = getWorkbench();
processWizard.setWindowTitle(EXPORT_SERVICE_LABEL);
WizardDialog dialog = new WizardDialog(shell, processWizard);
workbench.saveAllEditors(true);
dialog.open();
}
use of org.eclipse.ui.IWorkbench in project tdi-studio-se by Talend.
the class JobSettings method getView.
/**
* ggu Comment method "refreshView".
*/
private static JobSettingsView getView() {
IWorkbench workbench = PlatformUI.getWorkbench();
if (workbench == null) {
return null;
}
IWorkbenchWindow benchWindow = workbench.getActiveWorkbenchWindow();
if (benchWindow == null) {
return null;
}
IWorkbenchPage page = benchWindow.getActivePage();
if (page == null) {
return null;
}
IViewPart view = page.findView(JobSettingsView.ID);
if (view == null) {
try {
// view = page.showView(JobSettingsView.ID);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
if (view != null && view instanceof JobSettingsView) {
return (JobSettingsView) view;
}
return null;
}
use of org.eclipse.ui.IWorkbench in project bndtools by bndtools.
the class WorkingSetTracker method doWorkingSets.
static void doWorkingSets(final Project model, final IProject targetProject) {
IWorkbench workbench = PlatformUI.getWorkbench();
final IWorkingSetManager workingSetManager = workbench.getWorkingSetManager();
String mergeProperties = model.mergeProperties("-workingset");
if (mergeProperties == null)
return;
Parameters memberShips = new Parameters(mergeProperties);
IWorkingSet[] allWorkingSets = workingSetManager.getAllWorkingSets();
for (IWorkingSet currentWorkingSet : allWorkingSets) {
Attrs attrs = memberShips.remove(currentWorkingSet.getName());
boolean shouldBeMember = attrs != null && Processor.isTrue(attrs.get("member", "true"));
IAdaptable[] elements = currentWorkingSet.getElements();
List<IAdaptable> members = new ExtList<>(elements);
boolean foundProjectInCurrentWorkingSet = false;
for (Iterator<IAdaptable> it = members.iterator(); it.hasNext(); ) {
IAdaptable member = it.next();
if (member.getAdapter(IProject.class) == targetProject) {
foundProjectInCurrentWorkingSet = true;
if (!shouldBeMember) {
it.remove();
}
}
}
if (!foundProjectInCurrentWorkingSet && shouldBeMember) {
members.add(targetProject);
}
if (elements.length != members.size()) {
updateWorkingSet(currentWorkingSet, members);
}
}
for (final Entry<String, Attrs> e : memberShips.entrySet()) {
String name = e.getKey();
boolean isMember = Processor.isTrue(e.getValue().get("member", "true"));
if (!isMember)
continue;
if (!JAVAID_P.matcher(name).matches()) {
SetLocation error = model.warning("Invalid working set name '%s'. Must use pattern of Java identifier", name);
error.file(model.getPropertiesFile().getAbsolutePath());
error.header("-workingset");
continue;
}
IAdaptable[] members = new IAdaptable[1];
members[0] = targetProject;
IWorkingSet newWorkingSet = workingSetManager.createWorkingSet(name, members);
newWorkingSet.setId("org.eclipse.jdt.ui.JavaWorkingSetPage");
newWorkingSet.setLabel(null);
workingSetManager.addWorkingSet(newWorkingSet);
}
}
use of org.eclipse.ui.IWorkbench in project bndtools by bndtools.
the class MissingWorkspaceMarkerResolutionGenerator method getResolutions.
@Override
public IMarkerResolution[] getResolutions(IMarker marker) {
return new IMarkerResolution[] { new IMarkerResolution() {
@Override
public void run(IMarker marker) {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
WorkspaceSetupWizard wizard = new WorkspaceSetupWizard();
wizard.init(workbench, StructuredSelection.EMPTY);
WizardDialog dialog = new WizardDialog(window.getShell(), wizard);
dialog.open();
}
@Override
public String getLabel() {
return "Open 'New Bnd OSGi Workspace' Wizard";
}
} };
}
use of org.eclipse.ui.IWorkbench in project Palladio-Editors-Sirius by PalladioSimulator.
the class NewPalladioProjectWizard method getCurrentPerspectiveId.
private String getCurrentPerspectiveId() {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
IWorkbenchPage page = window.getActivePage();
IPerspectiveDescriptor perspective = page.getPerspective();
return perspective.getId();
}
Aggregations