Java Code Examples for org.eclipse.ui.IWorkbench

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project Archimedes, under directory /br.org.archimedes.core/src/br/org/archimedes/gui/handlers/.

Source file: PreferencesEditorHandler.java

  22 
vote

public DrawingEditor getDrawingEditor(){
  DrawingEditor drawingEditor=new DrawingEditor();
  IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench != null) {
    IEditorPart activeEditor=workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    if (activeEditor != null && activeEditor.getClass() == DrawingEditor.class) {
      drawingEditor=(DrawingEditor)activeEditor;
    }
  }
  return drawingEditor;
}
 

Example 2

From project bel-editor, under directory /org.openbel.editor.ui/src/org/openbel/editor/ui/.

Source file: Activator.java

  22 
vote

/** 
 * Returns the  {@link Shell shell} associated with the editor's activewindow.
 * @return {@link Shell}; may be null
 */
public Shell getShell(){
  IWorkbench workbench=this.getWorkbench();
  IWorkbenchWindow window=workbench.getActiveWorkbenchWindow();
  if (window == null)   return null;
  return window.getShell();
}
 

Example 3

From project Bio-PEPA, under directory /uk.ac.ed.inf.biopepa.ui/src/uk/ac/ed/inf/biopepa/ui/editors/.

Source file: BioPEPAEditor.java

  22 
vote

static void checkPerspective(IWorkbenchPage page){
  IPerspectiveDescriptor descriptor=page.getPerspective();
  if (descriptor == null)   return;
  String currentPerspective=descriptor.getId();
  if (!currentPerspective.equals(PerspectiveFactory.PERSPECTIVE_ID)) {
    boolean result=MessageDialog.openQuestion(page.getWorkbenchWindow().getShell(),"Switch to Bio-PEPA Perspective","This resource is associated with the Bio-PEPA perspective. Would you like to switch to the Bio-PEPA Perspective now?");
    if (result == true) {
      IWorkbench workbench=BioPEPAPlugin.getDefault().getWorkbench();
      page.setPerspective(workbench.getPerspectiveRegistry().findPerspectiveWithId(PerspectiveFactory.PERSPECTIVE_ID));
    }
  }
}
 

Example 4

From project CIShell, under directory /clients/gui/org.cishell.reference.gui.prefs.swt/src/org/cishell/reference/gui/prefs/swt/.

Source file: PreferenceGuiAlgorithm.java

  22 
vote

private Shell getParentShell(){
  IWorkbench workbench=PlatformUI.getWorkbench();
  IWorkbenchWindow[] windows=workbench.getWorkbenchWindows();
  IWorkbenchWindow window=windows[0];
  Shell parentShell=window.getShell();
  return parentShell;
}
 

Example 5

From project dawn-common, under directory /org.dawb.common.ui/src/org/dawb/common/ui/project/.

Source file: FolderImportHandler.java

  22 
vote

private void openWizard(){
  final IImportWizard wizard=new FolderLinkWizard();
  final IWorkbench workbench=PlatformUI.getWorkbench();
  final ISelectionService service=workbench.getActiveWorkbenchWindow().getSelectionService();
  final ISelection selection=service.getSelection();
  final IStructuredSelection sel=selection instanceof IStructuredSelection ? (IStructuredSelection)selection : null;
  wizard.init(workbench,sel);
  WizardDialog dialog=new WizardDialog(workbench.getActiveWorkbenchWindow().getShell(),wizard);
  dialog.setBlockOnOpen(true);
  dialog.open();
}
 

Example 6

From project dawn-isenciaui, under directory /com.isencia.passerelle.workbench.model.ui/src/main/java/com/isencia/passerelle/workbench/model/ui/utils/.

Source file: EclipseUtils.java

  22 
vote

/** 
 * @return IWorkbenchPage
 */
public static IWorkbenchPage getActivePage(){
  final IWorkbench bench=PlatformUI.getWorkbench();
  if (bench == null)   return null;
  final IWorkbenchWindow window=bench.getActiveWorkbenchWindow();
  if (window == null)   return null;
  return window.getActivePage();
}
 

Example 7

From project dawn-product, under directory /org.dawb.workbench.application/src/org/edna/workbench/application/.

Source file: Application.java

  22 
vote

public void stop(){
  final IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench == null)   return;
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 8

From project droolsjbpm-tools, under directory /drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/flow/ruleflow/view/property/action/.

Source file: ActionCompletionProcessor.java

  22 
vote

public IEditorPart getEditor(){
  IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench != null) {
    IWorkbenchWindow workbenchWindow=workbench.getActiveWorkbenchWindow();
    if (workbenchWindow != null) {
      IWorkbenchPage workbenchPage=workbenchWindow.getActivePage();
      if (workbenchPage != null) {
        return workbenchPage.getActiveEditor();
      }
    }
  }
  return null;
}
 

Example 9

From project eclim, under directory /org.eclim/java/org/eclim/eclipse/.

Source file: EclimApplication.java

  22 
vote

public synchronized static void shutdown() throws Exception {
  if (instance != null && !stopping) {
    stopping=true;
    EclimDaemon.getInstance().stop();
    final IWorkbench workbench=PlatformUI.getWorkbench();
    workbench.getDisplay().syncExec(new Runnable(){
      public void run(){
        workbench.getActiveWorkbenchWindow().close();
      }
    }
);
  }
}
 

Example 10

From project Eclipse, under directory /com.mobilesorcery.sdk.ui/src/com/mobilesorcery/sdk/ui/internal/console/.

Source file: PathLink.java

  22 
vote

private String getEditorId(){
  if (fEditorId == null) {
    IWorkbench workbench=DebugUIPlugin.getDefault().getWorkbench();
    IEditorDescriptor desc=workbench.getEditorRegistry().getDefaultEditor(getFileName(),getFileContentType());
    if (desc == null) {
      desc=workbench.getEditorRegistry().findEditor(IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID);
    }
    fEditorId=desc.getId();
  }
  return fEditorId;
}
 

Example 11

From project eclipse-integration-commons, under directory /org.springframework.ide.eclipse.uaa/src/org/springframework/ide/eclipse/internal/uaa/monitor/.

Source file: PartUsageMonitor.java

  22 
vote

/** 
 * {@inheritDoc}
 */
public void startMonitoring(IUaa manager){
  this.manager=manager;
  perspectiveToBundleIdMapper=new ExtensionIdToBundleMapper(PERSPECTIVES_EXTENSION_POINT);
  viewToBundleIdMapper=new ExtensionIdToBundleMapper(VIEWS_EXTENSION_POINT);
  editorToBundleIdMapper=new ExtensionIdToBundleMapper(EDITORS_EXTENSION_POINT);
  IWorkbench workbench=PlatformUI.getWorkbench();
  hookListeners(workbench);
}
 

Example 12

From project eclipsefp, under directory /net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/editors/cabal/.

Source file: CabalHyperlinkDetector.java

  22 
vote

public void open(){
  IWorkbench workbench=PlatformUI.getWorkbench();
  IWorkbenchWindow window=workbench.getActiveWorkbenchWindow();
  IWorkbenchPage page=window.getActivePage();
  try {
    IDE.openEditor(page,file);
  }
 catch (  PartInitException paix) {
    Shell shell=window.getShell();
    String title=UITexts.cabalHyperLinkDetector_errorTitle;
    String msg=paix.getMessage();
    ErrorDialog.openError(shell,title,msg,paix.getStatus());
  }
}
 

Example 13

From project Extensions2Services, under directory /eu.wwuk.eclipse.extsvcs.examples.client/src/eu/wwuk/eclipse/extsvcs/examples/client/.

Source file: Application.java

  22 
vote

public void stop(){
  final IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench == null)   return;
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 14

From project gda-common-rcp, under directory /uk.ac.gda.common.rcp/src/uk/ac/gda/common/rcp/util/.

Source file: EclipseUtils.java

  22 
vote

/** 
 * @return IWorkbenchPage
 */
public static IWorkbenchPage getActivePage(){
  final IWorkbench bench=PlatformUI.getWorkbench();
  if (bench == null)   return null;
  final IWorkbenchWindow window=bench.getActiveWorkbenchWindow();
  if (window == null)   return null;
  return window.getActivePage();
}
 

Example 15

From project gmc, under directory /src/org.gluster.storage.management.console/src/org/gluster/storage/management/console/.

Source file: Application.java

  22 
vote

public void stop(){
  if (!PlatformUI.isWorkbenchRunning())   return;
  final IWorkbench workbench=PlatformUI.getWorkbench();
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 16

From project hackergarten-moreunit, under directory /org.moreunit.plugin/src/org/moreunit/util/.

Source file: PluginTools.java

  22 
vote

public static IEditorPart getOpenEditorPart(){
  IWorkbench wb=PlatformUI.getWorkbench();
  IWorkbenchWindow window=wb.getActiveWorkbenchWindow();
  if (window == null)   return null;
  IWorkbenchPage page=window.getActivePage();
  if (page != null)   return page.getActiveEditor();
 else   return null;
}
 

Example 17

From project ivyde, under directory /org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/.

Source file: IvyPlugin.java

  22 
vote

/** 
 * Returns the active workbench window
 * @return the active workbench window
 */
public static IWorkbenchWindow getActiveWorkbenchWindow(){
  if (getDefault() == null) {
    return null;
  }
  IWorkbench workBench=getDefault().getWorkbench();
  if (workBench == null) {
    return null;
  }
  return workBench.getActiveWorkbenchWindow();
}
 

Example 18

From project logsaw-app, under directory /net.sf.logsaw.rcp/src/net/sf/logsaw/rcp/.

Source file: LogSawApplication.java

  22 
vote

@Override public void stop(){
  final IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench == null)   return;
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    @Override public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 19

From project mylyn-mantis, under directory /com.itsolut.mantis.ui/src/com/itsolut/mantis/ui/util/.

Source file: MantisUIUtil.java

  22 
vote

/** 
 * @return the current selection, if any
 */
public static IStructuredSelection getCurrentSelection(){
  IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench != null) {
    IWorkbenchWindow window=workbench.getActiveWorkbenchWindow();
    if (window != null) {
      ISelection sel=window.getSelectionService().getSelection();
      if (sel instanceof IStructuredSelection) {
        return (IStructuredSelection)sel;
      }
    }
  }
  return null;
}
 

Example 20

From project netifera, under directory /platform/com.netifera.platform.host/com.netifera.platform.host.filesystem.ui/src/com/netifera/platform/host/filesystem/ui/probe/.

Source file: OpenProbeFileSystemViewAction.java

  22 
vote

private IWorkbenchPage getActivePage(){
  final IWorkbenchPage[] pageHolder=new IWorkbenchPage[1];
  PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable(){
    public void run(){
      final IWorkbench wb=PlatformUI.getWorkbench();
      if (wb == null)       return;
      final IWorkbenchWindow window=wb.getActiveWorkbenchWindow();
      if (window == null)       return;
      pageHolder[0]=window.getActivePage();
    }
  }
);
  return pageHolder[0];
}
 

Example 21

From project Newsreader, under directory /bundles/org.eclipse.ecf.salvo.application/src/org/eclipse/ecf/salvo/application/internal/.

Source file: Application.java

  22 
vote

public void stop(){
  final IWorkbench workbench=PlatformUI.getWorkbench();
  if (null == workbench)   return;
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 22

From project orion.server, under directory /bundles/org.eclipse.orion.server.ui/src/org/eclipse/orion/internal/server/ui/.

Source file: Application.java

  22 
vote

public void stop(){
  if (!PlatformUI.isWorkbenchRunning())   return;
  final IWorkbench workbench=PlatformUI.getWorkbench();
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 23

From project p2-browser, under directory /com.ifedorenko.p2browser/src/com/ifedorenko/p2browser/.

Source file: Application.java

  22 
vote

public void stop(){
  if (!PlatformUI.isWorkbenchRunning())   return;
  final IWorkbench workbench=PlatformUI.getWorkbench();
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 24

From project radrails, under directory /plugins/com.aptana.radrails.rcp/src/com/aptana/radrails/rcp/.

Source file: IDEApplication.java

  22 
vote

public void stop(){
  final IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench == null)   return;
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 25

From project rascal-eclipse, under directory /src/org/rascalmpl/eclipse/library/util/.

Source file: Editors.java

  22 
vote

private IWorkbenchWindow getWorkbenchWindow(){
  IWorkbench wb=PlatformUI.getWorkbench();
  IWorkbenchWindow win=wb.getActiveWorkbenchWindow();
  if (win == null && wb.getWorkbenchWindowCount() != 0) {
    win=wb.getWorkbenchWindows()[0];
  }
  return win;
}
 

Example 26

From project rcputils, under directory /de.ralfebert.rcpsnippets/src/de/ralfebert/rcpsnippets/application/.

Source file: SnippetsApplication.java

  22 
vote

public void stop(){
  final IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench == null)   return;
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 27

From project recommenders, under directory /plugins/org.eclipse.recommenders.utils.rcp/src/org/eclipse/recommenders/utils/rcp/.

Source file: RCPUtils.java

  22 
vote

public static Optional<IWorkbenchPage> getActiveWorkbenchPage(){
  final IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench == null) {
    return absent();
  }
  final IWorkbenchWindow window=workbench.getActiveWorkbenchWindow();
  if (window == null) {
    return absent();
  }
  final IWorkbenchPage page=window.getActivePage();
  return of(page);
}
 

Example 28

From project samolisov-demo, under directory /Eclipse/RCP/Hyperbola/org.rcpbook.hyperbola.ui/src/org/rcpbook/hyperbola/ui/.

Source file: Application.java

  22 
vote

public void stop(){
  if (!PlatformUI.isWorkbenchRunning())   return;
  final IWorkbench workbench=PlatformUI.getWorkbench();
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 29

From project sandbox, under directory /xeclipse/org.xwiki.eclipse.rcp/src/main/java/org/xwiki/eclipse/rcp/.

Source file: Application.java

  22 
vote

public void stop(){
  final IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench == null)   return;
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 30

From project scisoft-icat, under directory /uk.ac.diamond.scisoft.icatexplorer.rcp/src/uk/ac/diamond/scisoft/icatexplorer/rcp/internal/.

Source file: Application.java

  22 
vote

@Override public void stop(){
  final IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench == null)   return;
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    @Override public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 31

From project scisoft-ui, under directory /uk.ac.diamond.scisoft.analysis.rcp/src/uk/ac/diamond/scisoft/analysis/rcp/editors/.

Source file: HDF5ValuePage.java

  22 
vote

private static IWorkbenchPage getActivePage(){
  final IWorkbench bench=PlatformUI.getWorkbench();
  if (bench == null)   return null;
  final IWorkbenchWindow window=bench.getActiveWorkbenchWindow();
  if (window == null)   return null;
  return window.getActivePage();
}
 

Example 32

From project sisu, under directory /sisu-examples/guice-rcp/guice-rcp-plugin/src/org/sonatype/examples/guice/rcp/.

Source file: Application.java

  22 
vote

public void stop(){
  if (!PlatformUI.isWorkbenchRunning())   return;
  final IWorkbench workbench=PlatformUI.getWorkbench();
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 33

From project studio2-rcp, under directory /plugins/com.aptana.ide.rcp/src/com/aptana/ide/rcp/.

Source file: IDEApplication.java

  22 
vote

public void stop(){
  final IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench == null)   return;
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 34

From project substeps-eclipse-plugin, under directory /com.technophobia.substeps.testlauncher/src/main/java/com/technophobia/substeps/.

Source file: FeatureRunnerPlugin.java

  22 
vote

public IWorkbenchWindow getActiveWorkbenchWindow(){
  final IWorkbench workBench=getWorkbench();
  if (workBench == null)   return null;
  if (workBench.getActiveWorkbenchWindow() != null) {
    return workBench.getActiveWorkbenchWindow();
  }
 else   if (workBench.getWorkbenchWindowCount() > 0) {
    log(IStatus.WARNING,"Could not find any active workbench window, returning window 1 of " + workBench.getWorkbenchWindowCount());
    return workBench.getWorkbenchWindows()[0];
  }
  log(IStatus.WARNING,"Could not find workbench window, returning null");
  return null;
}
 

Example 35

From project swtbot, under directory /examples/rcp/org.rcpmail/src/org/rcpmail/.

Source file: Application.java

  22 
vote

public void stop(){
  final IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench == null)   return;
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 36

From project texlipse, under directory /net.sourceforge.texlipse/source/net/sourceforge/texlipse/.

Source file: SelectedResourceManager.java

  22 
vote

/** 
 * Private constructor to use with the singleton.
 */
private SelectedResourceManager(){
  IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench != null) {
    workbench.addWindowListener(this);
    IWorkbenchWindow activeWindow=workbench.getActiveWorkbenchWindow();
    if (activeWindow != null) {
      windowActivated(activeWindow);
    }
  }
}
 

Example 37

From project tools4j, under directory /config/config-admin/config-admin-rcp/config-admin-rcp-plugin/src/org/deephacks/tools4j/config/admin/rcp/.

Source file: Application.java

  22 
vote

public void stop(){
  if (!PlatformUI.isWorkbenchRunning())   return;
  final IWorkbench workbench=PlatformUI.getWorkbench();
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 38

From project tycho-demo, under directory /tychodemo.bundle/src/tychodemo/.

Source file: Application.java

  22 
vote

public void stop(){
  if (!PlatformUI.isWorkbenchRunning())   return;
  final IWorkbench workbench=PlatformUI.getWorkbench();
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 39

From project Utah-Tools-Decision-Support, under directory /applicationGeneric/edu.utah.generic.application/src/edu/utah/cdmcc/decisionsupport/application/.

Source file: Application.java

  22 
vote

public void stop(){
  final IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench == null)   return;
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 40

From project Vega, under directory /platform/com.subgraph.vega.application/src/com/subgraph/vega/application/.

Source file: Application.java

  22 
vote

public void stop(){
  if (!PlatformUI.isWorkbenchRunning())   return;
  final IWorkbench workbench=PlatformUI.getWorkbench();
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed())       workbench.close();
    }
  }
);
}
 

Example 41

From project BHT-FPA, under directory /mailer-common/de.bht.fpa.mail.common/src/de/bht/fpa/mail/s000000/common/rcp/statusbar/.

Source file: StatusBarHelper.java

  21 
vote

/** 
 * This method returns the  {@link IStatusLineManager}. It may return <code>null</code>.
 * @return {@link IStatusLineManager} or <code>null</code>
 */
public static synchronized IStatusLineManager getStatusLineManager(){
  if (manager != null) {
    return manager;
  }
  manager=new NullStatusLineManager();
  IWorkbench wb=PlatformUI.getWorkbench();
  if (wb == null) {
    return manager;
  }
  IWorkbenchWindow win=wb.getActiveWorkbenchWindow();
  if (win == null) {
    return manager;
  }
  IWorkbenchPage page=win.getActivePage();
  if (page == null) {
    return manager;
  }
  IWorkbenchPart part=page.getActivePart();
  if (part == null) {
    return manager;
  }
  IWorkbenchPartSite site=part.getSite();
  if (site == null || !(site instanceof IViewSite)) {
    return manager;
  }
  IViewSite vSite=(IViewSite)site;
  IActionBars actionBars=vSite.getActionBars();
  if (actionBars == null) {
    return manager;
  }
  manager=actionBars.getStatusLineManager();
  return manager;
}
 

Example 42

From project BPMN2-Editor-for-Eclipse, under directory /org.eclipse.bpmn2.modeler.ui/src/org/eclipse/bpmn2/modeler/ui/editor/.

Source file: BPMN2Editor.java

  21 
vote

public void showErrorMessage(String msg){
  IWorkbench wb=PlatformUI.getWorkbench();
  IWorkbenchWindow win=wb.getActiveWorkbenchWindow();
  IWorkbenchPage page=win.getActivePage();
  IWorkbenchPart part=page.getActivePart();
  IWorkbenchPartSite site=part.getSite();
  IViewSite vSite=(IViewSite)site;
  IActionBars actionBars=vSite.getActionBars();
  if (actionBars == null)   return;
  IStatusLineManager statusLineManager=actionBars.getStatusLineManager();
  if (statusLineManager == null)   return;
  statusLineManager.setErrorMessage(msg);
  statusLineManager.markDirty();
  statusLineManager.update(true);
}
 

Example 43

From project CBCJVM, under directory /eclipse/CBC/src/cbc/helpers/.

Source file: Helper.java

  21 
vote

public IEditorPart getActiveEditor(){
  IWorkbench iworkbench=PlatformUI.getWorkbench();
  if (iworkbench == null) {
    error("Unable to fetch workbench.");
    return null;
  }
  IWorkbenchWindow iworkbenchwindow=iworkbench.getActiveWorkbenchWindow();
  if (iworkbenchwindow == null) {
    error("Unable to fetch workbench window.");
    return null;
  }
  IWorkbenchPage iworkbenchpage=iworkbenchwindow.getActivePage();
  if (iworkbenchpage == null) {
    error("Unable to fetch workbench page.");
    return null;
  }
  IEditorPart ieditorpart=iworkbenchpage.getActiveEditor();
  if (ieditorpart == null) {
    error("Unable to fetch active editor. You probably have no editors open.");
    return null;
  }
  return ieditorpart;
}
 

Example 44

From project ceylon-ide-eclipse, under directory /plugins/com.redhat.ceylon.eclipse.ui/src/com/redhat/ceylon/eclipse/code/editor/.

Source file: EditorUtility.java

  21 
vote

/** 
 * Returns an array of all editors that have an unsaved content.  If the identical content is presented in more than one editor,  only one of those editor parts is part of the result.
 * @return an array of all dirty editor parts.
 */
private static IEditorPart[] getDirtyEditors(){
  Set<IEditorInput> inputs=new HashSet<IEditorInput>();
  List<IEditorPart> result=new ArrayList<IEditorPart>(0);
  IWorkbench workbench=PlatformUI.getWorkbench();
  IWorkbenchWindow[] windows=workbench.getWorkbenchWindows();
  for (int i=0; i < windows.length; i++) {
    IWorkbenchPage[] pages=windows[i].getPages();
    for (int x=0; x < pages.length; x++) {
      IEditorPart[] editors=pages[x].getDirtyEditors();
      for (int z=0; z < editors.length; z++) {
        IEditorPart ep=editors[z];
        IEditorInput input=ep.getEditorInput();
        if (!inputs.contains(input)) {
          inputs.add(input);
          result.add(ep);
        }
      }
    }
  }
  return result.toArray(new IEditorPart[result.size()]);
}
 

Example 45

From project dawn-workflow, under directory /org.dawb.passerelle.actors.test/src/org/dawb/passerelle/actors/test/ui/.

Source file: MomlUITest.java

  21 
vote

/** 
 * runs all the example moml files. this test must be run with a dawb workspace as the workspace
 * @throws Exception
 */
@Test public void testExampleMomlModels() throws Exception {
  final IWorkbench bench=PlatformUI.getWorkbench();
  bench.showPerspective("org.edna.workbench.application.perspective.WorkflowPerspective",bench.getActiveWorkbenchWindow());
  final IProject workflows=ResourcesPlugin.getWorkspace().getRoot().getProject("workflows");
  final IFolder examples=(IFolder)workflows.getFolder("examples");
  final IResource[] momls=examples.members();
  for (int i=0; i < momls.length; i++) {
    final IEditorPart part=EclipseUtils.openEditor((IFile)momls[i]);
    if (part == null)     throw new Exception("Did not open part for " + momls[i]);
    EclipseUtils.getPage().setPartState(EclipseUtils.getPage().getActivePartReference(),IWorkbenchPage.STATE_MAXIMIZED);
    EclipseUtils.delay(1000);
    if (part instanceof PasserelleModelMultiPageEditor) {
      PasserelleModelMultiPageEditor me=(PasserelleModelMultiPageEditor)part;
      me.setActivePage(1);
    }
    EclipseUtils.delay(1000);
    EclipseUtils.getPage().closeAllEditors(false);
  }
}
 

Example 46

From project eclipse-integration-gradle, under directory /org.springsource.ide.eclipse.gradle.ui/src/org/springsource/ide/eclipse/gradle/ui/launch/.

Source file: GradleLaunchTasksTab.java

  21 
vote

private GradleProject getContext(){
  IWorkbench wb=PlatformUI.getWorkbench();
  IWorkbenchWindow win=wb.getActiveWorkbenchWindow();
  IWorkbenchPage page=win == null ? null : win.getActivePage();
  if (page != null) {
    ISelection selection=page.getSelection();
    if (selection instanceof IStructuredSelection) {
      IStructuredSelection ss=(IStructuredSelection)selection;
      if (!ss.isEmpty()) {
        Object obj=ss.getFirstElement();
        if (obj instanceof IResource) {
          IResource rsrc=(IResource)obj;
          IProject prj=rsrc.getProject();
          if (prj != null) {
            return GradleCore.create(prj);
          }
        }
      }
    }
    IEditorPart part=page.getActiveEditor();
    if (part != null) {
      IEditorInput input=part.getEditorInput();
      IResource rsrc=(IResource)input.getAdapter(IResource.class);
      if (rsrc != null) {
        IProject prj=rsrc.getProject();
        if (prj != null) {
          return GradleCore.create(prj);
        }
      }
    }
  }
  return null;
}
 

Example 47

From project edna-rcp, under directory /org.edna.kernel/src/org/edna/kernel/.

Source file: Launcher.java

  21 
vote

/** 
 * Gets the print stream for the Console if possible
 * @return a valid printStream
 */
private PrintStream getPrintStream(){
  PrintStream ps;
  try {
    MessageConsole myConsole=findConsole(CONSOLE_NAME);
    MessageConsoleStream out=myConsole.newMessageStream();
    ps=new PrintStream(out);
    IWorkbench workBench=Activator.getDefault().getWorkbench();
    if (workBench != null) {
      IWorkbenchWindow activeWindow=workBench.getActiveWorkbenchWindow();
      if (activeWindow != null) {
        IWorkbenchPage page=activeWindow.getActivePage();
        String id=IConsoleConstants.ID_CONSOLE_VIEW;
        IConsoleView view=(IConsoleView)page.showView(id);
        view.display(myConsole);
      }
    }
  }
 catch (  Exception e) {
    ps=new PrintStream(System.out);
  }
  return ps;
}
 

Example 48

From project grails-ide, under directory /org.grails.ide.eclipse.groovy.debug.tests/jdt-debug-tests-src/org/eclipse/jdt/debug/tests/.

Source file: ProjectCreationDecorator.java

  21 
vote

/** 
 */
public void testPerspectiveSwtich(){
  DebugUIPlugin.getStandardDisplay().syncExec(new Runnable(){
    public void run(){
      IWorkbench workbench=PlatformUI.getWorkbench();
      IPerspectiveDescriptor descriptor=workbench.getPerspectiveRegistry().findPerspectiveWithId(IDebugUIConstants.ID_DEBUG_PERSPECTIVE);
      IWorkbenchPage activePage=workbench.getActiveWorkbenchWindow().getActivePage();
      activePage.setPerspective(descriptor);
      IViewReference ref=activePage.findViewReference(IDebugUIConstants.ID_VARIABLE_VIEW);
      activePage.hideView(ref);
      ref=activePage.findViewReference(IDebugUIConstants.ID_BREAKPOINT_VIEW);
      activePage.hideView(ref);
    }
  }
);
}
 

Example 49

From project interactive-self-assessment, under directory /editbox/src/pm/eclipse/editbox/actions/.

Source file: EditBoxStartup.java

  21 
vote

public void earlyStartup(){
  if (!EditBox.getDefault().isEnabled())   return;
  EditBox.getDefault().setEnabled(false);
  final IWorkbench workbench=PlatformUI.getWorkbench();
  workbench.getDisplay().asyncExec(new Runnable(){
    public void run(){
      ICommandService commandService=(ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
      Command command=commandService.getCommand(EnableEditBox.COMMAND_ID);
      IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
      if (window != null) {
        IHandlerService handlerService=(IHandlerService)window.getWorkbench().getService(IHandlerService.class);
        if (handlerService != null)         try {
          handlerService.executeCommand(new ParameterizedCommand(command,null),null);
          toggle(window);
        }
 catch (        Exception e) {
          EditBox.logError(this,"Failed to enable EditBox at startup",e);
        }
      }
    }
  }
);
}
 

Example 50

From project libra, under directory /plugins/org.eclipse.libra.warproducts.ui/src/org/eclipse/libra/warproducts/ui/exportwizard/.

Source file: ExportPage.java

  21 
vote

public void createControl(final Composite parent){
  Composite container=new Composite(parent,SWT.NONE);
  container.setLayout(new FormLayout());
  Group group=new Group(container,SWT.NONE);
  group.setText(Messages.ExportPage);
  GridLayout layout=new GridLayout();
  group.setLayout(layout);
  FormData fdGroup=new FormData();
  group.setLayoutData(fdGroup);
  fdGroup.left=new FormAttachment(0);
  fdGroup.top=new FormAttachment(0);
  fdGroup.right=new FormAttachment(100);
  createDestinationSection(group);
  initialize();
  pageChanged();
  setControl(group);
  Dialog.applyDialogFont(group);
  IWorkbench workbench=PlatformUI.getWorkbench();
  IWorkbenchHelpSystem helpSystem=workbench.getHelpSystem();
  String contextId=WARProductConstants.HELP_CONTEXT_EXPORT_PAGE;
  helpSystem.setHelp(group,contextId);
}
 

Example 51

From project m2e-core-tests, under directory /org.eclipse.m2e.editor.xml.tests/src/org/eclipse/m2e/editor/xml/.

Source file: HyperlinkTest.java

  21 
vote

public void testHasLink() throws BadLocationException {
  IRegion region=new Region(sourceViewer.getDocument().getLineOffset(12) + 17,10);
  IMavenProjectFacade facade=MavenPlugin.getMavenProjectRegistry().getProject(projects[1]);
  assertNotNull(facade);
  assertNotNull(facade.getMavenProject());
  sourceViewer.setMavenProject(facade.getMavenProject());
  IHyperlink[] links=new PomHyperlinkDetector().detectHyperlinks(sourceViewer,region,true);
  assertNotNull(links);
  assertEquals(1,links.length);
  assertNotNull(links[0].getHyperlinkText());
  assertTrue(links[0].getHyperlinkText().contains("aProperty"));
  links[0].open();
  IWorkbench wbch=UIPlugin.getDefault().getWorkbench();
  IEditorPart editor=wbch.getWorkbenchWindows()[0].getActivePage().getActiveEditor();
  assertTrue(editor instanceof MavenPomEditor);
  assertEquals(parentPom,((MavenPomEditor)editor).getPomFile());
  ((MavenPomEditor)editor).close(false);
}
 

Example 52

From project mousefeed, under directory /com.mousefeed/src/com/mousefeed/eclipse/.

Source file: NagPopUp.java

  21 
vote

/** 
 * Handle link activation.
 */
@SuppressWarnings({"rawtypes","unchecked"}) final void doLinkActivated(){
  Object data=null;
  final IWorkbench workbench=Activator.getDefault().getWorkbench();
  final ICommandService commandService=(ICommandService)workbench.getService(ICommandService.class);
  final Command command=commandService.getCommand(actionId);
  if (command != null) {
    final HashSet allParameterizedCommands=new HashSet();
    try {
      allParameterizedCommands.addAll(ParameterizedCommand.generateCombinations(command));
    }
 catch (    final NotDefinedException e) {
    }
    if (!allParameterizedCommands.isEmpty()) {
      data=allParameterizedCommands.iterator().next();
      openWorkspacePreferences(data);
    }
  }
}
 

Example 53

From project mylyn.context, under directory /org.eclipse.mylyn.cdt.ui/src/org/eclipse/mylyn/internal/cdt/ui/.

Source file: InterestUpdateDeltaListener.java

  21 
vote

private void resetHandle(final IInteractionElement element,final String newHandle){
  if (!asyncExecMode) {
    ContextCore.getContextManager().updateHandle(element,newHandle);
  }
 else {
    IWorkbench workbench=PlatformUI.getWorkbench();
    if (workbench != null) {
      workbench.getDisplay().asyncExec(new Runnable(){
        public void run(){
          ContextCore.getContextManager().updateHandle(element,newHandle);
        }
      }
);
    }
  }
}
 

Example 54

From project mylyn.incubator, under directory /org.eclipse.mylyn.examples.monitor.study/src/org/eclipse/mylyn/examples/monitor/study/.

Source file: MylynUserStudyExamplePlugin.java

  21 
vote

public void earlyStartup(){
  final IWorkbench workbench=PlatformUI.getWorkbench();
  workbench.getDisplay().asyncExec(new Runnable(){
    public void run(){
      MylynUserStudyExamplePlugin.getDefault().selectionMonitor=new SelectionMonitor();
      MonitorUiPlugin.getDefault().getSelectionMonitors().add(MylynUserStudyExamplePlugin.getDefault().selectionMonitor);
      UiUsageMonitorPlugin.getDefault().addMonitoredPreferences(WorkbenchPlugin.getDefault().getPreferenceStore());
      UiUsageMonitorPlugin.getDefault().addMonitoredPreferences(JavaPlugin.getDefault().getPreferenceStore());
      UiUsageMonitorPlugin.getDefault().addMonitoredPreferences(WorkbenchPlugin.getDefault().getPreferenceStore());
      UiUsageMonitorPlugin.getDefault().addMonitoredPreferences(EditorsPlugin.getDefault().getPreferenceStore());
      UiUsageMonitorPlugin.getDefault().addMonitoredPreferences(PDEPlugin.getDefault().getPreferenceStore());
    }
  }
);
}
 

Example 55

From project neoclipse, under directory /org.neo4j.neoclipse/src/main/java/org/neo4j/neoclipse/.

Source file: Activator.java

  21 
vote

public void setStatusLineMessage(final String message){
  UiHelper.asyncExec(new Runnable(){
    @Override public void run(){
      IWorkbench wb=PlatformUI.getWorkbench();
      IWorkbenchWindow win=wb.getActiveWorkbenchWindow();
      IWorkbenchPage page=win.getActivePage();
      IWorkbenchPart part=page.getActivePart();
      IWorkbenchPartSite site=part.getSite();
      IViewSite vSite=(IViewSite)site;
      IActionBars actionBars=vSite.getActionBars();
      if (actionBars == null) {
        return;
      }
      IStatusLineManager statusLineManager=actionBars.getStatusLineManager();
      if (statusLineManager == null) {
        return;
      }
      statusLineManager.setMessage(message);
    }
  }
);
}
 

Example 56

From project org.openscada.dakara, under directory /org.openscada.ui.singleViewer.app/src/org/openscada/ui/singleviewer/app/.

Source file: Application.java

  21 
vote

@Override public void stop(){
  if (!PlatformUI.isWorkbenchRunning()) {
    return;
  }
  final IWorkbench workbench=PlatformUI.getWorkbench();
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    @Override public void run(){
      if (!display.isDisposed()) {
        workbench.close();
      }
    }
  }
);
}
 

Example 57

From project org.openscada.othala, under directory /org.openscada.othala.application/src/org/openscada/othala/application/.

Source file: Application.java

  21 
vote

public void stop(){
  final IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench == null) {
    return;
  }
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed()) {
        workbench.close();
      }
    }
  }
);
}
 

Example 58

From project rj-servi, under directory /de.walware.rj.servi.rcpdemo/src/de/walware/rj/servi/internal/rcpdemo/.

Source file: Application.java

  21 
vote

public void stop(){
  final IWorkbench workbench=PlatformUI.getWorkbench();
  if (workbench == null) {
    return;
  }
  final Display display=workbench.getDisplay();
  display.syncExec(new Runnable(){
    public void run(){
      if (!display.isDisposed()) {
        workbench.close();
      }
    }
  }
);
}
 

Example 59

From project sveditor, under directory /sveditor/plugins/net.sf.sveditor.ui/src/net/sf/sveditor/ui/editor/actions/.

Source file: OpenDiagForSelectionAction.java

  21 
vote

public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask("Open diag for selection",2);
  monitor.worked(1);
  ISVDBItemBase itemBase=SelectionConverter.getElementAtOffset(fEditor);
  if (itemBase != null && (itemBase.getType() == SVDBItemType.ClassDecl || itemBase.getType() == SVDBItemType.PackageDecl || itemBase.getType() == SVDBItemType.ModuleDecl)) {
    try {
      IWorkbench workbench=PlatformUI.getWorkbench();
      IWorkbenchPage page=workbench.getActiveWorkbenchWindow().getActivePage();
      IViewPart view;
      if ((view=page.findView(SVUiPlugin.PLUGIN_ID + ".diagramView")) == null) {
        view=page.showView(SVUiPlugin.PLUGIN_ID + ".diagramView");
      }
      IDiagModelFactory factory=null;
      if (itemBase.getType() == SVDBItemType.ClassDecl) {
        factory=new ClassDiagModelFactory(fEditor.getSVDBIndex(),(SVDBClassDecl)itemBase);
      }
 else       if (itemBase.getType() == SVDBItemType.PackageDecl) {
        factory=new PackageClassDiagModelFactory(fEditor.getSVDBIndex(),(SVDBPackageDecl)itemBase);
      }
 else       if (itemBase.getType() == SVDBItemType.ModuleDecl) {
        factory=new ModuleDiagModelFactory(fEditor.getSVDBIndex(),(SVDBModuleDecl)itemBase);
      }
      if (factory != null) {
        DiagModel model=factory.build();
        page.activate(view);
        ((SVDiagramView)view).setViewState(IWorkbenchPage.STATE_MAXIMIZED);
        ((SVDiagramView)view).setTarget(model,factory,fEditor.getSVDBIndex());
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  monitor.done();
}
 

Example 60

From project acceleo-modules, under directory /psm-gen-scala/plugins/com.github.sbegaudeau.acceleo.modules.psm.gen.scala.editor/src-gen/com/github/sbegaudeau/acceleo/modules/psm/gen/scala/model/scala/presentation/.

Source file: ScalaModelWizard.java

  19 
vote

/** 
 * This just records the information. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void init(IWorkbench workbench,IStructuredSelection selection){
  this.workbench=workbench;
  this.selection=selection;
  setWindowTitle(ScalaEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
  setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(ScalaEditorPlugin.INSTANCE.getImage("full/wizban/NewScala")));
}
 

Example 61

From project acceleo-webapp-generator, under directory /plugins/org.eclipse.acceleo.tutorial.webapp.editor/src-gen/org/eclipse/acceleo/tutorial/webapp/presentation/.

Source file: WebappModelWizard.java

  19 
vote

/** 
 * This just records the information. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void init(IWorkbench workbench,IStructuredSelection selection){
  this.workbench=workbench;
  this.selection=selection;
  setWindowTitle(WebappEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
  setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(WebappEditorPlugin.INSTANCE.getImage("full/wizban/NewWebapp")));
}
 

Example 62

From project bndtools, under directory /bndtools.core/src/bndtools/preferences/ui/.

Source file: BndPreferencePage.java

  19 
vote

public void init(IWorkbench workbench){
  BndPreferences prefs=new BndPreferences();
  enableSubs=prefs.getEnableSubBundles();
  noAskPackageInfo=prefs.getNoAskPackageInfo();
  noCheckCnf=prefs.getHideInitCnfWizard();
  warnExistingLaunch=prefs.getWarnExistingLaunches();
  buildLogging=prefs.getBuildLogging();
  editorOpenSourceTab=prefs.getEditorOpenSourceTab();
}
 

Example 63

From project bundlemaker, under directory /main/org.bundlemaker.core.ui/src/org/bundlemaker/core/ui/wizards/.

Source file: NewBundleMakerProjectWizard.java

  19 
vote

@Override public void init(IWorkbench workbench,IStructuredSelection selection){
  _workbench=workbench;
  setNeedsProgressMonitor(true);
  setWindowTitle("New Bundlemaker Project");
  setDefaultPageImageDescriptor(BundleMakerImages.BUNDLEMAKER_ICON.getImageDescriptor());
}
 

Example 64

From project Database-Designer, under directory /plugins/org.obeonetwork.dsl.database.editor/src/org/obeonetwork/dsl/database/presentation/.

Source file: DatabaseModelWizard.java

  19 
vote

/** 
 * This just records the information. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void init(IWorkbench workbench,IStructuredSelection selection){
  this.workbench=workbench;
  this.selection=selection;
  setWindowTitle(DatabaseEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
  setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(DatabaseEditorPlugin.INSTANCE.getImage("full/wizban/NewDatabase")));
}
 

Example 65

From project Diver, under directory /ca.uvic.chisel.javasketch/src/ca/uvic/chisel/javasketch/ui/internal/wizards/.

Source file: ExportTraceWizard.java

  19 
vote

@Override public void init(IWorkbench workbench,IStructuredSelection selection){
  IDialogSettings pluginSettings=SketchPlugin.getDefault().getDialogSettings();
  IDialogSettings exportSettings=pluginSettings.getSection("diver.trace.export");
  if (exportSettings == null) {
    exportSettings=pluginSettings.addNewSection("diver.trace.export");
  }
  setDialogSettings(exportSettings);
  setSelection(selection);
  addPage(exportPage);
}
 

Example 66

From project dolphin, under directory /org.adarsh.jutils/src/org/adarsh/jutils/preferences/.

Source file: CopyConstructorPreferencesPage.java

  19 
vote

/** 
 * {@inheritDoc}
 */
public void init(IWorkbench workbench){
  this.prefStore.setDefault(PreferenceConstants.COPYCON_SORT,false);
  this.prefStore.setDefault(PreferenceConstants.COPYCON_AUTOSAVE,false);
  this.prefStore.setDefault(PreferenceConstants.COPYCON_OVERWRITE,true);
  String javaDoc=this.prefStore.getString(PreferenceConstants.COPYCON_JAVADOC_STORE_KEY);
  String body=this.prefStore.getString(PreferenceConstants.COPYCON_BODY_STORE_KEY);
  if (Util.isNullString(javaDoc)) {
    javaDoc=Util.getDefaultCopyConJavaDoc();
  }
  if (Util.isNullString(body)) {
    body=Util.getDefaultCopyConImplementation();
  }
  this.javaDocDocument=new Document(javaDoc);
  this.bodyDocument=new Document(body);
  super.setPreferenceStore(this.prefStore);
  super.setDescription(PreferenceConstants.COPYCON_PAGE_DESCRIPTION);
}
 

Example 67

From project EMF-IncQuery, under directory /tests/org.eclipse.viatra2.emf.incquery.snapshot.editor/src/org/eclipse/viatra2/emf/incquery/snapshot/EIQSnapshot/presentation/.

Source file: EIQSnapshotModelWizard.java

  19 
vote

/** 
 * This just records the information. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void init(IWorkbench workbench,IStructuredSelection selection){
  this.workbench=workbench;
  this.selection=selection;
  setWindowTitle(EiqsnapshotEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
  setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(EiqsnapshotEditorPlugin.INSTANCE.getImage("full/wizban/NewEIQSnapshot")));
}
 

Example 68

From project fr.obeo.performance, under directory /fr.obeo.performance.editor/src-gen/fr/obeo/performance/presentation/.

Source file: PerformanceModelWizard.java

  19 
vote

/** 
 * This just records the information. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void init(IWorkbench workbench,IStructuredSelection selection){
  this.workbench=workbench;
  this.selection=selection;
  setWindowTitle(PerformanceEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
  setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(PerformanceEditorPlugin.INSTANCE.getImage("full/wizban/NewPerformance")));
}
 

Example 69

From project JGit, under directory /org.spearce.egit.ui/src/org/spearce/egit/ui/internal/clone/.

Source file: GitCloneWizard.java

  19 
vote

public void init(IWorkbench arg0,IStructuredSelection arg1){
  setWindowTitle(UIText.GitCloneWizard_title);
  setDefaultPageImageDescriptor(UIIcons.WIZBAN_IMPORT_REPO);
  setNeedsProgressMonitor(true);
  cloneSource=new RepositorySelectionPage(true);
  validSource=new SourceBranchPage(cloneSource);
  cloneDestination=new CloneDestinationPage(cloneSource,validSource);
  importProject=new GitProjectsImportPage(){
    @Override public void setVisible(    boolean visible){
      if (visible) {
        if (cloneDestination.alreadyClonedInto == null) {
          performClone(false);
          cloneDestination.alreadyClonedInto=cloneDestination.getDestinationFile().getAbsolutePath();
        }
        setProjectsList(cloneDestination.alreadyClonedInto);
      }
      super.setVisible(visible);
    }
  }
;
}
 

Example 70

From project mwe, under directory /plugins/org.eclipse.emf.mwe.ewm.editor/src/org/eclipse/emf/mwe/ewm/presentation/.

Source file: WorkflowModelWizard.java

  19 
vote

/** 
 * This just records the information. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void init(IWorkbench workbench,IStructuredSelection selection){
  this.workbench=workbench;
  this.selection=selection;
  setWindowTitle(WorkflowEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
  setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(WorkflowEditorPlugin.INSTANCE.getImage("full/wizban/NewWorkflow")));
}
 

Example 71

From project mylyn.docs, under directory /org.eclipse.mylyn.wikitext.tasks.ui/src/org/eclipse/mylyn/internal/wikitext/tasks/ui/.

Source file: ActiveFoldingEditorTracker.java

  19 
vote

@Override public void install(IWorkbench workbench){
  super.install(workbench);
  for (  IWorkbenchWindow window : workbench.getWorkbenchWindows()) {
    for (    IWorkbenchPage page : window.getPages()) {
      for (      IEditorReference reference : page.getEditorReferences()) {
        IEditorPart editorPart=reference.getEditor(false);
        if (editorPart != null) {
          editorOpened(editorPart);
        }
      }
    }
  }
}
 

Example 72

From project org.openscada.orilla, under directory /org.openscada.ae.ui.testing/src/org/openscada/ae/ui/testing/wizard/.

Source file: CreateQueryWizard.java

  19 
vote

public void init(final IWorkbench workbench,final IStructuredSelection selection){
  final Object o=selection.getFirstElement();
  if (o instanceof QueryListWrapper) {
    this.wrapper=(QueryListWrapper)o;
  }
}
 

Example 73

From project phresco-eclipse, under directory /com.photon.phresco.ui/src/com/photon/phresco/ui/preferences/.

Source file: PhrescoPreferencePage.java

  19 
vote

public void init(IWorkbench workbench){
  ISecurePreferences pref=SecurePreferencesFactory.getDefault();
  ISecurePreferences phresco=pref.node(PreferenceConstants.CREDENTIAL_STORE_NAME);
  try {
    username=phresco.get(PreferenceConstants.USER_NAME,"");
    password=phresco.get(PreferenceConstants.PASSWORD,"");
  }
 catch (  StorageException e) {
    username=password="";
  }
}
 

Example 74

From project rj-client, under directory /de.walware.rj.eclient.graphics/src/de/walware/rj/eclient/graphics/.

Source file: RGraphicsPreferencePage.java

  19 
vote

public void init(final IWorkbench workbench){
  fSerifPref=new FontPref(RGraphics.PREF_FONTS_SERIF_FONTNAME_KEY);
  fSansPref=new FontPref(RGraphics.PREF_FONTS_SANS_FONTNAME_KEY);
  fMonoPref=new FontPref(RGraphics.PREF_FONTS_MONO_FONTNAME_KEY);
  fSymbolFontPref=new FontPref(RGraphics.PREF_FONTS_SYMBOL_FONTNAME_KEY);
  fFontPrefs=new FontPref[]{fSerifPref,fSansPref,fMonoPref,fSymbolFontPref};
  final IEclipsePreferences node=new DefaultScope().getNode(RGraphics.PREF_FONTS_QUALIFIER);
  for (  final FontPref pref : fFontPrefs) {
    pref.defaultName=(node != null) ? node.get(pref.prefKey,"") : "";
  }
}
 

Example 75

From project sketch, under directory /org.eclipse.sketch.examples.shapes.diagram/src/org/eclipse/sketch/examples/shapes/diagram/application/.

Source file: DiagramEditorActionBarAdvisor.java

  19 
vote

/** 
 * @generated
 */
private static boolean openEditor(IWorkbench workbench,URI fileURI){
  IWorkbenchWindow workbenchWindow=workbench.getActiveWorkbenchWindow();
  IWorkbenchPage page=workbenchWindow.getActivePage();
  IEditorDescriptor editorDescriptor=workbench.getEditorRegistry().getDefaultEditor(fileURI.toFileString());
  if (editorDescriptor == null) {
    MessageDialog.openError(workbenchWindow.getShell(),Messages.DiagramEditorActionBarAdvisor_DefaultFileEditorTitle,NLS.bind(Messages.DiagramEditorActionBarAdvisor_DefaultFileEditorMessage,fileURI.toFileString()));
    return false;
  }
 else {
    try {
      page.openEditor(new URIEditorInput(fileURI),editorDescriptor.getId());
    }
 catch (    PartInitException exception) {
      MessageDialog.openError(workbenchWindow.getShell(),Messages.DiagramEditorActionBarAdvisor_DefaultEditorOpenErrorTitle,exception.getMessage());
      return false;
    }
  }
  return true;
}
 

Example 76

From project titanium_studio_sdk, under directory /desktop/plugins/com.appcelerator.titanium.desktop/src/com/appcelerator/titanium/desktop/ui/wizard/.

Source file: DistributeDesktopWizard.java

  19 
vote

public void init(IWorkbench workbench,IStructuredSelection selection){
  Object element=selection.getFirstElement();
  if (element instanceof IAdaptable) {
    IResource resource=(IResource)((IAdaptable)element).getAdapter(IResource.class);
    if (resource != null) {
      this.project=resource.getProject();
    }
  }
}