本文整理汇总了Java中com.intellij.ui.tabs.TabInfo.getTabLabelActions方法的典型用法代码示例。如果您正苦于以下问题:Java TabInfo.getTabLabelActions方法的具体用法?Java TabInfo.getTabLabelActions怎么用?Java TabInfo.getTabLabelActions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.tabs.TabInfo
的用法示例。
在下文中一共展示了TabInfo.getTabLabelActions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ActionPanel
import com.intellij.ui.tabs.TabInfo; //导入方法依赖的package包/类
public ActionPanel(JBTabsImpl tabs, TabInfo tabInfo, Pass<MouseEvent> pass) {
myTabs = tabs;
ActionGroup group = tabInfo.getTabLabelActions() != null ? tabInfo.getTabLabelActions() : new DefaultActionGroup();
AnAction[] children = group.getChildren(null);
final NonOpaquePanel wrapper = new NonOpaquePanel(new BorderLayout());
wrapper.add(Box.createHorizontalStrut(2), BorderLayout.WEST);
NonOpaquePanel inner = new NonOpaquePanel();
inner.setLayout(new BoxLayout(inner, BoxLayout.X_AXIS));
wrapper.add(inner, BorderLayout.CENTER);
for (AnAction each : children) {
ActionButton eachButton = new ActionButton(myTabs, tabInfo, each, tabInfo.getTabActionPlace(), pass, tabs.getTabActionsMouseDeadzone()) {
@Override
protected void repaintComponent(final Component c) {
TabLabel tabLabel = (TabLabel) SwingUtilities.getAncestorOfClass(TabLabel.class, c);
if (tabLabel != null) {
Point point = SwingUtilities.convertPoint(c, new Point(0, 0), tabLabel);
Dimension d = c.getSize();
tabLabel.repaint(point.x, point.y, d.width, d.height);
} else {
super.repaintComponent(c);
}
}
};
myButtons.add(eachButton);
InplaceButton component = eachButton.getComponent();
inner.add(component);
}
add(wrapper);
}
示例2: ActionPanel
import com.intellij.ui.tabs.TabInfo; //导入方法依赖的package包/类
public ActionPanel(JBTabsImpl tabs, TabInfo tabInfo, Pass<MouseEvent> pass) {
myTabs = tabs;
ActionGroup group = tabInfo.getTabLabelActions() != null ? tabInfo.getTabLabelActions() : new DefaultActionGroup();
AnAction[] children = group.getChildren(null);
final NonOpaquePanel wrapper = new NonOpaquePanel(new BorderLayout());
wrapper.add(Box.createHorizontalStrut(2), BorderLayout.WEST);
NonOpaquePanel inner = new NonOpaquePanel();
inner.setLayout(new BoxLayout(inner, BoxLayout.X_AXIS));
wrapper.add(inner, BorderLayout.CENTER);
for (AnAction each : children) {
ActionButton eachButton = new ActionButton(myTabs, tabInfo, each, tabInfo.getTabActionPlace(), pass, tabs.getTabActionsMouseDeadzone()) {
@Override
protected void repaintComponent(final Component c) {
TabLabel tabLabel = (TabLabel) SwingUtilities.getAncestorOfClass(TabLabel.class, c);
if (tabLabel != null) {
Point point = SwingUtilities.convertPoint(c, new Point(0, 0), tabLabel);
Dimension d = c.getSize();
tabLabel.repaint(point.x, point.y, d.width, d.height);
} else {
super.repaintComponent(c);
}
}
};
myButtons.add(eachButton);
InplaceButton component = eachButton.getComponent();
inner.add(component);
}
add(wrapper);
}