Package org.eclipse.ui

Examples of org.eclipse.ui.IEditorPart


          WorkbenchUtils.setNavigationViewSelection(new SingleStructuredSelection(syncInfo));
        } catch (Exception e) {         
        }
       
        // open plugin config
        IEditorPart editor = WorkbenchUtils.openEditor(WGADesignerPlugin.getDefault().getWorkbench(), syncInfo, ExternalResourceIDs.EDITOR_WGA_DESIGN);
        if (editor instanceof FormEditor) {
          ((FormEditor) editor).setActivePage(ExternalResourceIDs.EDITORPAGE_WGA_DESIGN_PLUGINCONFIGURATION);
        }

        return true;
View Full Code Here


    public void apply(IDocument document) {
      IWorkbench workbench = Plugin.getDefault().getWorkbench();
   
      NewWGAPortlet wizard = new NewWGAPortlet();
      wizard.setDefaultPortletName(_portletNameToCreate);
      IEditorPart editorPart = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
      if (editorPart != null && editorPart.getEditorInput() instanceof FileEditorInput) {
        FileEditorInput input = (FileEditorInput) editorPart.getEditorInput();
        wizard.init(workbench, new SingleStructuredSelection(input.getFile().getParent()));
        WizardDialog dialog = new WizardDialog(workbench.getActiveWorkbenchWindow().getShell(), wizard);
        dialog.open();
      }       
    }
View Full Code Here

    for (int i = 0; i < workbenchPages.length; i++) {
      IWorkbenchPage page = workbenchPages[i];
      IEditorReference[] references = page.getEditorReferences();
      for (int j = 0; j < references.length; j++) {
        IEditorReference reference = references[j];
        IEditorPart editorPart = reference.getEditor(false);
        if (editorPart != null && reference.getId().equals(id)) {
          editors.add(editorPart);
        }
      }
    }
View Full Code Here

   */
  public static List<IEditorPart> findOpenEditors(IWorkbench workbench, String id, IFile file) {
    Iterator<IEditorPart> editors = findOpenEditors(workbench, id).iterator();
    List<IEditorPart> filteredEditors = new ArrayList<IEditorPart>();
    while (editors.hasNext()) {
      IEditorPart editorPart = editors.next();
      if (editorPart.getEditorInput() instanceof FileEditorInput && editorPart.getEditorInput() != null) {
        if (((FileEditorInput) editorPart.getEditorInput()).getFile().equals(file)) {
          filteredEditors.add(editorPart);
        }
      }
    }
    return filteredEditors;
View Full Code Here

   */
  public static List<IEditorPart> findOpenEditors(IWorkbench workbench, String id, IContainer container) {
    Iterator<IEditorPart> editors = findOpenEditors(workbench, id).iterator();
    List<IEditorPart> filteredEditors = new ArrayList<IEditorPart>();
    while (editors.hasNext()) {
      IEditorPart editorPart = editors.next();
      if (editorPart.getEditorInput() instanceof FileEditorInput && editorPart.getEditorInput() != null) {
        IFile inputFile = ((FileEditorInput) editorPart.getEditorInput()).getFile();
        if (container.getLocation().isPrefixOf(inputFile.getLocation())) {
          filteredEditors.add(editorPart);
        }
      }
    }
View Full Code Here

    if (wizardDesc == null) {
      wizardDesc = workbench.getNewWizardRegistry().findWizard(id);
    }
    if (wizardDesc != null) {
      IWorkbenchWizard wizard = wizardDesc.createWizard();
      IEditorPart editorPart = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
      if (editorPart != null && editorPart.getEditorInput() instanceof FileEditorInput) {
        FileEditorInput input = (FileEditorInput) editorPart.getEditorInput();
        wizard.init(workbench, new SingleStructuredSelection(input.getFile().getParent()));
        WizardDialog dialog = new WizardDialog(workbench.getActiveWorkbenchWindow().getShell(), wizard);
        dialog.open();
        return wizard;
      } else {
View Full Code Here

  public LabelTagReplaceHandler(IDocument doc, String labelFileName) {
    super();
    _doc = doc;
    _labelFileName = labelFileName;
    _findreplace = new FindReplaceDocumentAdapter(doc);
    IEditorPart editorPart = Plugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    if (editorPart != null && editorPart instanceof ITextEditor) {
      _editor = (ITextEditor) editorPart;
    }
    ITextSelection selection = ((ITextSelection) _editor.getEditorSite().getSelectionProvider().getSelection());
    _currentSelection = new Region(selection.getOffset(), selection.getLength());
View Full Code Here

    }   
  }

  public void run(IMarker marker) {
    if(_syncInfo != null){
      IEditorPart editor;
      try {
        editor = WorkbenchUtils.openEditor(Plugin.getDefault().getWorkbench(), _syncInfo, WGADesignEditor.ID);
        if (editor instanceof WGADesignEditor) {
          ((WGADesignEditor) editor).setActivePage(ResourceIDs.EDITORPAGE_WGA_DESIGN_MAPPINGS);
        }
View Full Code Here

  @Override
  public boolean performFinish() {
    if (_openDesignEditor) {
      try {
        IEditorPart editor = WorkbenchUtils.openEditor(Plugin.getDefault().getWorkbench(), new WGADesignStructureHelper(_designContainer).getSyncInfo(), WGADesignEditor.ID);
        if (editor instanceof WGADesignEditor) {
          ((WGADesignEditor) editor).setActivePage(ResourceIDs.EDITORPAGE_WGA_DESIGN_PLUGINCONFIGURATION);
        }
        return true;
      } catch (PartInitException e) {
View Full Code Here

  public void addPages() {
    try {
      boolean designEditorOpenAndDirty = false;
      Iterator<IEditorPart> editors = WorkbenchUtils.findOpenEditors(Plugin.getDefault().getWorkbench(), ResourceIDs.EDITOR_WGA_DESIGN, _designHelper.getSyncInfo()).iterator();
      while (editors.hasNext()) {
        IEditorPart editorPart = editors.next();
        if (editorPart.isDirty()) {
          designEditorOpenAndDirty = true;
          break;
        }
      }
      if (designEditorOpenAndDirty) {
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IEditorPart

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.