Examples of IWorkbenchAction


Examples of org.eclipse.ui.actions.ActionFactory.IWorkbenchAction

        break;
      }

        /* Close */
      case CLOSE: {
        IWorkbenchAction action = ActionFactory.CLOSE.create(fWindow);
        action.run();
        break;
      }

        /* Close Others */
      case CLOSE_OTHERS: {
        IWorkbenchPage page = fWindow.getActivePage();
        if (page != null) {
          IEditorReference[] refArray = page.getEditorReferences();
          if (refArray != null && refArray.length > 1) {
            IEditorReference[] otherEditors = new IEditorReference[refArray.length - 1];
            IEditorReference activeEditor = (IEditorReference) page.getReference(page.getActiveEditor());
            for (int i = 0; i < refArray.length; i++) {
              if (refArray[i] != activeEditor)
                continue;
              System.arraycopy(refArray, 0, otherEditors, 0, i);
              System.arraycopy(refArray, i + 1, otherEditors, i, refArray.length - 1 - i);
              break;
            }
            page.closeEditors(otherEditors, true);
          }
        }
        break;
      }

        /* Close All */
      case CLOSE_ALL: {
        IWorkbenchAction action = ActionFactory.CLOSE_ALL.create(fWindow);
        action.run();
        break;
      }

        /* Open */
      case OPEN: {
        IStructuredSelection selection = OwlUI.getActiveFeedViewSelection();
        FeedView feedView = OwlUI.getActiveFeedView();
        if (selection != null && !selection.isEmpty() && feedView != null) {
          OpenInBrowserAction action = new OpenInBrowserAction(selection, WebBrowserContext.createFrom(selection, feedView));
          action.run();
        }
        break;
      }

        /* Save As */
      case SAVE_AS: {
        FeedView activeFeedView = OwlUI.getActiveFeedView();
        if (activeFeedView != null)
          activeFeedView.doSaveAs();
        break;
      }

        /* Print */
      case PRINT: {
        FeedView activeFeedView = OwlUI.getActiveFeedView();
        if (activeFeedView != null)
          activeFeedView.print();
        break;
      }

        /* Fullscreen */
      case FULLSCREEN: {
        OwlUI.toggleFullScreen();
        wrappingAction.setChecked(fWindow.getShell().getFullScreen());
        break;
      }

        /* Toggle Bookmarks View */
      case BOOKMARK_VIEW: {
        OwlUI.toggleBookmarks();
        break;
      }

        /* Sticky */
      case STICKY: {
        IStructuredSelection selection = OwlUI.getActiveFeedViewSelection();
        if (selection != null && !selection.isEmpty())
          new MakeNewsStickyAction(selection).run();
        break;
      }

        /* Find more Feeds */
      case FIND_MORE_FEEDS: {
        SearchFeedsAction action = new SearchFeedsAction();
        action.init(fWindow);
        action.run(null);
        break;
      }

        /* Downloads & Activity */
      case ACTIVITIES: {
        ShowActivityAction action = new ShowActivityAction();
        action.init(fWindow);
        action.run(null);
        break;
      }

        /* Preferences */
      case PREFERENCES: {
        IWorkbenchAction action = ActionFactory.PREFERENCES.create(fWindow);
        action.run();
        break;
      }

        /* History */
      case HISTORY: {
View Full Code Here

Examples of org.eclipse.ui.actions.ActionFactory.IWorkbenchAction

        ActionFactory.SHOW_PART_PANE_MENU,
        ActionFactory.SHOW_VIEW_MENU
    };

    for (ActionFactory factory : actionsToCreate) {
      IWorkbenchAction action = factory.create(window);
      actions.put(factory, action);
      register(action);
    }

    openWorkspaceAction = new OpenWorkspaceAction(window);
View Full Code Here

Examples of org.eclipse.ui.actions.ActionFactory.IWorkbenchAction

     * Delete Action used to delete the currently selected feature.
     */
    private class DeleteAction extends Action{
        public DeleteAction(){
            setActionDefinitionId("org.eclipse.ui.edit.delete"); //$NON-NLS-1$
            IWorkbenchAction actionTemplate = ActionFactory.DELETE.create(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
            setText(actionTemplate.getText());
            setToolTipText(actionTemplate.getToolTipText());
            setImageDescriptor(actionTemplate.getImageDescriptor());
            setDescription(actionTemplate.getDescription());
            setDisabledImageDescriptor(actionTemplate.getDisabledImageDescriptor());
        }
View Full Code Here

Examples of org.eclipse.ui.actions.ActionFactory.IWorkbenchAction

  }
 
  protected void addTextAction(ActionFactory actionFactory, int textOperation)
  {
    IWorkbenchWindow window = getViewSite().getWorkbenchWindow();
    IWorkbenchAction globalAction = actionFactory.create(window);
   
    // Create our text action.
    TextViewerAction textAction = new TextViewerAction(textOperation);
   
    textActions.put(actionFactory.getId(), textAction);
   
    // Copy its properties from the global action.
    textAction.setText(globalAction.getText());
    textAction.setToolTipText(globalAction.getToolTipText());
    textAction.setDescription(globalAction.getDescription());
    textAction.setImageDescriptor(globalAction.getImageDescriptor());
    textAction.setDisabledImageDescriptor(globalAction.getDisabledImageDescriptor());
    textAction.setAccelerator(globalAction.getAccelerator());
   
    // Make sure it's up to date.
    textAction.update();
   
    // Register our text action with the global action handler.
View Full Code Here

Examples of org.eclipse.ui.actions.ActionFactory.IWorkbenchAction

                    delete.selectionChanged(this, s);
                    delete.run(this);
                }
            };
            deleteAction.setActionDefinitionId("org.eclipse.ui.edit.delete"); //$NON-NLS-1$
            IWorkbenchAction actionTemplate = ActionFactory.DELETE.create(PlatformUI.getWorkbench()
                    .getActiveWorkbenchWindow());
            deleteAction.setText(actionTemplate.getText());
            deleteAction.setToolTipText(actionTemplate.getToolTipText());
            deleteAction.setImageDescriptor(actionTemplate.getImageDescriptor());
            deleteAction.setDescription(actionTemplate.getDescription());
            deleteAction.setDisabledImageDescriptor(actionTemplate.getDisabledImageDescriptor());
        }
        return deleteAction;
    }
View Full Code Here

Examples of org.eclipse.ui.actions.ActionFactory.IWorkbenchAction

                } catch (IOException e) {
                    IssuesActivator.log("", e); //$NON-NLS-1$
                }
            }
        };
        IWorkbenchAction template = ActionFactory.SAVE.create(getSite().getWorkbenchWindow());

        action.setImageDescriptor(template.getImageDescriptor());
        action.setText(template.getText());
        action.setToolTipText(template.getToolTipText());
        action.setDisabledImageDescriptor(template.getDisabledImageDescriptor());
        action.setHoverImageDescriptor(template.getHoverImageDescriptor());

        action.setEnabled((issuesManager.getIssuesList() instanceof IRemoteIssuesList) && issuesManager.isDirty());
       
        return action;
    }
View Full Code Here

Examples of org.eclipse.ui.actions.ActionFactory.IWorkbenchAction

                    } catch (IOException e) {
                        IssuesActivator.log("", e); //$NON-NLS-1$
                    }
            }
        };
        IWorkbenchAction template = ActionFactory.REFRESH.create(getSite().getWorkbenchWindow());

        action.setText(template.getText());
        action.setToolTipText(template.getToolTipText());
        ImageDescriptor dtool = IssuesActivator.imageDescriptorFromPlugin(IssuesActivator.PLUGIN_ID, "icons/dtool16/refresh_co.gif"); //$NON-NLS-1$
        ImageDescriptor etool = IssuesActivator.imageDescriptorFromPlugin(IssuesActivator.PLUGIN_ID, "icons/etool16/refresh_co.gif"); //$NON-NLS-1$
        action.setImageDescriptor(etool);
        action.setDisabledImageDescriptor(dtool);
View Full Code Here

Examples of org.eclipse.ui.actions.ActionFactory.IWorkbenchAction

        fileMenu.add(new GroupMarker(IWorkbenchActionConstants.MRU));

        fileMenu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));

        IWorkbenchAction quit = ActionFactory.QUIT.create(window);
        IContributionItem item = new ActionContributionItem(quit);
        item.setVisible(!Platform.OS_MACOSX.equals(Platform.getOS()));
       
        fileMenu.add(item);
    }
View Full Code Here

Examples of org.eclipse.ui.actions.ActionFactory.IWorkbenchAction

                        delete.run(this);
                    }
                };
                deleteAction.setActionDefinitionId("org.eclipse.ui.edit.delete"); //$NON-NLS-1$
               
                IWorkbenchAction actionTemplate = ActionFactory.DELETE.create(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
                deleteAction.setText(actionTemplate.getText());
                deleteAction.setToolTipText(actionTemplate.getToolTipText());
                deleteAction.setImageDescriptor(actionTemplate.getImageDescriptor());
                deleteAction.setDescription(actionTemplate.getDescription());
                deleteAction.setDisabledImageDescriptor(actionTemplate.getDisabledImageDescriptor());
            }
           
            return deleteAction;
        }finally{
            deleteLock.unlock();
View Full Code Here

Examples of org.eclipse.ui.actions.ActionFactory.IWorkbenchAction

                    }
                }
            };
           
            deleteAction.setActionDefinitionId("org.eclipse.ui.edit.delete"); //$NON-NLS-1$
            IWorkbenchAction actionTemplate = ActionFactory.DELETE.create(PlatformUI.getWorkbench()
                    .getActiveWorkbenchWindow());
            deleteAction.setText(actionTemplate.getText());
            deleteAction.setToolTipText(actionTemplate.getToolTipText());
            deleteAction.setImageDescriptor(actionTemplate.getImageDescriptor());
            deleteAction.setDescription(actionTemplate.getDescription());
            deleteAction.setDisabledImageDescriptor(actionTemplate.getDisabledImageDescriptor());
           
        }
       
        return deleteAction;
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.