Examples of OpenAction


Examples of org.eclipse.jdt.ui.actions.OpenAction

        /*
         * Add action to support "F3" jump to definition
         */
        {
            Action action = new OpenAction(getEditorSite()) {
                public void run(org.eclipse.jface.text.ITextSelection selection) {
                    try {
                        IDocument doc = getSourceViewer().getDocument();

                        int line = doc.getLineOfOffset(selection.getOffset());
                        List<IAnnotation> matches = scenarioAnnotationSearch.search(getSourceViewer(), line);

                        if (matches.size() > 0) {

                            IRegion lineRegion = doc.getLineInformation(line);

                            String currentLine = getSourceViewer().getDocument().get(lineRegion.getOffset(),
                                lineRegion.getLength());

                            String trimmedLine = currentLine.trim();
                            int firstSpaceIndex = trimmedLine.indexOf(" ");

                            String stepText = "";
                            if (firstSpaceIndex != -1) {
                                stepText = trimmedLine.substring(firstSpaceIndex).trim();
                            } else {
                                return;
                            }

                            for (IAnnotation annotation : matches) {
                                IMemberValuePair[] pair = annotation.getMemberValuePairs();
                                Pattern stepPattern = Pattern.compile((String) pair[0].getValue());

                                if (stepPattern.matcher(stepText).matches()) {
                                    super.run(new Object[] {annotation});
                                    break;
                                }
                            }
                        }
                    } catch (BadLocationException e) {
                        Activator.getLogservice().log(LogService.LOG_ERROR, e.getMessage());
                    } catch (JavaModelException e) {
                        Activator.getLogservice().log(LogService.LOG_ERROR, e.getMessage());
                    }
                };
            };
            action.setActionDefinitionId("org.eclipse.jdt.ui.edit.text.java.open.editor");
            setAction("OpenJavaElement", action);
            markAsStateDependentAction("OpenJavaElement", true);
        }
    }
View Full Code Here

Examples of org.eclipse.wst.jsdt.ui.actions.OpenAction

      Object firstElement = treeSelection.getFirstElement();
      if (firstElement instanceof IJavaScriptElement) {
        // it's JS element, follow opening JS editor
        ScriptExplorerPart part = getPart();
        IViewSite viewSite = part.getViewSite();
        OpenAction openAction = new OpenAction(viewSite);
        if (openAction != null && openAction.isEnabled()) {
          openAction.run();
          return;
        }
      }
    }
    // use our action to do the open operation
    IAction openAction = fNavigateActionGroup.getOpenAction();
    if (openAction != null && openAction.isEnabled()) {
      openAction.run();
      return;
    }

  }
View Full Code Here

Examples of org.erlide.ui.actions.OpenAction

            return null;
        }

        @Override
        public void open() {
            final OpenAction action = (OpenAction) editor
                    .getAction(IErlangEditorActionDefinitionIds.OPEN);
            if (action != null) {
                action.run();
            }
        }
View Full Code Here

Examples of org.erlide.ui.actions.OpenAction

    }

    protected abstract void addFoldingSupport(final ISourceViewer viewer);

    protected void createCommonActions() {
        openAction = new OpenAction(this);
        openAction.setActionDefinitionId(IErlangEditorActionDefinitionIds.OPEN_EDITOR);
        setAction(IErlangEditorActionDefinitionIds.OPEN, openAction);

        final ResourceBundle keyBundle = ErlangEditorMessages
                .getBundleForConstructedKeys();
View Full Code Here

Examples of org.joshy.sketch.actions.OpenAction

        this.setBoxAlign(Align.Stretch);
        this.add(grid,1);

        this.add(new Button("Open Existing Document").onClicked(new Callback<ActionEvent>() {
            public void call(ActionEvent actionEvent) throws Exception {
                new OpenAction(main).execute();
                if (!main.getContexts().isEmpty()) {
                    stage.hide();
                }
            }
        }));
View Full Code Here

Examples of org.joshy.sketch.actions.OpenAction

    @Test public void versionN1to0Test() throws Exception {
        u.p("running a version upgrade test");
        VectorModeHelper helper = new VectorModeHelper(null);
        VectorDocContext context = helper.createDocContext(null);
        SketchCanvas canvas = new SketchCanvas(context);
        OpenAction action = new OpenAction(null);
        u.p("Url = " + this.getClass().getResource("oldVersion_-1.xml"));
        action.load(this.getClass().getResourceAsStream("oldVersion_-1.xml"),null,"oldVersion_-1.xml",null);
        SketchDocument doc = canvas.getDocument();
        u.p("canvas doc = " + doc);
        for(SNode shape : doc.getCurrentPage().getNodes()) {
            u.p("shape = " + shape);
        }
View Full Code Here

Examples of org.rssowl.ui.internal.actions.OpenAction

        /* Open */
        manager.add(new Separator(OwlUI.M_OPEN));
        if (!selection.isEmpty()) {
          if (!eclipsePreferences.getBoolean(DefaultPreferences.ECLIPSE_SINGLE_CLICK_OPEN))
            manager.add(new OpenAction(fViewSite.getPage(), fViewer));

          /* Tab related Actions */
          if (globalPreferences.getBoolean(DefaultPreferences.ALWAYS_REUSE_FEEDVIEW) && OwlUI.isTabbedBrowsingEnabled()) {

            /* Open in new Tab */
 
View Full Code Here

Examples of org.tmatesoft.sqljet.browser.core.actions.OpenAction

    private static JMenuBar createMainMenu(BrowserComponentManager manager) {
        JMenuBar mainMenu = new JMenuBar();
       
        JMenu fileMenu = new JMenu("File");
        fileMenu.setMnemonic('F');
        JMenuItem openItem = fileMenu.add(new OpenAction(manager));
        openItem.setAccelerator(KeyStroke.getKeyStroke("control O"));
        openItem.setMnemonic('O');
        JMenu recentMenu = new JMenu("Open Recent");
        recentMenu.addMenuListener(new RecentMenu(manager, recentMenu));
        JMenuItem recentItem = fileMenu.add(recentMenu);       
View Full Code Here

Examples of slash.navigation.converter.gui.actions.OpenAction

        actionManager.register("copy", new CopyAction(getPositionsView(), getPositionsModel(), clipboardInteractor));
        actionManager.register("cut", new CutAction(getPositionsView(), getPositionsModel(), clipboardInteractor));
        actionManager.register("delete", new DeleteAction(getPositionsView(), getPositionsModel()));
        actionManager.register("new-position", new AddPositionAction(getPositionsView(), getPositionsModel(), getPositionsSelectionModel()));
        actionManager.register("new-file", new NewFileAction(this));
        actionManager.register("open", new OpenAction(this));
        actionManager.register("paste", new PasteAction(getPositionsView(), getPositionsModel(), clipboardInteractor));
        actionManager.register("save", new SaveAction(this));
        actionManager.register("save-as", new SaveAsAction(this));
        actionManager.register("select-all", new SelectAllAction(getPositionsView()));
        actionManager.register("new-positionlist", new AddPositionListAction(getFormatAndRoutesModel()));
View Full Code Here

Examples of tv.porst.swfretools.dissector.gui.main.actions.OpenAction

    final JMenuBar menuBar = new JMenuBar();

    final JMenu menu = new JMenu("File");

    menu.add(new OpenAction(tree, fileModel));

    menuBar.add(menu);

    setJMenuBar(menuBar);
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.