Package it.tref.eclipse.wicket.plugin.editors

Examples of it.tref.eclipse.wicket.plugin.editors.WicketFunEditor


      WicketHyperlink wicketHyperlink = new WicketHyperlink(widRegion, wicketId, extensionToOpen);
      return new IHyperlink[] { wicketHyperlink };
    }
    else
    {
      WicketFunEditor wEditor = (WicketFunEditor)editor;
      List<IHyperlink> links = new ArrayList<IHyperlink>();
      for(IEditorPart ed : wEditor.getPropertiesEditors())
      {
        links.add(new WicketHyperlink(widRegion, wicketId, extensionToOpen, ed));
      }
      return links.toArray(new IHyperlink[0]);
    }
View Full Code Here


      final IWorkbenchPage activePage = workbench.getActiveWorkbenchWindow().getActivePage();
     
      if(!(activePage.getActiveEditor() instanceof WicketFunEditor))
        return;
     
      final WicketFunEditor wEditor = (WicketFunEditor)activePage.getActiveEditor();
     
      final IEditorPart editor = wEditor.getActiveEditor();
      Assert.isNotNull(editor);
     
      if (editor instanceof ITextEditor)
      {
        try {
          if ("java".equals(extension))
          {
            final ITextEditor textEditor = (ITextEditor)wEditor.getJavaEditor();
            final IDocument document = ((textEditor).getDocumentProvider()).getDocument(textEditor.getEditorInput());
            final FindReplaceDocumentAdapter frda = new FindReplaceDocumentAdapter(document);
            final IRegion region = frda.find(0, '"' + wicketId + '"', true, true, false, false);
            if (region != null)
            {
              textEditor.selectAndReveal(region.getOffset() + 1, wicketId.length());
              wEditor.setActiveEditor(wEditor.getJavaEditor());
            }
          }
          else if ("html".equals(extension))
          {
            final ITextEditor textEditor = (ITextEditor)wEditor.getHtmlEditor();
            final IDocument document = ((textEditor).getDocumentProvider()).getDocument(textEditor.getEditorInput());
            final FindReplaceDocumentAdapter frda = new FindReplaceDocumentAdapter(document);
            final IRegion region = frda.find(0, "wicket:id=\"" + wicketId, true, true, true, false);
            if (region != null)
            {
              textEditor.selectAndReveal(region.getOffset() + 11, wicketId.length());
              wEditor.setActiveEditor(wEditor.getHtmlEditor());
            }
          }
          else if ("properties".equals(extension) && propertiesEditor != null)
          {
            final ITextEditor textEditor = (ITextEditor)propertiesEditor;
            final IDocument document = ((textEditor).getDocumentProvider()).getDocument(textEditor.getEditorInput());
            final FindReplaceDocumentAdapter frda = new FindReplaceDocumentAdapter(document);
            IRegion regionBegin = frda.find(0, wicketId, true, true, true, false);
            if (regionBegin != null)
            {
              regionBegin = frda.find(regionBegin.getOffset(), "=", true, true, false, false);
              if (regionBegin != null)
              {
                final IRegion lineRegion = document.getLineInformationOfOffset(regionBegin.getOffset());
                final int selectionLength = lineRegion.getOffset() + lineRegion.getLength() - regionBegin.getOffset();
                textEditor.selectAndReveal(regionBegin.getOffset() + 1, selectionLength);
                wEditor.setActiveEditor(propertiesEditor);
              }
            }
          }
        } catch (final BadLocationException e) {
          return;
View Full Code Here

  {
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
   
    if(window.getActivePage().getActiveEditor() instanceof WicketFunEditor)
    {
      WicketFunEditor wfe = (WicketFunEditor)window.getActivePage().getActiveEditor();
      IEditorPart pe = wfe.getNextPropertiesEditor();
      if(pe != null)
        wfe.setActiveEditor(pe);
    }
   
    return null;
  }
View Full Code Here

  {
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
   
    if(window.getActivePage().getActiveEditor() instanceof WicketFunEditor)
    {
      WicketFunEditor wfe = (WicketFunEditor)window.getActivePage().getActiveEditor();
      wfe.setActiveEditor(wfe.getJavaEditor());
    }
   
    return null;
  }
View Full Code Here

  {
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
   
    if(window.getActivePage().getActiveEditor() instanceof WicketFunEditor)
    {
      WicketFunEditor wfe = (WicketFunEditor)window.getActivePage().getActiveEditor();
      if(wfe.getHtmlEditor() != null)
        wfe.setActiveEditor(wfe.getHtmlEditor());
    }
   
    return null;
  }
View Full Code Here

TOP

Related Classes of it.tref.eclipse.wicket.plugin.editors.WicketFunEditor

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.