Ejemplo n.º 1
0
 /**
  * Creates a new <code>OpenEditorActionGroup</code>. The group requires that the selection
  * provided by the given selection provider is of type {@link IStructuredSelection}.
  *
  * @param site the site that will own the action group.
  * @param specialSelectionProvider the selection provider used instead of the site's selection
  *     provider.
  */
 public OpenEditorActionGroup(
     IWorkbenchPartSite site, ISelectionProvider specialSelectionProvider) {
   fSite = site;
   fOpen = new OpenAction(fSite);
   fOpen.setActionDefinitionId(DartEditorActionDefinitionIds.OPEN_EDITOR);
   fSelectionProvider =
       specialSelectionProvider == null ? fSite.getSelectionProvider() : specialSelectionProvider;
   initialize();
   if (specialSelectionProvider != null) {
     fOpen.setSpecialSelectionProvider(specialSelectionProvider);
   }
 }
Ejemplo n.º 2
0
 private void initialize(ISelectionProvider provider) {
   ISelection selection = provider.getSelection();
   fOpen.update(selection);
   if (!fIsEditorOwner) {
     provider.addSelectionChangedListener(fOpen);
   }
 }
Ejemplo n.º 3
0
 /**
  * Note: This constructor is for internal use only. Clients should not call this constructor.
  *
  * @param editor the Script editor
  */
 public OpenEditorActionGroup(ScriptEditor editor) {
   fIsEditorOwner = true;
   fOpen = new OpenAction(editor);
   fOpen.setActionDefinitionId(IScriptEditorActionDefinitionIds.OPEN_EDITOR);
   editor.setAction("OpenEditor", fOpen); // $NON-NLS-1$
   fSite = editor.getEditorSite();
   initialize(fSite.getSelectionProvider());
 }
Ejemplo n.º 4
0
 /**
  * Creates a new <code>OpenActionGroup</code>. The group requires that the selection provided by
  * the part's selection provider is of type <code>
  * org.eclipse.jface.viewers.IStructuredSelection</code>.
  *
  * @param part the view part that owns this action group
  */
 public OpenEditorActionGroup(IViewPart part) {
   fSite = part.getSite();
   fOpen = new OpenAction(fSite);
   fOpen.setActionDefinitionId(IScriptEditorActionDefinitionIds.OPEN_EDITOR);
   initialize(fSite.getSelectionProvider());
 }
Ejemplo n.º 5
0
 public static void open(final File file) {
   OpenAction.open(new FileProcessLocation(file), true);
 }
Ejemplo n.º 6
0
 public void actionPerformed(ActionEvent e) {
   OpenAction.open();
 }