Package org.eclipse.ui.part

Examples of org.eclipse.ui.part.FileEditorInput


            public boolean isShownInEditor(Match match, IEditorPart editor) {
                boolean isShown = false;
                IEditorInput ei = editor.getEditorInput();
                if (ei instanceof IFileEditorInput) {
                    FileEditorInput fi = (FileEditorInput) ei;
                    isShown = match.getElement().equals(fi.getFile());
                }

                return isShown;
            }

            public Match[] computeContainedMatches(
                    AbstractTextSearchResult result, IEditorPart editor) {
                Match matches [];
                IEditorInput ei = editor.getEditorInput();
                if (ei instanceof IFileEditorInput) {
                    FileEditorInput fi = (FileEditorInput) ei;
                    matches = getMatches(fi.getFile());
                } else {
                    matches = new Match[0];
                }

                return matches;
View Full Code Here


                    editorRegistry.getDefaultEditor(newPolicy.getName()).getId();
            IWorkbenchPage activePage =
                    PlatformUI.getWorkbench().
                    getActiveWorkbenchWindow().
                    getActivePage();
            activePage.openEditor(new FileEditorInput(newPolicy),
                    editorId, true);
        } catch (PolicyFileAccessException pfae) {
            EclipseCommonPlugin.handleError(BuilderPlugin.getDefault(), pfae);
        } catch (PartInitException e) {
            EclipseCommonPlugin.handleError(BuilderPlugin.getDefault(), e);
View Full Code Here

                    if(editor instanceof MultiPageEditorPart) break;
                    workbenchPage.closeEditor(editor,false);
                }

                DeviceEditor deviceEditor = (DeviceEditor) workbenchPage.
                        openEditor(new FileEditorInput(matchedFile),
                                defaultEditorDescriptor.getId(), true);
                deviceEditor.selectDevice(match.getDeviceName());

            } catch (PartInitException e) {
                EclipseCommonPlugin.handleError(ABPlugin.getDefault(), e);
View Full Code Here

            boolean success = false;
            try {
                saveModel(file, progressMonitor);
                success = true;
                setInput(new FileEditorInput(file));
                setPartName(file.getName());
                context.setResource(file);
            } finally {
                if (progressMonitor != null) {
                    progressMonitor.setCanceled(!success);
View Full Code Here

        IFile file = conf.getJavaProject().getProject().getFile(conf.getIvyXmlPath());
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        if (file != null) {
            try {
                String editorId = "org.apache.ivyde.editors.IvyEditor";
                page.openEditor(new FileEditorInput(file), editorId, true);
                // only remember the default editor if the open succeeds
                IDE.setDefaultEditor(file, editorId);
            } catch (PartInitException e) {
                Shell parent = page.getWorkbenchWindow().getShell();
                String title = "Problems Opening Editor";
View Full Code Here

    }

    protected void setInput(IEditorInput input) {
        IvyFileEditorInput ivyFileEditorInput = null;
        if (input instanceof FileEditorInput) {
            FileEditorInput fei = (FileEditorInput) input;
            IFile file = ((FileEditorInput) input).getFile();
            ivyFileEditorInput = new IvyFileEditorInput(file);
        } else if (input instanceof IvyFileEditorInput) {
            ivyFileEditorInput = (IvyFileEditorInput) input;
        }
View Full Code Here

    }

    protected void setInput(IEditorInput input) {
        IvyFileEditorInput ivyFileEditorInput = null;
        if (input instanceof FileEditorInput) {
            FileEditorInput fei = (FileEditorInput) input;
            IFile file = ((FileEditorInput) input).getFile();
            ivyFileEditorInput = new IvyFileEditorInput(file);
        } else if (input instanceof IvyFileEditorInput) {
            ivyFileEditorInput = (IvyFileEditorInput) input;
        }
View Full Code Here

    if (StringUtils.isBlank(htmlSource)) {
      setHtmlWithEditor();
    } else {
      IEditorInput editorInput = editor.getEditorInput();
      if (editorInput instanceof FileEditorInput) {
        FileEditorInput fei = (FileEditorInput) editorInput;
        String name = fei.getFile().getName();
        String[] split = name.split("[.]");
        File dir = new File(htmlSource);
        File[] listFiles = dir.listFiles();
        File selected = null;
        for (File file : listFiles) {
View Full Code Here

  public Object execute(ExecutionEvent event) throws ExecutionException {

    // TODO create a new view for every resource file
    TestViewPage view = null;
    try {
      FileEditorInput input = (FileEditorInput) HandlerUtil.getActiveEditor(event).getEditorInput();
      IResource r = input.getFile();
      view = (TestViewPage) HandlerUtil.getActiveWorkbenchWindow(event).getWorkbench()
              .getActiveWorkbenchWindow().getActivePage()
              .showView("org.apache.uima.ruta.testing.annotationTest");
      view.setResource(r);
    } catch (PartInitException e) {
View Full Code Here

            // IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);

            IWorkbenchPage page = Workbench.getInstance().getActiveWorkbenchWindow()
                    .getActivePage();
            try {
              page.openEditor(new FileEditorInput(file), "org.apache.uima.caseditor.editor");
            } catch (PartInitException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }
          }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.part.FileEditorInput

Copyright © 2018 www.massapicom. 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.