Examples of IEditorInput


Examples of org.eclipse.ui.IEditorInput

  }
 
  @SuppressWarnings("deprecation")
  private IFile[] getFiles(IWorkbenchPart part) {
    if (!(part instanceof IEditorPart)) return new IFile[] {};
    IEditorInput input = ((IEditorPart) part).getEditorInput();
    if (!(input instanceof IPathEditorInput)) return new IFile[] {};
    IPathEditorInput pathInput = (IPathEditorInput) input;
//    System.out.println(pathInput.getPath());
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    return workspace.getRoot().findFilesForLocation(pathInput.getPath());
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

   * queries the editor's input using <code>getAdapter(IResource.class)</code>.
   *
   * @return the resource to which to attach the newly created marker
   */
  protected IResource getResource() {
    IEditorInput input= textEditor.getEditorInput();
    return (IResource) ((IAdaptable) input).getAdapter(IResource.class);
  }
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

    {
        final Shell shell = HandlerUtil.getActiveShell(event);
        final IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
        if (editorPart != null)
        {
            IEditorInput editorInput = editorPart.getEditorInput();

            if (!(editorInput instanceof IFileEditorInput))
            {
                throw new ExecutionException("Editor input must be a file");
            }
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

        boolean result = false;

        if (part instanceof IEditorPart)
        {
            IEditorInput input = ((IEditorPart) part).getEditorInput();
            if (input instanceof IFileEditorInput)
            {
                IFile file = ((IFileEditorInput) input).getFile();

                if ("isEditorOfType".equals(property))
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

          return;
        }
        IServer server = servers[0];
        final String url = node.getURLForBrowser(server)+".html";
    try {
      IEditorInput input = new WebBrowserEditorInput(url);
      page.openEditor(input, "org.apache.sling.ide.eclipse.ui.editors.WebBrowser", true);
    } catch (PartInitException e1) {
      //TODO proper logging
      e1.printStackTrace();
      MessageDialog.openWarning(shell, "Cannot open browser", "Opening caused an exception: "+e1.getMessage());
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

    for (int i = 0; i < editorReferences.length; i++) {
      final IEditorReference reference = editorReferences[i];
      if (reference==null) {
        continue;
      }
      final IEditorInput editorInput;
      try {
        editorInput = reference.getEditorInput();
      } catch (PartInitException e) {
        //TODO proper logging
        e.printStackTrace();
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

    String viewName = null;
    String title = editor.getTitle();
    String controllerName = title.replace(".java", "");

    String packageName = "";
    IEditorInput editorInput = editor.textEditor.getEditorInput();
   
    ITextSelection selection = (ITextSelection) editor.textEditor.getSelectionProvider().getSelection();
    IJavaElement elem = JavaUI.getEditorInputJavaElement(editorInput);
    ICompilationUnit unit = null;
    if (elem instanceof ICompilationUnit) {
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

    String viewName = null;
    String title = editor.getTitle();
    String controllerName = title.replace(".java", "");

    String packageName = "";
    IEditorInput editorInput = editor.textEditor.getEditorInput();
   
    ITextSelection selection = (ITextSelection) editor.textEditor.getSelectionProvider().getSelection();
    IJavaElement elem = JavaUI.getEditorInputJavaElement(editorInput);
    ICompilationUnit unit = null;
    if (elem instanceof ICompilationUnit) {
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

    private void checkRef(IWorkbenchPartReference partRef)
    {
        IEditorPart editor = partRef.getPage().getActiveEditor();
        if (editor != null)
        {
            IEditorInput input = editor.getEditorInput();
            if (input instanceof IFileEditorInput)
            {
                IFileEditorInput f = (IFileEditorInput) input;
                IProject project = f.getFile().getProject();
                if ( SigilCore.isSigilProject(project)) {
View Full Code Here

Examples of org.eclipse.ui.IEditorInput

  public Object execute(ExecutionEvent event) throws ExecutionException {
    IWorkbenchWindow window = getWindow(event);
    try {
      ITextEditor editor = getEditor();
      IEditorInput editorInput = editor.getEditorInput();
            IDocument document = editor.getDocumentProvider().getDocument(editorInput);
           
            IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
            IFile file = fileEditorInput.getFile();
           
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.