public EmojiCheckinHandler(CheckinProjectPanel checkinProjectPanel) { JPanel emojiPanel = new JPanel(); emojiPanel.setLayout(new VerticalFlowLayout()); VirtualFile emojirc = checkinProjectPanel.getProject().getBaseDir().findChild(".emojirc"); if (emojirc == null) return; PsiFile psiFile = PsiManager.getInstance(checkinProjectPanel.getProject()).findFile(emojirc); if (psiFile == null) return; for (PsiElement psiElement : psiFile.getChildren()) { if (!(psiElement instanceof EmojiResourceProperty)) continue; emojiPanel.add(createEmojiButton(psiElement.getFirstChild().getText(), psiElement.getLastChild().getText(), false, buttonGroup)); } emojiPanel.add(createEmojiButton(null, NO_EMOJI, true, buttonGroup)); Splitter splitter = (Splitter) checkinProjectPanel.getComponent(); CommitMessage commitMessage = (CommitMessage) splitter.getSecondComponent(); JComponent component = (JComponent) commitMessage.getComponent(1); JBScrollPane scrollPane = new JBScrollPane(emojiPanel); scrollPane.setBorder(null); Splitter commitSplitter = new Splitter(); commitSplitter.setFirstComponent(scrollPane); commitSplitter.setSecondComponent((JComponent) commitMessage.getComponent(0)); commitMessage.add(commitSplitter, 0); for (EmojiPanelFactory factory : factories) { factory.createPanel(commitMessage); } this.checkinProjectPanel = checkinProjectPanel; }
@Override protected JComponent createCenterPanel() { final JPanel panel = new JPanel(new BorderLayout(UIUtil.DEFAULT_HGAP, UIUtil.DEFAULT_VGAP)); myList = new JBList(myNamedElements); myList.setCellRenderer(new FQNameCellRenderer()); panel.add(ScrollPaneFactory.createScrollPane(myList), BorderLayout.CENTER); panel.add(new JBLabel(myContainsClassesOnly ? CodeInsightBundle.message("dialog.paste.on.import.text") : CodeInsightBundle.message("dialog.paste.on.import.text2"), SMALL, BRIGHTER), BorderLayout.NORTH); final JPanel buttonPanel = new JPanel(new VerticalFlowLayout()); final JButton okButton = new JButton(CommonBundle.getOkButtonText()); getRootPane().setDefaultButton(okButton); buttonPanel.add(okButton); final JButton cancelButton = new JButton(CommonBundle.getCancelButtonText()); buttonPanel.add(cancelButton); panel.setPreferredSize(JBUI.size(500, 400)); return panel; }
@Nullable private JPanel createParametersPanel () { myThisClassesMap = MoveInstanceMembersUtil.getThisClassesToMembers(myMethod); myOldClassParameterNameFields = new HashMap<PsiClass, EditorTextField>(); if (myThisClassesMap.size() == 0) return null; JPanel panel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, true)); for (PsiClass aClass : myThisClassesMap.keySet()) { final String text = RefactoringBundle.message("move.method.this.parameter.label", aClass.getName()); panel.add(new TitledSeparator(text, null)); String suggestedName = MoveInstanceMethodHandler.suggestParameterNameForThisClass(aClass); final EditorTextField field = new EditorTextField(suggestedName, getProject(), StdFileTypes.JAVA); field.setMinimumSize(new Dimension(field.getPreferredSize())); myOldClassParameterNameFields.put(aClass, field); panel.add(field); } panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0)); return panel; }
public ArtifactPropertiesEditors(ArtifactEditorContext context, Artifact originalArtifact, Artifact artifact) { myContext = context; myOriginalArtifact = originalArtifact; myMainPanels = new HashMap<String, JPanel>(); myEditors = new ArrayList<PropertiesEditorInfo>(); for (ArtifactPropertiesProvider provider : artifact.getPropertiesProviders()) { final PropertiesEditorInfo editorInfo = new PropertiesEditorInfo(provider); myEditors.add(editorInfo); final String tabName = editorInfo.myEditor.getTabName(); JPanel panel = myMainPanels.get(tabName); if (panel == null) { panel = new JPanel(new VerticalFlowLayout()); myMainPanels.put(tabName, panel); } panel.add(editorInfo.myEditor.createComponent()); } }
private IdSetPanel() { setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, GAP, true, false)); add(myTitleLabel); add(myContentPanel); JPanel buttonPanel = new JPanel(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.insets.right = 25; gbc.gridy = 0; buttonPanel.add(mySaveButton, gbc); buttonPanel.add(new LinkLabel<String>("Enable All", null, this, "enable"), gbc); buttonPanel.add(new LinkLabel<String>("Disable All", null, this, "disable"), gbc); gbc.weightx = 1; buttonPanel.add(Box.createHorizontalGlue(), gbc); add(buttonPanel); mySaveButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { myCardLayout.show(CustomizePluginsStepPanel.this, MAIN); setButtonsVisible(true); } }); }
@Override protected JComponent createSouthPanel() { JPanel panel = new JPanel(new GridBagLayout()); customizeOptionsPanel(); JPanel optionsPanel = new JPanel(new VerticalFlowLayout()); for (final JComponent component : myOptionControls) { optionsPanel.add(component); } panel.add( optionsPanel, new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0) ); if (!myAllowEmptySelection && (myElements == null || myElements.length == 0)) { setOKActionEnabled(false); } panel.add( super.createSouthPanel(), new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.SOUTH, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0) ); return panel; }
@Override protected JComponent createViewPanel() { final JPanel mainPanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, true, false)); mainPanel.setBackground(IpnbEditorUtil.getBackground()); myCodeSourcePanel = new IpnbCodeSourcePanel(myProject, this, myCell); final JPanel panel = new JPanel(new GridBagLayout()); panel.setBackground(IpnbEditorUtil.getBackground()); addPromptPanel(panel, myCell.getPromptNumber(), IpnbEditorUtil.PromptType.In, myCodeSourcePanel); mainPanel.add(panel); for (IpnbOutputCell outputCell : myCell.getCellOutputs()) { addOutputPanel(mainPanel, outputCell, true); } return mainPanel; }
@Override @Nullable protected JPanel createAdvancedSettings() { JComponent advancedSettings = null; if (myProjectGenerator instanceof PythonProjectGenerator) advancedSettings = ((PythonProjectGenerator)myProjectGenerator).getSettingsPanel(myProjectDirectory); else if (myProjectGenerator instanceof WebProjectTemplate) { advancedSettings = ((WebProjectTemplate)myProjectGenerator).getPeer().getComponent(); } if (advancedSettings != null) { final JPanel jPanel = new JPanel(new VerticalFlowLayout()); final HideableDecorator deco = new HideableDecorator(jPanel, "Mor&e Settings", false); boolean isValid = checkValid(); deco.setOn(!isValid); if (myProjectGenerator instanceof PythonProjectGenerator && !deco.isExpanded()) { final ValidationResult result = ((PythonProjectGenerator)myProjectGenerator).warningValidation(getSdk()); deco.setOn(!result.isOk()); } deco.setContentComponent(advancedSettings); return jPanel; } return null; }
@Override JComponent getComponent() { myComboBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { applyEditors(); } }); myComboBox.setRenderer(new ListCellRendererWrapper() { @Override public void customize(JList list, Object value, int index, boolean selected, boolean hasFocus) { if (value instanceof ResourceEnum) { setText(((ResourceEnum)value).getShortDisplayValue()); } } }); final JPanel panel = new JPanel(new VerticalFlowLayout()); final JBLabel label = new JBLabel(getCaption()); label.setLabelFor(myComboBox); myComboBox.setModel(createModel()); panel.add(label); panel.add(myComboBox); return panel; }
public StatisticsPanel() { super(new BorderLayout(0, 0)); myChildInfo = new StatisticsTable(TestColumnInfo.COLUMN_NAMES); myTable = new TableView(myChildInfo) { @Override public TableCellRenderer getCellRenderer(int row, int column) { return new TestTableRenderer(TestColumnInfo.COLUMN_NAMES); } }; EditSourceOnDoubleClickHandler.install(myTable); PopupHandler.installPopupHandler(myTable, IdeActions.GROUP_TESTSTATISTICS_POPUP, ActionPlaces.TESTSTATISTICS_VIEW_POPUP); // add(myTestCaseInfo, BorderLayout.NORTH); add(ScrollPaneFactory.createScrollPane(myTable), BorderLayout.CENTER); final JPanel eastPanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false)); myTotalLabel = new SimpleColoredComponent(); eastPanel.add(myTotalLabel); myTimeLabel = new SimpleColoredComponent(); eastPanel.add(myTimeLabel); add(eastPanel, BorderLayout.SOUTH); }
@Override protected JComponent createCenterPanel() { JPanel north = new JPanel(); north.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, true)); final JPanel namePanel = createNamePanel(); namePanel.setAlignmentX(Component.LEFT_ALIGNMENT); north.add(namePanel); createCheckBoxes(north); myGetterPanel = createFieldPanel(); myGetterPanel.setAlignmentX(Component.LEFT_ALIGNMENT); north.add(myGetterPanel); final JPanel root = new JPanel(new BorderLayout()); mySignaturePanel = createSignaturePanel(); root.add(mySignaturePanel, BorderLayout.CENTER); root.add(north, BorderLayout.NORTH); return root; }
private void createErrorCard() { myErrorPanel = new JPanel(new BorderLayout()); myErrorMessages = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 10, 5, true, false)); myErrorPanel.add(myErrorMessages, BorderLayout.PAGE_START); myErrorStack = new JTextArea(50, 20); myErrorStack.setEditable(false); myErrorStackLayout = new CardLayout(); myErrorStackPanel = new JPanel(myErrorStackLayout); myErrorStackPanel.add(new JLabel(), ERROR_NO_STACK_CARD); myErrorStackPanel.add(ScrollPaneFactory.createScrollPane(myErrorStack), ERROR_STACK_CARD); myErrorPanel.add(myErrorStackPanel, BorderLayout.CENTER); myPanel.add(myErrorPanel, ERROR_CARD); }
@Override protected JComponent createCenterPanel() { final JPanel panel = new JPanel(new BorderLayout(UIUtil.DEFAULT_HGAP, UIUtil.DEFAULT_VGAP)); myList = new JBList(myNamedElements); myList.setCellRenderer(new FQNameCellRenderer()); panel.add(ScrollPaneFactory.createScrollPane(myList), BorderLayout.CENTER); panel.add(new JBLabel(myContainsClassesOnly ? CodeInsightBundle.message("dialog.paste.on.import.text") : CodeInsightBundle.message("dialog.paste.on.import.text2"), SMALL, BRIGHTER), BorderLayout.NORTH); final JPanel buttonPanel = new JPanel(new VerticalFlowLayout()); final JButton okButton = new JButton(CommonBundle.getOkButtonText()); getRootPane().setDefaultButton(okButton); buttonPanel.add(okButton); final JButton cancelButton = new JButton(CommonBundle.getCancelButtonText()); buttonPanel.add(cancelButton); panel.setPreferredSize(new Dimension(500, 400)); return panel; }
@Override protected JComponent createSouthPanel() { JPanel panel = new JPanel(new GridBagLayout()); customizeOptionsPanel(); JPanel optionsPanel = new JPanel(new VerticalFlowLayout()); for (final JComponent component : myOptionControls) { optionsPanel.add(component); } panel.add( optionsPanel, new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0) ); if (myElements == null || myElements.length == 0) { setOKActionEnabled(false); } panel.add( super.createSouthPanel(), new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.SOUTH, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0) ); return panel; }
@Override protected JComponent createCenterPanel() { final JPanel panel = new JPanel(new BorderLayout(UIUtil.DEFAULT_HGAP, UIUtil.DEFAULT_VGAP)); myList = new JBList((Object[])myNamedElements); myList.setCellRenderer(new FQNameCellRenderer()); panel.add(ScrollPaneFactory.createScrollPane(myList), BorderLayout.CENTER); panel.add(new JBLabel(CodeInsightBundle.message("dialog.paste.on.import.text"), SMALL, BRIGHTER), BorderLayout.NORTH); final JPanel buttonPanel = new JPanel(new VerticalFlowLayout()); final JButton okButton = new JButton(CommonBundle.getOkButtonText()); getRootPane().setDefaultButton(okButton); buttonPanel.add(okButton); final JButton cancelButton = new JButton(CommonBundle.getCancelButtonText()); buttonPanel.add(cancelButton); panel.setPreferredSize(new Dimension(500, 400)); return panel; }
@NotNull @Override protected JComponent createEditor() { JPanel verticalLayout = new JPanel(new VerticalFlowLayout(0, 0)); ProjectSdksModel model = new ProjectSdksModel(); model.reset(); myBundleBox = new SdkComboBox(model, Conditions.equalTo(myBundleType), true); verticalLayout.add(LabeledComponent.left(myBundleBox, J2EEBundle.message("label.run.configuration.properties.application.server"))); JPanel openBrowserPanel = new JPanel(); openBrowserPanel.setBorder(IdeBorderFactory.createTitledBorder("Open browser")); verticalLayout.add(openBrowserPanel); if(myBundleType.isJreCustomizable()) { AlternativeJREPanel panel = new AlternativeJREPanel(); verticalLayout.add(panel); } verticalLayout.add(mySettingsWrapper); return verticalLayout; }
public CommitPanel(@Nonnull VcsLogData logData, @Nonnull VcsLogColorManager colorManager) { myLogData = logData; myColorManager = colorManager; setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false)); setOpaque(false); myRootPanel = new RootPanel(); myBranchesPanel = new ReferencesPanel(); myBranchesPanel.setBorder(JBUI.Borders.empty(REFERENCES_BORDER, 0, 0, 0)); myTagsPanel = new ReferencesPanel(); myTagsPanel.setBorder(JBUI.Borders.empty(REFERENCES_BORDER, 0, 0, 0)); myDataPanel = new DataPanel(myLogData.getProject()); myContainingBranchesPanel = new BranchesPanel(); add(myRootPanel); add(myDataPanel); add(myBranchesPanel); add(myTagsPanel); add(myContainingBranchesPanel); setBorder(getDetailsBorder()); }
private void showFolderField(final ConfigurationType type, final DefaultMutableTreeNode node, final String folderName) { myRightPanel.removeAll(); JPanel panel = new JPanel(new VerticalFlowLayout(0, 0)); final JTextField textField = new JTextField(folderName); textField.getDocument().addDocumentListener(new DocumentAdapter() { @Override protected void textChanged(DocumentEvent e) { node.setUserObject(textField.getText()); myTreeModel.reload(node); } }); panel.add(LabeledComponent.left(textField, "Folder name")); panel.add(new JLabel(ExecutionBundle.message("run.configuration.rename.folder.disclaimer"))); myRightPanel.add(panel); myRightPanel.revalidate(); myRightPanel.repaint(); if (isFolderCreating) { textField.selectAll(); IdeFocusManager.getGlobalInstance().doForceFocusWhenFocusSettlesDown(textField); } }
@Nullable private JPanel createParametersPanel () { myThisClassesMap = MoveInstanceMembersUtil.getThisClassesToMembers(myMethod); myOldClassParameterNameFields = new HashMap<PsiClass, EditorTextField>(); if (myThisClassesMap.size() == 0) return null; JPanel panel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, true)); for (PsiClass aClass : myThisClassesMap.keySet()) { final String text = RefactoringBundle.message("move.method.this.parameter.label", aClass.getName()); panel.add(new TitledSeparator(text, null)); String suggestedName = MoveInstanceMethodHandler.suggestParameterNameForThisClass(aClass); final EditorTextField field = new EditorTextField(suggestedName, getProject(), JavaFileType.INSTANCE); field.setMinimumSize(new Dimension(field.getPreferredSize())); myOldClassParameterNameFields.put(aClass, field); panel.add(field); } panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0)); return panel; }
public StudyNewProjectPanel(@NotNull final StudyProjectGenerator generator, boolean isLocal) { super(new VerticalFlowLayout(true, true)); myGenerator = generator; this.isLocal = isLocal; layoutPanel(); initListeners(); }
public KotlinTwitterDialogPanel(@NotNull Task solvedTask) { setLayout(new VerticalFlowLayout()); myRemainSymbolsLabel = new JLabel(); myTwitterTextField = new JTextArea(); myTwitterTextField.setLineWrap(true); create(solvedTask); }
@Override protected JComponent getAdditionalActionSettings(Project project, BaseAnalysisActionDialog dialog) { final JPanel panel = new JPanel(new VerticalFlowLayout()); panel.add(new TitledSeparator()); myAnnotateLocalVariablesCb = new JCheckBox("Annotate local variables", PropertiesComponent.getInstance().getBoolean(ANNOTATE_LOCAL_VARIABLES)); panel.add(myAnnotateLocalVariablesCb); return panel; }
public FrameworkVersionComponent(final FrameworkSupportModelBase model, final String frameworkOrGroupId, final List<? extends FrameworkVersion> versions_, String labelText) { myModel = model; myAllVersions = versions_; myMainPanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 3, true, false)); myFrameworkOrGroupId = frameworkOrGroupId; myVersionsBox = new ComboBox(); myVersionsBox.setRenderer(new ListCellRendererWrapper<FrameworkVersion>() { @Override public void customize(JList list, FrameworkVersion value, int index, boolean selected, boolean hasFocus) { setText(value != null ? value.getPresentableName() : ""); } }); myVersionsBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { FrameworkVersion selectedVersion = getSelectedVersion(); if (selectedVersion != null) { model.setSelectedVersion(frameworkOrGroupId, selectedVersion); } } }); myVersionsPanel = FormBuilder.createFormBuilder().setHorizontalGap(5).addLabeledComponent(labelText, myVersionsBox).getPanel(); myMainPanel.add(myVersionsPanel); updateVersionsList(); }
public JComponent createComponent() { JPanel panel = new JPanel(new VerticalFlowLayout()); for (UnnamedConfigurable configurable : myConfigurables) { panel.add(configurable.createComponent()); } return panel; }
protected RecentProjectItemRenderer(UniqueNameBuilder<ReopenProjectAction> pathShortener) { super(new VerticalFlowLayout()); myShortener = pathShortener; myPath.setFont(JBUI.Fonts.label(SystemInfo.isMac ? 10f : 11f)); setFocusable(true); layoutComponents(); }
public static JPanel createLabeledPanel(String labelText, JComponent component) { final JPanel panel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 4, 2, true, false)); final JBLabel label = new JBLabel(labelText, UIUtil.ComponentStyle.SMALL); IJSwingUtilities.adjustComponentsOnMac(label, component); panel.add(label); panel.add(component); return panel; }
@Override protected JComponent createSouthPanel() { final JComponent buttons = super.createSouthPanel(); if (!myShowFilePath) return buttons; final JPanel panel = new JPanel(new VerticalFlowLayout()); panel.add(myPathPanel); panel.add(buttons); return panel; }
@NotNull static JPanel createPanel(boolean isUseTitledBorder) { int verticalGap = TitledSeparator.TOP_INSET; JPanel panel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, isUseTitledBorder ? 0 : verticalGap, true, true)); // VerticalFlowLayout incorrectly use vertical gap as top inset if (!isUseTitledBorder) { panel.setBorder(new EmptyBorder(-verticalGap, 0, 0, 0)); } return panel; }
private RemoveInvalidElementsDialog(final String title, ConfigurationErrorType type, String invalidElements, final Project project, List<ConfigurationErrorDescription> errors) { super(project, true); setTitle(title); myDescriptionLabel.setText(ProjectBundle.message(type.canIgnore() ? "label.text.0.cannot.be.loaded.ignore" : "label.text.0.cannot.be.loaded.remove", invalidElements)); myContentPanel.setLayout(new VerticalFlowLayout()); for (ConfigurationErrorDescription error : errors) { JCheckBox checkBox = new JCheckBox(error.getElementName() + "."); checkBox.setSelected(true); myCheckboxes.put(checkBox, error); JPanel panel = new JPanel(new GridBagLayout()); GridBagConstraints constraints = new GridBagConstraints(); constraints.anchor = GridBagConstraints.NORTHWEST; constraints.ipadx = 5; panel.add(checkBox, constraints); constraints.anchor = GridBagConstraints.NORTHWEST; constraints.insets.top = 5; panel.add(new JLabel(XmlStringUtil.wrapInHtml(StringUtil.replace(error.getDescription(), "\n", "<br>"))), constraints); constraints.weightx = 1; panel.add(new JPanel(), constraints); myContentPanel.add(panel); } init(); setOKButtonText(ProjectBundle.message(type.canIgnore() ? "button.text.ignore.selected" : "button.text.remove.selected")); setCancelButtonText(ProjectBundle.message("button.text.keep.all")); }
public CommonProgramParametersPanel(boolean init) { super(); setLayout(new VerticalFlowLayout(VerticalFlowLayout.MIDDLE, 0, 5, true, false)); if (init) { init(); } }
public MnemonicChooser() { super(new VerticalFlowLayout()); JPanel numbers = new NonOpaquePanel(new GridLayout(2, 5, 2, 2)); for (char i = '1'; i <= '9'; i++) { numbers.add(new MnemonicLabel(i)); } numbers.add(new MnemonicLabel('0')); JPanel letters = new NonOpaquePanel(new GridLayout(5, 6, 2, 2)); for (char c = 'A'; c <= 'Z'; c++) { letters.add(new MnemonicLabel(c)); } add(numbers); add(new JSeparator()); add(letters); setBackground(UIUtil.getListBackground()); addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { onCancelled(); } else if (e.getModifiersEx() == 0) { final char typed = Character.toUpperCase(e.getKeyChar()); if (typed >= '0' && typed <= '9' || typed >= 'A' && typed <= 'Z') { onMnemonicChosen(typed); } } } }); setFocusable(true); }