use of com.intellij.openapi.actionSystem.Separator in project intellij-plugins by JetBrains.
the class DartCommandLineRunningState method addObservatoryActions.
protected void addObservatoryActions(List<AnAction> actions, final ProcessHandler processHandler) {
actions.add(new Separator());
final OpenDartObservatoryUrlAction openObservatoryAction = new OpenDartObservatoryUrlAction(null, () -> !processHandler.isProcessTerminated());
addObservatoryUrlConsumer(openObservatoryAction::setUrl);
actions.add(openObservatoryAction);
}
use of com.intellij.openapi.actionSystem.Separator in project android by JetBrains.
the class GpuMonitorView method getToolbarActions.
@Override
@NotNull
public ActionGroup getToolbarActions() {
DefaultActionGroup group = new DefaultActionGroup();
group.add(new RecordingAction(this));
group.add(new Separator());
group.add(new BrowserHelpAction("GPU monitor", PROFILING_URL));
return group;
}
use of com.intellij.openapi.actionSystem.Separator in project intellij-community by JetBrains.
the class RunLineMarkerProvider method getLineMarkerInfo.
@Nullable
@Override
public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement element) {
List<RunLineMarkerContributor> contributors = RunLineMarkerContributor.EXTENSION.allForLanguage(element.getLanguage());
Icon icon = null;
List<Info> infos = null;
for (RunLineMarkerContributor contributor : contributors) {
Info info = contributor.getInfo(element);
if (info == null) {
continue;
}
if (icon == null) {
icon = info.icon;
}
if (infos == null) {
infos = new SmartList<>();
}
infos.add(info);
}
if (icon == null)
return null;
if (infos.size() > 1) {
Collections.sort(infos, COMPARATOR);
final Info first = infos.get(0);
for (Iterator<Info> it = infos.iterator(); it.hasNext(); ) {
Info info = it.next();
if (info != first && first.shouldReplace(info)) {
it.remove();
}
}
}
final DefaultActionGroup actionGroup = new DefaultActionGroup();
for (Info info : infos) {
for (AnAction action : info.actions) {
actionGroup.add(new LineMarkerActionWrapper(element, action));
}
if (info != infos.get(infos.size() - 1)) {
actionGroup.add(new Separator());
}
}
List<Info> finalInfos = infos;
Function<PsiElement, String> tooltipProvider = element1 -> {
final StringBuilder tooltip = new StringBuilder();
for (Info info : finalInfos) {
if (info.tooltipProvider != null) {
String string = info.tooltipProvider.apply(element1);
if (string == null)
continue;
if (tooltip.length() != 0) {
tooltip.append("\n");
}
tooltip.append(string);
}
}
return tooltip.length() == 0 ? null : tooltip.toString();
};
return new LineMarkerInfo<PsiElement>(element, element.getTextRange(), icon, Pass.LINE_MARKERS, tooltipProvider, null, GutterIconRenderer.Alignment.CENTER) {
@Nullable
@Override
public GutterIconRenderer createGutterRenderer() {
return new LineMarkerGutterIconRenderer<PsiElement>(this) {
@Override
public AnAction getClickAction() {
return null;
}
@Override
public boolean isNavigateAction() {
return true;
}
@Nullable
@Override
public ActionGroup getPopupMenuActions() {
return actionGroup;
}
};
}
};
}
use of com.intellij.openapi.actionSystem.Separator in project intellij-community by JetBrains.
the class DvcsQuickListContentProvider method getVcsActions.
@Nullable
public List<AnAction> getVcsActions(@Nullable Project project, @Nullable AbstractVcs activeVcs, @Nullable DataContext dataContext) {
if (activeVcs == null || !getVcsName().equals(activeVcs.getName())) {
return null;
}
final ActionManager manager = ActionManager.getInstance();
final List<AnAction> actions = new ArrayList<>();
actions.add(new Separator(activeVcs.getDisplayName()));
add("CheckinProject", manager, actions);
add("CheckinFiles", manager, actions);
add("ChangesView.Revert", manager, actions);
addSeparator(actions);
add("Vcs.ShowTabbedFileHistory", manager, actions);
add("Annotate", manager, actions);
add("Compare.SameVersion", manager, actions);
addSeparator(actions);
addVcsSpecificActions(manager, actions);
return actions;
}
use of com.intellij.openapi.actionSystem.Separator in project android by JetBrains.
the class DeviceMenuActionTest method prettyPrintActions.
private static void prettyPrintActions(AnAction action, StringBuilder sb, int depth) {
String text;
if (action instanceof Separator) {
text = "------------------------------------------------------";
} else {
text = action.getTemplatePresentation().getText();
if (text != null && text.startsWith("AVD:")) {
// build environment
return;
}
}
if (text != null) {
for (int i = 0; i < depth; i++) {
sb.append(" ");
}
sb.append(text).append("\n");
}
DefaultActionGroup group = action instanceof DefaultActionGroup ? (DefaultActionGroup) action : null;
if (group != null) {
for (AnAction child : group.getChildActionsOrStubs()) {
prettyPrintActions(child, sb, depth + 1);
}
}
}
Aggregations