當前位置: 首頁>>代碼示例>>Java>>正文


Java ToolWindow.getAnchor方法代碼示例

本文整理匯總了Java中com.intellij.openapi.wm.ToolWindow.getAnchor方法的典型用法代碼示例。如果您正苦於以下問題:Java ToolWindow.getAnchor方法的具體用法?Java ToolWindow.getAnchor怎麽用?Java ToolWindow.getAnchor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.wm.ToolWindow的用法示例。


在下文中一共展示了ToolWindow.getAnchor方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getHideToolWindowIcon

import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
private static Icon getHideToolWindowIcon(ToolWindow toolWindow) {
  ToolWindowAnchor anchor = toolWindow.getAnchor();
  if (anchor == ToolWindowAnchor.BOTTOM) {
    return AllIcons.General.HideDownPart;
  }
  else if (anchor == ToolWindowAnchor.RIGHT) {
    return AllIcons.General.HideRightPart;
  }

  return AllIcons.General.HideLeftPart;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:ToolWindowHeader.java

示例2: getHideIcon

import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
private static Icon getHideIcon(ToolWindow toolWindow) {
  ToolWindowAnchor anchor = toolWindow.getAnchor();
  if (anchor == ToolWindowAnchor.BOTTOM) {
    return AllIcons.General.HideDown;
  }
  else if (anchor == ToolWindowAnchor.RIGHT) {
    return AllIcons.General.HideRight;
  }

  return AllIcons.General.HideLeft;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:ToolWindowHeader.java

示例3: getHideToolWindowHoveredIcon

import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
private static Icon getHideToolWindowHoveredIcon(ToolWindow toolWindow) {
  ToolWindowAnchor anchor = toolWindow.getAnchor();
  if (anchor == ToolWindowAnchor.BOTTOM) {
    return AllIcons.General.HideDownPartHover;
  }
  else if (anchor == ToolWindowAnchor.RIGHT) {
    return AllIcons.General.HideRightPartHover;
  }

  return AllIcons.General.HideLeftPartHover;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:ToolWindowHeader.java

示例4: getHideHoveredIcon

import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
private static Icon getHideHoveredIcon(ToolWindow toolWindow) {
  ToolWindowAnchor anchor = toolWindow.getAnchor();
  if (anchor == ToolWindowAnchor.BOTTOM) {
    return AllIcons.General.HideDownHover;
  }
  else if (anchor == ToolWindowAnchor.RIGHT) {
    return AllIcons.General.HideRightHover;
  }

  return AllIcons.General.HideLeftHover;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:ToolWindowHeader.java

示例5: stretch

import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
private void stretch(ToolWindow wnd, int value) {
  Pair<Resizer, Component> pair = findResizerAndComponent(wnd);
  if (pair == null) return;

  boolean vertical = wnd.getAnchor() == ToolWindowAnchor.TOP || wnd.getAnchor() == ToolWindowAnchor.BOTTOM;
  int actualSize = (vertical ? pair.second.getHeight() : pair.second.getWidth()) + value;
  boolean first = wnd.getAnchor() == ToolWindowAnchor.LEFT  || wnd.getAnchor() == ToolWindowAnchor.TOP;
  int maxValue = vertical ? myVerticalSplitter.getMaxSize(first) : myHorizontalSplitter.getMaxSize(first);
  int minValue = vertical ? myVerticalSplitter.getMinSize(first) : myHorizontalSplitter.getMinSize(first);;

  pair.first.setSize(Math.max(minValue, Math.min(maxValue, actualSize)));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:ToolWindowsPane.java

示例6: findResizerAndComponent

import com.intellij.openapi.wm.ToolWindow; //導入方法依賴的package包/類
@Nullable
private Pair<Resizer, Component> findResizerAndComponent(ToolWindow wnd) {
  if (!wnd.isVisible()) return null;

  Resizer resizer = null;
  Component cmp = null;

  if (wnd.getType() == ToolWindowType.DOCKED) {
    cmp = getComponentAt(wnd.getAnchor());

    if (cmp != null) {
      if (wnd.getAnchor().isHorizontal()) {
        resizer = myVerticalSplitter.getFirstComponent() == cmp
                  ? new Resizer.Splitter.FirstComponent(myVerticalSplitter)
                  : new Resizer.Splitter.LastComponent(myVerticalSplitter);
      }
      else {
        resizer = myHorizontalSplitter.getFirstComponent() == cmp
                  ? new Resizer.Splitter.FirstComponent(myHorizontalSplitter)
                  : new Resizer.Splitter.LastComponent(myHorizontalSplitter);
      }
    }
  }
  else if (wnd.getType() == ToolWindowType.SLIDING) {
    cmp = wnd.getComponent();
    while (cmp != null) {
      if (cmp.getParent() == myLayeredPane) break;
      cmp = cmp.getParent();
    }

    if (cmp != null) {
      if (wnd.getAnchor() == ToolWindowAnchor.TOP) {
        resizer = new Resizer.LayeredPane.Top(cmp);
      }
      else if (wnd.getAnchor() == ToolWindowAnchor.BOTTOM) {
        resizer = new Resizer.LayeredPane.Bottom(cmp);
      }
      else if (wnd.getAnchor() == ToolWindowAnchor.LEFT) {
        resizer = new Resizer.LayeredPane.Left(cmp);
      }
      else if (wnd.getAnchor() == ToolWindowAnchor.RIGHT) {
        resizer = new Resizer.LayeredPane.Right(cmp);
      }
    }
  }

  return resizer != null ? Pair.create(resizer, cmp) : null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:49,代碼來源:ToolWindowsPane.java


注:本文中的com.intellij.openapi.wm.ToolWindow.getAnchor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。