use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.
the class XLightBreakpointPropertiesPanel method loadProperties.
public void loadProperties() {
mySubPanels.forEach(XBreakpointPropertiesSubPanel::loadProperties);
if (myConditionComboBox != null) {
XExpression condition = myBreakpoint.getConditionExpressionInt();
myConditionComboBox.setExpression(condition);
boolean hideCheckbox = !myShowAllOptions && condition == null;
myConditionEnabledCheckbox.setSelected(hideCheckbox || (myBreakpoint.isConditionEnabled() && condition != null));
myConditionEnabledPanel.removeAll();
if (hideCheckbox) {
JBLabel label = new JBLabel(XDebuggerBundle.message("xbreakpoints.condition.checkbox"));
label.setBorder(JBUI.Borders.empty(0, 4));
label.setLabelFor(myConditionComboBox.getComboBox());
myConditionEnabledPanel.add(label);
} else {
myConditionEnabledPanel.add(myConditionEnabledCheckbox);
}
onCheckboxChanged();
}
for (XBreakpointCustomPropertiesPanel customPanel : myCustomPanels) {
customPanel.loadFrom(myBreakpoint);
}
myEnabledCheckbox.setSelected(myBreakpoint.isEnabled());
myBreakpointNameLabel.setText(XBreakpointUtil.getShortText(myBreakpoint));
}
use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.
the class ExternalSystemTaskSettingsControl method fillUi.
@Override
public void fillUi(@NotNull final PaintAwarePanel canvas, int indentLevel) {
myProjectPathLabel = new JBLabel(ExternalSystemBundle.message("run.configuration.settings.label.project", myExternalSystemId.getReadableName()));
ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(myExternalSystemId);
FileChooserDescriptor projectPathChooserDescriptor = null;
if (manager instanceof ExternalSystemUiAware) {
projectPathChooserDescriptor = ((ExternalSystemUiAware) manager).getExternalProjectConfigDescriptor();
}
if (projectPathChooserDescriptor == null) {
projectPathChooserDescriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor();
}
String title = ExternalSystemBundle.message("settings.label.select.project", myExternalSystemId.getReadableName());
myProjectPathField = new ExternalProjectPathField(myProject, myExternalSystemId, projectPathChooserDescriptor, title) {
@Override
public Dimension getPreferredSize() {
return myVmOptionsEditor == null ? super.getPreferredSize() : myVmOptionsEditor.getTextField().getPreferredSize();
}
};
canvas.add(myProjectPathLabel, ExternalSystemUiUtil.getLabelConstraints(0));
canvas.add(myProjectPathField, ExternalSystemUiUtil.getFillLineConstraints(0));
myTasksLabel = new JBLabel(ExternalSystemBundle.message("run.configuration.settings.label.tasks"));
myTasksTextField = new EditorTextField("", myProject, PlainTextFileType.INSTANCE);
canvas.add(myTasksLabel, ExternalSystemUiUtil.getLabelConstraints(0));
GridBag c = ExternalSystemUiUtil.getFillLineConstraints(0);
c.insets.right = myProjectPathField.getButton().getPreferredSize().width + 8;
canvas.add(myTasksTextField, c);
new TaskCompletionProvider(myProject, myExternalSystemId, myProjectPathField).apply(myTasksTextField);
myVmOptionsLabel = new JBLabel(ExternalSystemBundle.message("run.configuration.settings.label.vmoptions"));
myVmOptionsEditor = new RawCommandLineEditor();
myVmOptionsEditor.setDialogCaption(ExternalSystemBundle.message("run.configuration.settings.label.vmoptions"));
canvas.add(myVmOptionsLabel, ExternalSystemUiUtil.getLabelConstraints(0));
canvas.add(myVmOptionsEditor, ExternalSystemUiUtil.getFillLineConstraints(0));
myArgumentsLabel = new JBLabel(ExternalSystemBundle.message("run.configuration.settings.label.arguments"));
myArgumentsEditor = new RawCommandLineEditor();
myArgumentsEditor.setDialogCaption(ExternalSystemBundle.message("run.configuration.settings.label.arguments"));
canvas.add(myArgumentsLabel, ExternalSystemUiUtil.getLabelConstraints(0));
canvas.add(myArgumentsEditor, ExternalSystemUiUtil.getFillLineConstraints(0));
}
use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.
the class DetailsPanel method rebuildCommitPanels.
private void rebuildCommitPanels(int[] selection) {
myEmptyText.setText("");
int selectionLength = selection.length;
// for each commit besides the first there are two components: Separator and CommitPanel
int existingCount = (myMainContentPanel.getComponentCount() + 1) / 2;
int requiredCount = Math.min(selectionLength, MAX_ROWS);
for (int i = existingCount; i < requiredCount; i++) {
if (i > 0) {
myMainContentPanel.add(new SeparatorComponent(0, OnePixelDivider.BACKGROUND, null));
}
myMainContentPanel.add(new CommitPanel(myLogData, myColorManager));
}
// clear superfluous items
while (myMainContentPanel.getComponentCount() > 2 * requiredCount - 1) {
myMainContentPanel.remove(myMainContentPanel.getComponentCount() - 1);
}
if (selectionLength > MAX_ROWS) {
myMainContentPanel.add(new SeparatorComponent(0, OnePixelDivider.BACKGROUND, null));
JBLabel label = new JBLabel("(showing " + MAX_ROWS + " of " + selectionLength + " selected commits)");
label.setFont(VcsHistoryUtil.getCommitDetailsFont());
label.setBorder(CommitPanel.getDetailsBorder());
myMainContentPanel.add(label);
}
mySelection = Ints.asList(Arrays.copyOf(selection, requiredCount));
repaint();
}
use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.
the class ReferencesPanel method createLabel.
@NotNull
protected JBLabel createLabel(@NotNull String text, @Nullable Icon icon) {
JBLabel label = new JBLabel(text, icon, SwingConstants.LEFT);
label.setFont(getLabelsFont());
label.setIconTextGap(0);
label.setHorizontalAlignment(SwingConstants.LEFT);
return label;
}
use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.
the class CreateClassDialog method createNorthPanel.
@Override
protected JComponent createNorthPanel() {
JPanel panel = new JPanel(new GridBagLayout());
GridBagConstraints gbConstraints = new GridBagConstraints();
gbConstraints.insets = JBUI.insets(4, 8);
gbConstraints.fill = GridBagConstraints.HORIZONTAL;
gbConstraints.anchor = GridBagConstraints.WEST;
if (myClassNameEditable) {
gbConstraints.weightx = 0;
gbConstraints.gridwidth = 1;
panel.add(myInformationLabel, gbConstraints);
gbConstraints.insets = JBUI.insets(4, 8);
gbConstraints.gridx = 1;
gbConstraints.weightx = 1;
gbConstraints.gridwidth = 1;
gbConstraints.fill = GridBagConstraints.HORIZONTAL;
gbConstraints.anchor = GridBagConstraints.WEST;
panel.add(myTfClassName, gbConstraints);
myTfClassName.getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
getOKAction().setEnabled(PsiNameHelper.getInstance(myProject).isIdentifier(myTfClassName.getText()));
}
});
getOKAction().setEnabled(StringUtil.isNotEmpty(myClassName));
}
gbConstraints.gridx = 0;
gbConstraints.gridy = 2;
gbConstraints.weightx = 0;
gbConstraints.gridwidth = 1;
panel.add(myPackageLabel, gbConstraints);
gbConstraints.gridx = 1;
gbConstraints.weightx = 1;
new AnAction() {
@Override
public void actionPerformed(AnActionEvent e) {
myPackageComponent.getButton().doClick();
}
}.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.SHIFT_DOWN_MASK)), myPackageComponent.getChildComponent());
JPanel _panel = new JPanel(new BorderLayout());
_panel.add(myPackageComponent, BorderLayout.CENTER);
panel.add(_panel, gbConstraints);
gbConstraints.gridy = 3;
gbConstraints.gridx = 0;
gbConstraints.gridwidth = 2;
gbConstraints.insets.top = 12;
gbConstraints.anchor = GridBagConstraints.WEST;
gbConstraints.fill = GridBagConstraints.NONE;
final JBLabel label = new JBLabel(RefactoringBundle.message("target.destination.folder"));
panel.add(label, gbConstraints);
gbConstraints.gridy = 4;
gbConstraints.gridx = 0;
gbConstraints.fill = GridBagConstraints.HORIZONTAL;
gbConstraints.insets.top = 4;
panel.add(myDestinationCB, gbConstraints);
final boolean isMultipleSourceRoots = JavaProjectRootsUtil.getSuitableDestinationSourceRoots(myProject).size() > 1;
myDestinationCB.setVisible(isMultipleSourceRoots);
label.setVisible(isMultipleSourceRoots);
label.setLabelFor(myDestinationCB);
return panel;
}
Aggregations