Package org.locationtech.udig.style.sld

Examples of org.locationtech.udig.style.sld.IEditorPage


    super.createPage(node);
    if (this.pageData == null)
      return;
    //Apply the data if it has been set.
    IEditorPage page = node.getPage();
    if (page instanceof IEditorPage)
      ((IEditorPage) page).applyData(this.pageData);

  }
View Full Code Here


   * @see org.eclipse.ui.Editors.IWorkbenchEditorContainer#openPage(java.lang.String, java.lang.Object)
   */
  public boolean openPage(String pageId, Object data) {
    setPageData(data);
    setCurrentPageId(pageId);
    IEditorPage page = getCurrentPage();
    if (page instanceof IEditorPage)
      ((IEditorPage) page).applyData(data);
    return true;
  }
View Full Code Here

          // Notify all the pages and give them a chance to abort
          Iterator nodes = editorPageManager.getElements(EditorPageManager.PRE_ORDER)
              .iterator();
          while (nodes.hasNext()) {
            IEditorNode node = (IEditorNode) nodes.next();
            IEditorPage page = node.getPage();
            if (page != null) {
              if (!page.performOk()){
                hasFailedOK = true;
                return;
              }
            }
          }
View Full Code Here

    // Create the page if nessessary
    if (node.getPage() == null)
      createPage(node);
    if (node.getPage() == null)
      return false;
    IEditorPage newPage = getPage(node);
    if (newPage == currentPage)
      return true;
    if (currentPage != null) {
      if (!currentPage.okToLeave())
        return false;
    }
    IEditorPage oldPage = currentPage;
    currentPage = newPage;
    // Set the new page's container
    currentPage.setContainer(this);
    // Ensure that the page control has been created
    // (this allows lazy page control creation)
    if (currentPage.getControl() == null) {
      final boolean[] failed = { false };
      SafeRunnable.run(new ISafeRunnable() {
        public void handleException(Throwable e) {
          failed[0] = true;
        }

        public void run() {
          createPageControl(currentPage, pageContainer);
        }
      });
      if (failed[0])
        return false;
      // the page is responsible for ensuring the created control is
      // accessable
      // via getControl.
      Assert.isNotNull(currentPage.getControl());
    }
    // Force calculation of the page's description label because
    // label can be wrapped.
    final Point[] size = new Point[1];
    final Point failed = new Point(-1, -1);
    SafeRunnable.run(new ISafeRunnable() {
      public void handleException(Throwable e) {
        size[0] = failed;
      }

      public void run() {
        size[0] = currentPage.computeSize();
      }
    });
    if (size[0].equals(failed))
      return false;
    Point contentSize = size[0];
    // Do we need resizing. Computation not needed if the
    // first page is inserted since computing the dialog's
    // size is done by calling dialog.open().
    // Also prevent auto resize if the user has manually resized
    Shell shell = getShell();
    Point shellSize = shell.getSize();
    if (oldPage != null) {
      Rectangle rect = pageContainer.getClientArea();
      Point containerSize = new Point(rect.width, rect.height);
      int hdiff = contentSize.x - containerSize.x;
      int vdiff = contentSize.y - containerSize.y;
      if ((hdiff > 0 || vdiff > 0) && shellSize.equals(lastShellSize)) {
          hdiff = Math.max(0, hdiff);
          vdiff = Math.max(0, vdiff);
          setShellSize(shellSize.x + hdiff, shellSize.y + vdiff);
          lastShellSize = shell.getSize();
          if (currentPage.getControl().getSize().x == 0)
            currentPage.getControl().setSize(containerSize);
       
      } else //Set the size to be sure we use the result of computeSize
        currentPage.setSize(containerSize);
    }
    // Ensure that all other pages are invisible
    // (including ones that triggered an exception during
    // their creation).
    Control[] children = pageContainer.getChildren();
    Control currentControl = currentPage.getControl();
    for (int i = 0; i < children.length; i++) {
      if (children[i] != currentControl)
        children[i].setVisible(false);
    }
    // Make the new page visible
    currentPage.setVisible(true);
    if (oldPage != null)
      oldPage.setVisible(false);
    // update the dialog controls
    update();
    return true;
  }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.style.sld.IEditorPage

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.