Examples of IWindowTrim


Examples of org.eclipse.ui.internal.layout.IWindowTrim

      final int side = proxy.getSide();
      boolean atStart = proxy.isAtStart();

      // Place the trim before any other trim if it's
      // at the 'start'; otherwise place it at the end
      IWindowTrim beforeMe = null;
      if (atStart) {
        List trim = fWindow.getTrimManager().getAreaTrim(side);
        if (trim.size() > 0)
          beforeMe = (IWindowTrim) trim.get(0);
      }
View Full Code Here

Examples of org.eclipse.ui.internal.layout.IWindowTrim

            // HACK!! Fake this
            ToolBarTrimProxy tbProxy = new ToolBarTrimProxy(ci.getId(), wbWindow);
            tbProxy.dock(swtSides[i]);
           
            // If we're adding to the 'command1' area then we're -before- the CoolBar
            IWindowTrim insertBefore = null;
            if (i == 0) {
              insertBefore = layout.getTrim("org.eclipse.ui.internal.WorkbenchWindow.topBar"); //$NON-NLS-1$
            }
            layout.addTrim(swtSides[i], tbProxy, insertBefore);           
            contributedTrim.add(tbProxy);
View Full Code Here

Examples of org.eclipse.ui.internal.layout.IWindowTrim

      if (!(draggedObject instanceof IWindowTrim)) {
      return null;
    }
     
      // OK, we're dragging trim. is it from -this- shell?
      IWindowTrim trim = (IWindowTrim) draggedObject;
      if (trim.getControl().getShell() != windowComposite.getShell()) {
      return null;
    }
     
      // If this is the -first- drag then inform the drop target
      if (dropTarget.draggedTrim == null) {
View Full Code Here

Examples of org.eclipse.ui.internal.layout.IWindowTrim

    fvm.deferUpdates(true);
   
    LayoutPart[] children = root.getChildren();
    for (int i = 0; i < children.length; i++) {
      if (children[i] != this) {
        IWindowTrim trim = tbm.getTrim(children[i].getID());
        if (trim == null)
          continue;

        if (trim instanceof ViewStackTrimToolBar) {
          ViewStackTrimToolBar vstb = (ViewStackTrimToolBar) trim;
View Full Code Here

Examples of org.eclipse.ui.internal.layout.IWindowTrim

         * should be located.
         */
        private void trackInsideTrimArea(Point pos) {
          // Where should we be?
          int newArea = getTrimArea(pos);
          IWindowTrim newInsertBefore = getInsertBefore(newArea, pos);

          // if we're currently undocked then we should dock
          boolean shouldDock = dockedArea == SWT.NONE;
         
          // If we're already docked then only update if there's a change in area or position
          if (dockedArea != SWT.NONE) {
            // Where are we now?
            IWindowTrim curInsertBefore = getInsertBefore(dockedArea, draggedTrim);
           
            // If we're already docked we should only update if there's a change
            shouldDock = dockedArea != newArea || curInsertBefore != newInsertBefore;
          }
         
View Full Code Here

Examples of org.eclipse.ui.internal.layout.IWindowTrim

        // Update the FVB only if not using the new min/max
        WorkbenchWindow wbw = (WorkbenchWindow) page.getWorkbenchWindow();
        if (wbw != null) {
          ITrimManager tbm = wbw.getTrimManager();
          if (tbm != null) {
            IWindowTrim fvb = tbm.getTrim(FastViewBar.FASTVIEWBAR_ID);
            if (fvb instanceof FastViewBar) {
              ((FastViewBar)fvb).update(true);
            }
          }
        }
View Full Code Here

Examples of org.eclipse.ui.internal.layout.IWindowTrim

        int suggestedSide = SWT.RIGHT;
      int cachedSide = ((TrimLayout)tbm).getPreferredArea(IPageLayout.ID_EDITOR_AREA);
      if (cachedSide != -1)
        suggestedSide = cachedSide;
     
      IWindowTrim beforeMe = ((TrimLayout)tbm).getPreferredLocation(IPageLayout.ID_EDITOR_AREA);
     
        // Gain access to the trim manager
      editorAreaTrim = new EditorAreaTrimToolBar(wbw, editorArea);
      editorAreaTrim.dock(suggestedSide);
      tbm.addTrim(suggestedSide, editorAreaTrim, beforeMe);
View Full Code Here

Examples of org.eclipse.ui.internal.layout.IWindowTrim

    if (trim == null) {
      int cachedSide = tbm.getPreferredArea(id);
      if (cachedSide != -1)
        suggestedSide = cachedSide;
     
      IWindowTrim beforeMe = tbm.getPreferredLocation(id);
     
      trim = new ViewStackTrimToolBar(id, suggestedSide,
          paneOrientation, wbw);
      tbm.addTrim(suggestedSide, trim, beforeMe);
      updateTrim(trim.getId());
View Full Code Here

Examples of org.eclipse.ui.internal.layout.IWindowTrim

   * @param id
   *            The id of the {@link IWindowTrim} to update
   */
  private void updateTrim(String id) {
    // Get the trim part from the trim manager
    IWindowTrim trim = tbm.getTrim(id);

    // If it's not there there's not much we can do
    if (trim == null)
      return;

    // If there are no fast views for the bar then hide it
    List fvs = (List) idToFastViewsMap.get(id);
    if (fvs != null && fvs.size() == 0
        && !FastViewBar.FASTVIEWBAR_ID.equals(id)) {
      if (trim.getControl().getVisible()) {
        tbm.setTrimVisible(trim, false);
        tbm.forceLayout();
      }
      return;
    }

    // Ensure that the trim is displayed
    if (!trim.getControl().getVisible()) {
      tbm.setTrimVisible(trim, true);
    }

    if (trim instanceof FastViewBar) {
      FastViewBar fvb = (FastViewBar) trim;
      fvb.update(true);
    } else if (trim instanceof ViewStackTrimToolBar) {
      ViewStackTrimToolBar vstb = (ViewStackTrimToolBar) trim;
      vstb.update(true);
      vstb.getControl().pack();
      LayoutUtil.resize(trim.getControl());
    }

    tbm.forceLayout();
  }
View Full Code Here

Examples of org.eclipse.ui.internal.layout.IWindowTrim

  /**
   * @return The side that the fast view pane should be attached to based on
   *         the position of the trim element containing the ref.
   */
  public int getViewSide(IViewReference ref) {
    IWindowTrim trim = getTrimForRef(ref);
    if (trim == null)
      return SWT.BOTTOM;

    int curSide = SWT.BOTTOM;
    int paneOrientation = SWT.BOTTOM;

    if (trim instanceof ViewStackTrimToolBar) {
      curSide = ((ViewStackTrimToolBar) trim).getCurrentSide();
      paneOrientation = ((ViewStackTrimToolBar) trim)
          .getPaneOrientation();
    } else if (trim instanceof FastViewBar) {
      curSide = ((FastViewBar) trim).getSide();
      paneOrientation = ((FastViewBar) trim).getOrientation(ref);
    }

    // Get trim layout info
    Point trimCenter = Geometry.centerPoint(trim.getControl().getBounds());
    Point shellCenter = Geometry.centerPoint(trim.getControl().getShell()
        .getClientArea());

    // Horizontal has to snap to either TOP or BOTTOM...
    if (paneOrientation == SWT.HORIZONTAL) {
      if (curSide == SWT.TOP || curSide == SWT.BOTTOM)
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.