use of com.intellij.ui.components.panels.Wrapper in project intellij-community by JetBrains.
the class RunnerContentUi method getGridFor.
@Nullable
private GridImpl getGridFor(@NotNull Content content, boolean createIfMissing) {
GridImpl grid = (GridImpl) findGridFor(content);
if (grid != null || !createIfMissing)
return grid;
grid = new GridImpl(this, mySessionName);
if (myCurrentOver != null || myOriginal != null) {
Integer forcedDropIndex = content.getUserData(RunnerLayout.DROP_INDEX);
final int index = myTabs.getDropInfoIndex() + (myOriginal != null ? myOriginal.getTabOffsetFor(this) : 0);
final int dropIndex = forcedDropIndex != null ? forcedDropIndex : index;
if (forcedDropIndex == null) {
moveFollowingTabs(dropIndex);
}
final int defaultIndex = content.getUserData(RunnerLayout.DEFAULT_INDEX);
final TabImpl tab = myLayoutSettings.getOrCreateTab(forcedDropIndex != null ? forcedDropIndex : -1);
tab.setDefaultIndex(defaultIndex);
tab.setIndex(dropIndex);
getStateFor(content).assignTab(tab);
content.putUserData(RunnerLayout.DROP_INDEX, null);
content.putUserData(RunnerLayout.DEFAULT_INDEX, null);
}
TabInfo tab = new TabInfo(grid).setObject(getStateFor(content).getTab()).setText("Tab");
Wrapper left = new Wrapper();
myCommonActionsPlaceholder.put(grid, left);
Wrapper minimizedToolbar = new Wrapper();
myMinimizedButtonsPlaceholder.put(grid, minimizedToolbar);
final Wrapper searchComponent = new Wrapper();
if (content.getSearchComponent() != null) {
searchComponent.setContent(content.getSearchComponent());
}
TwoSideComponent right = new TwoSideComponent(searchComponent, minimizedToolbar);
NonOpaquePanel sideComponent = new TwoSideComponent(left, right);
tab.setSideComponent(sideComponent);
tab.setTabLabelActions((ActionGroup) myActionManager.getAction(VIEW_TOOLBAR), TAB_TOOLBAR_PLACE);
myTabs.addTab(tab);
myTabs.sortTabs(myTabsComparator);
return grid;
}
use of com.intellij.ui.components.panels.Wrapper in project intellij-community by JetBrains.
the class RunnerContentUi method rebuildCommonActions.
private boolean rebuildCommonActions() {
boolean hasToolbarContent = false;
for (Map.Entry<GridImpl, Wrapper> entry : myCommonActionsPlaceholder.entrySet()) {
Wrapper eachPlaceholder = entry.getValue();
List<Content> contentList = entry.getKey().getContents();
Set<Content> contents = new HashSet<>();
contents.addAll(contentList);
DefaultActionGroup groupToBuild;
JComponent contextComponent = null;
if (isHorizontalToolbar() && contents.size() == 1) {
Content content = contentList.get(0);
groupToBuild = new DefaultActionGroup();
if (content.getActions() != null) {
groupToBuild.addAll(content.getActions());
groupToBuild.addSeparator();
contextComponent = content.getActionsContextComponent();
}
groupToBuild.addAll(myTopActions);
} else {
final DefaultActionGroup group = new DefaultActionGroup();
group.addAll(myTopActions);
groupToBuild = group;
}
final AnAction[] actions = groupToBuild.getChildren(null);
if (!Arrays.equals(actions, myContextActions.get(entry.getKey()))) {
String adjustedPlace = myActionsPlace == ActionPlaces.UNKNOWN ? ActionPlaces.TOOLBAR : myActionsPlace;
ActionToolbar tb = myActionManager.createActionToolbar(adjustedPlace, groupToBuild, true);
tb.getComponent().setBorder(null);
tb.setTargetComponent(contextComponent);
eachPlaceholder.setContent(tb.getComponent());
}
if (groupToBuild.getChildrenCount() > 0) {
hasToolbarContent = true;
}
myContextActions.put(entry.getKey(), actions);
}
return hasToolbarContent;
}
use of com.intellij.ui.components.panels.Wrapper in project intellij-community by JetBrains.
the class RunnerContentUi method rebuildMinimizedActions.
private boolean rebuildMinimizedActions() {
for (Map.Entry<GridImpl, Wrapper> entry : myMinimizedButtonsPlaceholder.entrySet()) {
Wrapper eachPlaceholder = entry.getValue();
ActionToolbar tb = myActionManager.createActionToolbar(ActionPlaces.DEBUGGER_TOOLBAR, myMinimizedViewActions, true);
tb.getComponent().setBorder(null);
tb.setReservePlaceAutoPopupIcon(false);
JComponent minimized = tb.getComponent();
eachPlaceholder.setContent(minimized);
}
myTabs.getComponent().revalidate();
myTabs.getComponent().repaint();
return myMinimizedViewActions.getChildrenCount() > 0;
}
use of com.intellij.ui.components.panels.Wrapper in project intellij-community by JetBrains.
the class InfoAndProgressPanel method buildInProcessCount.
private void buildInProcessCount() {
removeAll();
setLayout(new BorderLayout());
final JPanel progressCountPanel = new JPanel(new BorderLayout(0, 0));
progressCountPanel.setOpaque(false);
String processWord = myOriginals.size() == 1 ? " process" : " processes";
final LinkLabel label = new LinkLabel(myOriginals.size() + processWord + " running...", null, new LinkListener() {
@Override
public void linkSelected(final LinkLabel aSource, final Object aLinkData) {
triggerPopupShowing();
}
});
if (SystemInfo.isMac)
label.setFont(JBUI.Fonts.label(11));
label.setOpaque(false);
final Wrapper labelComp = new Wrapper(label);
labelComp.setOpaque(false);
progressCountPanel.add(labelComp, BorderLayout.CENTER);
//myProgressIcon.setBorder(new IdeStatusBarImpl.MacStatusBarWidgetBorder());
progressCountPanel.add(myProgressIcon, BorderLayout.WEST);
add(myRefreshAndInfoPanel, BorderLayout.CENTER);
progressCountPanel.setBorder(JBUI.Borders.emptyRight(4));
add(progressCountPanel, BorderLayout.EAST);
revalidate();
repaint();
}
use of com.intellij.ui.components.panels.Wrapper in project intellij-community by JetBrains.
the class GraphTableController method showTooltip.
private boolean showTooltip(int row, int column, @NotNull Point point, boolean now) {
JComponent tipComponent = myCommitRenderer.getTooltip(myTable.getValueAt(row, myTable.convertColumnIndexToView(column)), calcPoint4Graph(point), row);
if (tipComponent != null) {
myTable.getExpandableItemsHandler().setEnabled(false);
IdeTooltip tooltip = new IdeTooltip(myTable, point, new Wrapper(tipComponent)).setPreferredPosition(Balloon.Position.below);
IdeTooltipManager.getInstance().show(tooltip, now);
return true;
}
return false;
}
Aggregations