com.intellij.icons.AllIcons Java Examples

The following examples show how to use com.intellij.icons.AllIcons. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LandingPageAction.java    From jetbrains-plugin-graph-database-support with Apache License 2.0 6 votes vote down vote up
public static void open() {
    Analytics.event("landingPage", "clicked");
    int ok = Messages.showOkCancelDialog("This feature is planned for a \nfuture release of the premium version.\n" +
                    "If you are interested, please visit: \n\n" + URL, "Premium Version", "Find more", "Cancel",
            AllIcons.General.QuestionDialog);
    if (ok == 0) {
        Analytics.event("landingPage", "land");
        try {
            Desktop.getDesktop().browse(URI.create(URL));
        } catch (Exception e) {
            BrowserLauncher.getInstance().browse(URI.create(URL));
        }
    } else {
        Analytics.event("landingPage", "cancel");
    }
}
 
Example #2
Source File: WeavePsiImplUtils.java    From mule-intellij-plugins with Apache License 2.0 6 votes vote down vote up
public static ItemPresentation getPresentation(final WeaveSimpleKeyValuePair kvp) {
    return new ItemPresentation() {

        @Nullable
        @Override
        public String getPresentableText() {
            return kvp.getKey().getExpression().getText();
        }

        @Nullable
        @Override
        public String getLocationString() {
            return null;
        }

        @Nullable
        @Override
        public Icon getIcon(boolean b) {
            return AllIcons.Json.Property_braces;
        }
    };
}
 
Example #3
Source File: WeavePsiImplUtils.java    From mule-intellij-plugins with Apache License 2.0 6 votes vote down vote up
public static ItemPresentation getPresentation(WeaveArrayExpression document) {
    return new ItemPresentation() {

        @Nullable
        @Override
        public String getPresentableText() {
            return "";
        }

        @Nullable
        @Override
        public String getLocationString() {
            return null;
        }

        @Nullable
        @Override
        public Icon getIcon(boolean b) {
            return AllIcons.Json.Array;
        }
    };
}
 
Example #4
Source File: WeaveExecutionStack.java    From mule-intellij-plugins with Apache License 2.0 6 votes vote down vote up
protected WeaveExecutionStack(DebuggerClient client, OnFrameEvent onFrameEvent, String displayName, XDebugSession session, VirtualFile file)
{
    super(displayName, AllIcons.Debugger.ThreadSuspended);
    final DebuggerFrame[] frames = onFrameEvent.frames();
    this.frames = new ArrayList<>();
    for (int i = 0; i < frames.length; i++)
    {
        final DebuggerFrame debuggerFrame = frames[i];
        if (i == 0)
        {
            this.frames.add(new WeaveStackFrame(client, onFrameEvent.startPosition(), debuggerFrame, file));
        }
        else
        {
            this.frames.add(new WeaveStackFrame(client, frames[i - 1].startPosition(), debuggerFrame, file));
        }
    }
}
 
Example #5
Source File: DartVmServiceStackFrame.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
public void customizePresentation(@NotNull final ColoredTextContainer component) {
  final String unoptimizedPrefix = "[Unoptimized] ";

  String name = StringUtil.trimEnd(myVmFrame.getCode().getName(), "="); // trim setter postfix
  name = StringUtil.trimStart(name, unoptimizedPrefix);

  final boolean causal = myVmFrame.getKind() == FrameKind.AsyncCausal;
  component.append(name, causal ? SimpleTextAttributes.REGULAR_ITALIC_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES);

  if (mySourcePosition != null) {
    final String text = " (" + mySourcePosition.getFile().getName() + ":" + (mySourcePosition.getLine() + 1) + ")";
    component.append(text, SimpleTextAttributes.GRAY_ATTRIBUTES);
  }

  component.setIcon(AllIcons.Debugger.Frame);
}
 
Example #6
Source File: TemplateEditPane.java    From CodeMaker with Apache License 2.0 6 votes vote down vote up
protected void setUpShowTestInputButton() {
    showTestInput.setIcon(AllIcons.General.ArrowDown);
    showTestInput.setToolTipText("Show Test Input");
    showTestInput.addActionListener(e -> {
        if(!templateEditAndTest.getTestInputShown()) {
            templateEditAndTest.toggleTestInputPane();
            showTestInput.setIcon(AllIcons.General.ArrowUp);
            editorSplitPane.setEnabled(true);
            showTestInput.setToolTipText("Hide Test Input");
        } else {
            templateEditAndTest.toggleTestInputPane();
            showTestInput.setIcon(AllIcons.General.ArrowDown);
            showTestInput.setToolTipText("Show Test Input");
            editorSplitPane.setEnabled(false);
        }
    });
}
 
Example #7
Source File: DartVmServiceExecutionStack.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public DartVmServiceExecutionStack(@NotNull final DartVmServiceDebugProcess debugProcess,
                                   @NotNull final String isolateId,
                                   @NotNull final String isolateName,
                                   @Nullable final Frame topFrame,
                                   @Nullable final InstanceRef exception) {
  // topFrame is not null for (and only for) the active execution stack
  super(debugProcess.isIsolateSuspended(isolateId) ? beautify(isolateName)
                                                   : beautify(isolateName) + " (running)",
        topFrame != null ? AllIcons.Debugger.ThreadCurrent
                         : debugProcess.isIsolateSuspended(isolateId) ? AllIcons.Debugger.ThreadAtBreakpoint
                                                                      : AllIcons.Debugger.ThreadRunning);
  myDebugProcess = debugProcess;
  myIsolateId = isolateId;
  myException = exception;
  myTopFrame = topFrame == null ? null : new DartVmServiceStackFrame(debugProcess, isolateId, topFrame, null, exception);
}
 
Example #8
Source File: CmtFileEditor.java    From reasonml-idea-plugin with MIT License 6 votes vote down vote up
@NotNull
@Override
public JComponent getComponent() {
    m_rootTabbedPane = new JBTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);

    InsightManager insightManager = ServiceManager.getService(m_project, InsightManager.class);
    List<String> meta = insightManager.dumpMeta(m_file);
    String xmlSource = insightManager.dumpTree(m_file);
    List<String> types = insightManager.dumpInferredTypes(m_file);

    m_rootTabbedPane.addTab("Meta", AllIcons.Nodes.DataTables, new JBScrollPane(new Table(new MetaTableModel(meta))));
    m_rootTabbedPane.addTab("AST", AllIcons.FileTypes.Xml, new CmtXmlComponent(m_project, m_rootTabbedPane, xmlSource));
    m_rootTabbedPane.addTab("Inferred", AllIcons.Nodes.DataSchema, new JBScrollPane(new Table(new InferredTableModel(types))));

    return m_rootTabbedPane;
}
 
Example #9
Source File: DartVmServiceStackFrame.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
public void customizePresentation(@NotNull final ColoredTextContainer component) {
  final String unoptimizedPrefix = "[Unoptimized] ";

  String name = StringUtil.trimEnd(myVmFrame.getCode().getName(), "="); // trim setter postfix
  name = StringUtil.trimStart(name, unoptimizedPrefix);

  final boolean causal = myVmFrame.getKind() == FrameKind.AsyncCausal;
  component.append(name, causal ? SimpleTextAttributes.REGULAR_ITALIC_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES);

  if (mySourcePosition != null) {
    final String text = " (" + mySourcePosition.getFile().getName() + ":" + (mySourcePosition.getLine() + 1) + ")";
    component.append(text, SimpleTextAttributes.GRAY_ATTRIBUTES);
  }

  component.setIcon(AllIcons.Debugger.Frame);
}
 
Example #10
Source File: ReportDialog.java    From PackageTemplates with Apache License 2.0 6 votes vote down vote up
private void addFailed(final BaseReport report) {
    //Icon
    JBLabel iconLabel = new JBLabel(PluginIcons.REPORT_FAIL);
    iconLabel.setToolTipText(Localizer.get("tooltip.ReportFailed"));

    //Label
    JBLabel label = new JBLabel(report.getAction().toString(), report.toIcon(), SwingConstants.LEFT);

    // Button details
    JButton btnDetails = new JButton(Localizer.get("action.ShowDetails"), AllIcons.General.InspectionsEye);
    btnDetails.repaint();
    btnDetails.addMouseListener(new ClickListener() {
        @Override
        public void mouseClicked(MouseEvent e) {
            Messages.showMessageDialog(
                    report.getMessage(),
                    Localizer.get("title.ErrorDetails"),
                    Messages.getInformationIcon()
            );
        }
    });

    panel.add(iconLabel, new CC().spanX().split(3));
    panel.add(label, new CC());
    panel.add(btnDetails, new CC().wrap().pad(0, 0, 0, 0));
}
 
Example #11
Source File: SearchActionTypeCellRenderer.java    From PackageTemplates with Apache License 2.0 6 votes vote down vote up
@Override
public void customize(JList list, SearchActionType actionType, int index, boolean selected, boolean hasFocus) {
    if (actionType != null) {
        setText(Localizer.get(actionType.getNameLangKey()));
        switch (actionType) {
            case DIR_ABOVE:
            case DIR_BELOW:
            case DIR_PARENT:
                setIcon(AllIcons.Nodes.Package);
                break;
            case FILE:
                setIcon(AllIcons.FileTypes.Text);
                break;
        }
    }
}
 
Example #12
Source File: FlutterGeneratorPeer.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public FlutterGeneratorPeer(WizardContext context) {
  myContext = context;
  myInstallSdkAction = new InstallSdkAction(this);

  errorIcon.setText("");
  errorIcon.setIcon(AllIcons.Actions.Lightning);
  Messages.installHyperlinkSupport(errorText);

  // Hide pending real content.
  myVersionContent.setVisible(false);
  myProgressBar.setVisible(false);
  myProgressText.setVisible(false);
  myCancelProgressButton.setVisible(false);

  init();
}
 
Example #13
Source File: RunnerUtil.java    From react-native-console with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public static final ConsoleView showHelperProcessRunContent(String header, OSProcessHandler runHandler, Project project, Executor defaultExecutor) {
        ProcessTerminatedListener.attach(runHandler);

        ConsoleViewImpl consoleView = new ConsoleViewImpl(project, true);
        DefaultActionGroup toolbarActions = new DefaultActionGroup();

        JPanel panel = new JPanel((LayoutManager) new BorderLayout());
        panel.add((Component) consoleView.getComponent(), "Center");
        ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("unknown", (ActionGroup) toolbarActions, false);
        toolbar.setTargetComponent(consoleView.getComponent());
        panel.add((Component) toolbar.getComponent(), "West");

        RunContentDescriptor runDescriptor = new RunContentDescriptor((ExecutionConsole) consoleView,
                (ProcessHandler) runHandler, (JComponent) panel, header, AllIcons.RunConfigurations.Application);
        AnAction[]
                consoleActions = consoleView.createConsoleActions();
        toolbarActions.addAll((AnAction[]) Arrays.copyOf(consoleActions, consoleActions.length));
        toolbarActions.add((AnAction) new StopProcessAction("Stop process", "Stop process", (ProcessHandler) runHandler));
        toolbarActions.add((AnAction) new CloseAction(defaultExecutor, runDescriptor, project));

        consoleView.attachToProcess((ProcessHandler) runHandler);
//        ExecutionManager.getInstance(environment.getProject()).getContentManager().showRunContent(environment.getExecutor(), runDescriptor);
        showConsole(project, defaultExecutor, runDescriptor);
        return (ConsoleView) consoleView;
    }
 
Example #14
Source File: RNUpgradeAction.java    From react-native-console with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public boolean beforeAction() {
    String exePath = RNPathUtil.getExecuteFileFullPath(EXEC);

    if (exePath == null || EXEC.equals(RNPathUtil.getExecuteFileFullPath(EXEC))) {
        int options = Messages.showIdeaMessageDialog(getProject(),
                "Would you like to install " + EXEC + " globally now?\n" +
                        "This might take one or two minutes without any console update, please wait for the final result.\n" +
                        "After that, you'll need to click this button again.",
                "Can Not Found " + EXEC, new String[]{"Yes", "No"}, 0,
                AllIcons.General.QuestionDialog, new DialogWrapper.DoNotAskOption.Adapter() {
                    @Override
                    public void rememberChoice(boolean b, int i) {

                    }
                });
        if (options == 0) {
            cmd = INSTALL_CMD;
            return true;
        } else {
            RNConsole consoleView = terminal.getRNConsole(getText(), getIcon());

            if (consoleView != null) {
                consoleView.clear();
                consoleView.print(
                        "Can't found " + EXEC + ", if you were first running this command, make sure you have " + EXEC + " installed globally.\n" +
                                "To install, please run in terminal with command: \n" +
                                INSTALL_CMD +
                                "\n\n",
                        ConsoleViewContentType.ERROR_OUTPUT);

            }
            return false;
        }

    }

    cmd = EXEC;
    return true;
}
 
Example #15
Source File: LogView.java    From logviewer with Apache License 2.0 5 votes vote down vote up
/**
 * Returns an action that creates a gist
 */
private AnAction createGistAction() {
    return new AnAction("Share Log", "Share log using Gist", AllIcons.Actions.Share) {
        @Override
        public void actionPerformed(AnActionEvent anActionEvent) {
            gistCreator.createGist(myProject, myLogConsole.getSelectedText(true), LogView.this);
        }
    };
}
 
Example #16
Source File: TranslateQueryAction.java    From jetbrains-plugin-graph-database-support with Apache License 2.0 5 votes vote down vote up
@Override
protected void actionPerformed(AnActionEvent e, Project project, Editor editor, String query, Map<String, Object> parameters) {
    String gremlin = new OpenCypherGremlinSimpleTranslator().translate(query, parameters);

    JTextArea translation = new JTextArea(gremlin);
    translation.setEditable(false);
    translation.setLineWrap(true);

    JButton configure = new JButton("Configure/optimize translation");
    configure.addActionListener(v -> LandingPageAction.open());

    JBPopup popup = JBPopupFactory.getInstance().createComponentPopupBuilder(translation, null)
            .setAdText("Query translated using Cypher for Gremlin")
            .setSettingButtons(configure)
            .setCancelButton(new IconButton("Cancel", AllIcons.Actions.Cancel))
            .setRequestFocus(true)
            .setResizable(true)
            .setMovable(true)
            .setMinSize(new Dimension(200, 150))
            .createPopup();

    if (editor == null) {
        popup.showCenteredInCurrentWindow(project);
    } else {
        popup.showInBestPositionFor(editor);
    }
}
 
Example #17
Source File: CypherLineMarkerProvider.java    From jetbrains-plugin-graph-database-support with Apache License 2.0 5 votes vote down vote up
@Override
public LineMarkerInfo getLineMarkerInfo(@NotNull final PsiElement element) {
    PsiElement queryElement = PsiTraversalUtilities.Cypher.getCypherStatement(element);
    PsiElement lastQueryChild = isNull(queryElement) ? null : getFirstLeaf(queryElement);
    if (element == lastQueryChild) {
        return new LineMarkerInfo<PsiElement>(element,
                element.getTextRange(),
                AllIcons.Actions.Execute,
                element1 -> "Execute Query",
                (mouseEvent, psiElement) ->
                        getDataContext().ifPresent(c ->
                                ActionUtil.invokeAction(new ExecuteQueryAction(queryElement), c, "", mouseEvent, null)),
                GutterIconRenderer.Alignment.CENTER) {
            @Override
            public GutterIconRenderer createGutterRenderer() {
                return new LineMarkerGutterIconRenderer<PsiElement>(this) {
                    @Override
                    public AnAction getClickAction() {
                        return new ExecuteQueryAction(queryElement);
                    }

                    @Override
                    public boolean isNavigateAction() {
                        return true;
                    }
                };
            }
        };
    }
    return null;
}
 
Example #18
Source File: FlutterNewProjectAction.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
Icon getFlutterDecoratedIcon() {
  Icon icon = AllIcons.Welcome.CreateNewProject;
  Icon badgeIcon = new OffsetIcon(0, FlutterIcons.Flutter_badge).scale(0.666f);

  LayeredIcon decorated = new LayeredIcon(2);
  decorated.setIcon(badgeIcon, 0, 7, 7);
  decorated.setIcon(icon, 1, 0, 0);
  return decorated;
}
 
Example #19
Source File: PluginSettingForm.java    From ycy-intellij-plugin with GNU General Public License v3.0 5 votes vote down vote up
private void createUIComponents() {
    // place custom component creation code here
    this.remindTypeOptions = new ComboBox<>();
    for (ConfigState.RemindTypeEnum remindType : ConfigState.RemindTypeEnum.values()) {
        this.remindTypeOptions.addItem(remindType.description);
    }

    ConfigState configState = ConfigService.getInstance().getState();
    List<String> remindImages = configState.getRemindImages();
    this.pluginSettingTable = new PluginSettingTable(remindImages);
    this.imageUrlList = ToolbarDecorator.createDecorator(pluginSettingTable)
        /*
         * at version 1.5 fix a bug: 2020.1 版本 AllIcons.Actions.Reset_to_default 过时问题
         * see https://github.com/fantasticmao/ycy-intellij-plugin/issues/27
         */
        .addExtraAction(new AnActionButton("Reset", AllIcons.Actions.Rollback) {
            @Override
            public void actionPerformed(AnActionEvent e) {
                pluginSettingTable.resetTableList();
            }

            @Override
            public boolean isDumbAware() {
                return true; // 使用「后台更新」模式
            }
        })
        .createPanel();
}
 
Example #20
Source File: QuarkusCodeEndpointChooserStep.java    From intellij-quarkus with Eclipse Public License 2.0 5 votes vote down vote up
public JComponent getComponent() {
    ButtonGroup group = new ButtonGroup();
    group.add(this.defaultRadioButton);
    group.add(this.customRadioButton);
    ActionListener listener = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            QuarkusCodeEndpointChooserStep.this.updateCustomUrl();
        }
    };
    this.defaultRadioButton.addActionListener(listener);
    this.customRadioButton.addActionListener(listener);
    FormBuilder builder = new FormBuilder();
    builder.addComponent(new JBLabel("Choose Quarkus Code endpoint URL."));
    BorderLayoutPanel defaultPanel = JBUI.Panels.simplePanel(10, 0);
    defaultPanel.addToLeft(this.defaultRadioButton);
    HyperlinkLabel label = new HyperlinkLabel(QUARKUS_CODE_URL);
    label.setHyperlinkTarget(QUARKUS_CODE_URL);
    defaultPanel.addToCenter(label);
    builder.addComponent(defaultPanel);
    BorderLayoutPanel customPanel = JBUI.Panels.simplePanel(10, 0);
    customPanel.addToLeft(this.customRadioButton);
    this.customUrlWithBrowseButton.setButtonIcon(AllIcons.Actions.ShowViewer);
    customPanel.addToCenter(this.customUrlWithBrowseButton);
    builder.addComponent(customPanel);
    builder.addTooltip("Make sure your network connection is active before continuing.");
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(builder.getPanel(), "North");
    return panel;
}
 
Example #21
Source File: BuildFileRunLineMarkerContributor.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public Info getInfo(PsiElement element) {
  if (!enabled.getValue() || !isRunContext(element)) {
    return null;
  }
  AnAction[] actions = ExecutorAction.getActions();
  return new Info(
      AllIcons.RunConfigurations.TestState.Run,
      actions,
      psiElement ->
          StringUtil.join(
              ContainerUtil.mapNotNull(actions, action -> getText(action, psiElement)), "\n"));
}
 
Example #22
Source File: Suggestion.java    From component-runtime with Apache License 2.0 5 votes vote down vote up
private Icon findSubmit() {
    return Stream.of("SetDefault", "Submit1").flatMap(it -> {
        try {
            final Field declaredField = AllIcons.Actions.class.getField(it);
            return Stream.of(Icon.class.cast(declaredField.get(null)));
        } catch (final Exception e) {
            return Stream.empty();
        }
    }).findFirst().orElse(AllIcons.Actions.Forward);
}
 
Example #23
Source File: DartVmServiceValue.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private Icon getIcon() {
  if (myIsException) return AllIcons.Debugger.Db_exception_breakpoint;

  if (myFieldRef != null) {
    if (myFieldRef.isStatic() && (myFieldRef.isFinal() || myFieldRef.isConst())) {
      return STATIC_FINAL_FIELD_ICON;
    }
    if (myFieldRef.isStatic()) {
      return STATIC_FIELD_ICON;
    }
    if (myFieldRef.isFinal() || myFieldRef.isConst()) {
      return FINAL_FIELD_ICON;
    }
    return AllIcons.Nodes.Field;
  }

  final InstanceKind kind = myInstanceRef.getKind();

  if (kind == InstanceKind.Map || isListKind(kind)) return AllIcons.Debugger.Db_array;

  if (kind == InstanceKind.Null ||
      kind == InstanceKind.Bool ||
      kind == InstanceKind.Double ||
      kind == InstanceKind.Int ||
      kind == InstanceKind.String) {
    return AllIcons.Debugger.Db_primitive;
  }

  return AllIcons.Debugger.Value;
}
 
Example #24
Source File: HtmlTemplateLineUtil.java    From NutzCodeInsight with Apache License 2.0 5 votes vote down vote up
/**
 * 取得模版图标
 *
 * @param bindingElement
 * @return
 */
public static Icon getTemplateIcon(PsiElement bindingElement) {
    String path = getTemplateFilePathAndName(bindingElement);
    Iterator<String> iterable = resNames.iterator();
    while (iterable.hasNext()) {
        String fileExtension = iterable.next();
        if (path.endsWith(fileExtension)) {
            return IconUtil.getTemplateIcon(fileExtension);
        }
    }
    return AllIcons.FileTypes.Any_type;
}
 
Example #25
Source File: SkylarkExecutionStack.java    From intellij with Apache License 2.0 5 votes vote down vote up
private static Icon getThreadIcon(PausedThread threadInfo) {
  if (threadInfo.getPauseReason() == PauseReason.HIT_BREAKPOINT
      || threadInfo.getPauseReason() == PauseReason.CONDITIONAL_BREAKPOINT_ERROR) {
    return AllIcons.Debugger.ThreadAtBreakpoint;
  }
  return AllIcons.Debugger.ThreadSuspended;
}
 
Example #26
Source File: SqlsXml2JavaLineMarkerProvider.java    From NutzCodeInsight with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement psiElement) {
    try {
        if (SqlsXmlUtil.isSqsXmlFile(psiElement)) {
            Icon icon = AllIcons.FileTypes.Java;
            return new LineMarkerInfo<>(psiElement, psiElement.getTextRange(), icon,
                    new FunctionTooltip(), new Sqls2XmlNavigationHandler(),
                    GutterIconRenderer.Alignment.LEFT);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}
 
Example #27
Source File: CodeMakerConfiguration.java    From CodeMaker with Apache License 2.0 5 votes vote down vote up
private void addPlusTab() {
    tabbedPane.addTab("+", new JPanel());
    final JLabel addButton = new JLabel(AllIcons.Welcome.CreateNewProject);
    addButton.setToolTipText("Add New Template");
    addButton.addMouseListener(onMouseClick(e -> createNewTemplate()));
    final int index = tabbedPane.getTabCount() - 1;
    tabbedPane.setTabComponentAt(index, addButton);
    tabbedPane.setEnabledAt(index, false);
}
 
Example #28
Source File: CodeMakerConfiguration.java    From CodeMaker with Apache License 2.0 5 votes vote down vote up
private Component tabTitleComponent(final String title, final String templateKey) {
    return with(
        new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0)), p -> {
                p.add(with(new JLabel(title), t -> t.setOpaque(false)));
                p.setOpaque(false);
                p.add(with(new JLabel(AllIcons.Actions.Close), b  -> {
                    b.setOpaque(false);
                    b.setToolTipText("Delete Template");
                    b.addMouseListener(onMouseClick(e -> onDeleteClicked(title, templateKey)));
                }));
    });
}
 
Example #29
Source File: DirectoryWrapper.java    From PackageTemplates with Apache License 2.0 5 votes vote down vote up
@Override
public void buildView(Project project, JPanel container) {
    if (panel == null) {
        panel = new JPanel(new MigLayout(new LC().insets("0").gridGapY("2pt").fillX()));
    } else {
        panel.removeAll();
    }

    jlName = new JLabel(AllIcons.Nodes.Package, SwingConstants.LEFT);
    jlName.setDisabledIcon(jlName.getIcon());
    jlName.setText(Localizer.get("Directory"));

    etfDescription = UIHelper.getEditorTextField(getDirectory().getName(), project);
    addMouseListener();

    container.add(getOptionsPanel(), new CC().spanX().split(3));
    container.add(jlName, new CC().pad(0, 0, 0, UIHelper.PADDING_LABEL));
    container.add(etfDescription, new CC().growX().pushX().wrap());

    updateComponentsState();

    //Children
    if (!getListElementWrapper().isEmpty()) {
        for (ElementWrapper elementWrapper : getListElementWrapper()) {
            elementWrapper.buildView(project, panel);
        }

        UIHelper.setLeftPadding(panel, UIHelper.PADDING + UIHelper.DEFAULT_PADDING);
        container.add(panel, new CC().spanX().growX().pushX().wrap());
    }
}
 
Example #30
Source File: LaunchState.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
protected void showNoDeviceConnectedMessage(Project project) {
  Messages.showDialog(
    project,
    "No connected devices found; please connect a device, or see flutter.dev/setup for getting started instructions.",
    "No Connected Devices Found",
    new String[]{Messages.OK_BUTTON}, 0, AllIcons.General.InformationDialog);
}