use of com.intellij.ui.components.JBCheckBox in project intellij-community by JetBrains.
the class GithubRepositoryEditor method createCustomPanel.
@Nullable
@Override
protected JComponent createCustomPanel() {
myHostLabel = new JBLabel("Host:", SwingConstants.RIGHT);
JPanel myHostPanel = new JPanel(new BorderLayout(5, 0));
myHostPanel.add(myURLText, BorderLayout.CENTER);
myHostPanel.add(myShareUrlCheckBox, BorderLayout.EAST);
myRepositoryLabel = new JBLabel("Repository:", SwingConstants.RIGHT);
myRepoAuthor = new MyTextField("Repository Owner");
myRepoName = new MyTextField("Repository Name");
myRepoAuthor.setPreferredSize("SomelongNickname");
myRepoName.setPreferredSize("SomelongReponame-with-suffixes");
JPanel myRepoPanel = new JPanel(new GridBagLayout());
GridBag bag = new GridBag().setDefaultWeightX(1).setDefaultFill(GridBagConstraints.HORIZONTAL);
myRepoPanel.add(myRepoAuthor, bag.nextLine().next());
myRepoPanel.add(new JLabel("/"), bag.next().fillCellNone().insets(0, 5, 0, 5).weightx(0));
myRepoPanel.add(myRepoName, bag.next());
myTokenLabel = new JBLabel("API Token:", SwingConstants.RIGHT);
myToken = new MyTextField("OAuth2 token");
myTokenButton = new JButton("Create API token");
myTokenButton.addActionListener(e -> {
generateToken();
doApply();
});
JPanel myTokenPanel = new JPanel();
myTokenPanel.setLayout(new BorderLayout(5, 5));
myTokenPanel.add(myToken, BorderLayout.CENTER);
myTokenPanel.add(myTokenButton, BorderLayout.EAST);
myShowNotAssignedIssues = new JBCheckBox("Include issues not assigned to me");
installListener(myRepoAuthor);
installListener(myRepoName);
installListener(myToken);
installListener(myShowNotAssignedIssues);
return FormBuilder.createFormBuilder().setAlignLabelOnRight(true).addLabeledComponent(myHostLabel, myHostPanel).addLabeledComponent(myRepositoryLabel, myRepoPanel).addLabeledComponent(myTokenLabel, myTokenPanel).addComponentToRightColumn(myShowNotAssignedIssues).getPanel();
}
use of com.intellij.ui.components.JBCheckBox in project intellij-community by JetBrains.
the class IdeaGradleSystemSettingsControlBuilder method fillUi.
@Override
public void fillUi(@NotNull PaintAwarePanel canvas, int indentLevel) {
if (!dropOfflineModeBox) {
myOfflineModeBox = new JBCheckBox(GradleBundle.message("gradle.settings.text.offline_work"));
canvas.add(myOfflineModeBox, ExternalSystemUiUtil.getFillLineConstraints(indentLevel));
}
addServiceDirectoryControl(canvas, indentLevel);
if (!dropVmOptions) {
myGradleVmOptionsLabel = new JBLabel(GradleBundle.message("gradle.settings.text.vm.options"));
canvas.add(myGradleVmOptionsLabel, ExternalSystemUiUtil.getLabelConstraints(indentLevel));
myGradleVmOptionsField = new JBTextField();
canvas.add(myGradleVmOptionsField, ExternalSystemUiUtil.getFillLineConstraints(indentLevel));
}
}
use of com.intellij.ui.components.JBCheckBox in project intellij-community by JetBrains.
the class ParameterNameHintsConfigurable method createOptionsPanel.
@Nullable
private JPanel createOptionsPanel(@NotNull Language language) {
List<Option> options = getOptions(language);
if (options.isEmpty()) {
return null;
}
JPanel languageOptionsPanel = new JPanel();
BoxLayout boxLayout = new BoxLayout(languageOptionsPanel, BoxLayout.Y_AXIS);
languageOptionsPanel.setLayout(boxLayout);
if (!options.isEmpty()) {
languageOptionsPanel.setBorder(IdeBorderFactory.createTitledBorder("Options"));
}
for (Option option : options) {
JBCheckBox box = new JBCheckBox(option.getName(), option.get());
myOptions.put(option, box);
languageOptionsPanel.add(box);
}
return languageOptionsPanel;
}
use of com.intellij.ui.components.JBCheckBox in project intellij-community by JetBrains.
the class ProjectStartupConfigurable method installRenderers.
private void installRenderers() {
final TableColumn checkboxColumn = myTable.getColumnModel().getColumn(ProjectStartupTasksTableModel.IS_SHARED_COLUMN);
final String header = checkboxColumn.getHeaderValue().toString();
final FontMetrics fm = myTable.getFontMetrics(myTable.getTableHeader().getFont());
final int width = -new JBCheckBox().getPreferredSize().width + fm.stringWidth(header + "ww");
TableUtil.setupCheckboxColumn(checkboxColumn, width);
checkboxColumn.setCellRenderer(new BooleanTableCellRenderer());
myTable.getTableHeader().setResizingAllowed(false);
myTable.getTableHeader().setReorderingAllowed(false);
final TableColumn nameColumn = myTable.getColumnModel().getColumn(ProjectStartupTasksTableModel.NAME_COLUMN);
nameColumn.setCellRenderer(new ColoredTableCellRenderer() {
@Override
protected void customizeCellRenderer(JTable table, @Nullable Object value, boolean selected, boolean hasFocus, int row, int column) {
final RunnerAndConfigurationSettings settings = myModel.getAllConfigurations().get(row);
setIcon(settings.getConfiguration().getIcon());
append(settings.getName());
}
});
}
use of com.intellij.ui.components.JBCheckBox in project intellij-plugins by JetBrains.
the class PhoneGapRunConfigurationEditor method createEditor.
@NotNull
@Override
protected JComponent createEditor() {
myExecutablePathField = PhoneGapUtil.createPhoneGapExecutableTextField(myProject);
myWorkDirField = PhoneGapUtil.createPhoneGapWorkingDirectoryField(myProject);
myPlatformField = new ComboBoxWithMoreOption(getDefaultPlatforms(), getNonDefaultPlatforms());
myCommand = new ComboBox();
myEnvComponent = new EnvironmentVariablesTextFieldWithBrowseButton();
myEnvComponent.setPassParentEnvs(true);
myHasTarget = new JBCheckBox("Specify target");
myTarget = new PhoneGapTargetsPanel();
myExtraArgsTextField = new JBTextField(15);
myCommand.setMinimumAndPreferredWidth(200);
myPlatformField.setMinimumAndPreferredWidth(200);
myTarget.getTargetsField().setMinimumAndPreferredWidth(myPlatformField.getPreferredSize().width);
myTarget.setDataProvider(new ReloadableComboBoxPanel.DataProvider<String>() {
@NotNull
@Override
public Set<String> getCachedValues() {
return ContainerUtil.newHashOrEmptySet(null);
}
@Override
public void updateValuesAsynchronously() {
if (!myTarget.isEnabled()) {
processEmpty();
return;
}
final String platform = getPlatformAsCodeFromField();
final String command = (String) myCommand.getSelectedItem();
final PhoneGapTargets targetsProvider = PhoneGapTargets.createTargetsList(myProject, platform);
if (targetsProvider == null) {
processEmpty();
return;
}
ApplicationManager.getApplication().executeOnPooledThread(() -> {
final String currentText = myTarget.getTargetsField().getText();
final Set<String> targets = ContainerUtil.newLinkedHashSet(PhoneGapTargets.listTargets(targetsProvider, command));
if (!StringUtil.isEmpty(currentText) && !targets.contains(currentText)) {
targets.add(currentText);
}
UIUtil.invokeLaterIfNeeded(() -> myTarget.onUpdateValues(targets));
});
}
private void processEmpty() {
myTarget.onUpdateValues(ContainerUtil.newHashOrEmptySet(null));
}
});
setListenerForPlatforms();
setListenerForCommand();
setListenerForHasTarget();
setListenerForExecutablePath();
setCommandList();
return FormBuilder.createFormBuilder().addLabeledComponent(PhoneGapBundle.message("phonegap.conf.executable.name"), myExecutablePathField).addLabeledComponent(PhoneGapBundle.message("phonegap.conf.work.dir.name"), myWorkDirField).addLabeledComponent(ExecutionBundle.message("environment.variables.component.title"), myEnvComponent).addLabeledComponent("Command:", myCommand).addLabeledComponent("Platform:", myPlatformField).addLabeledComponent(PhoneGapBundle.message("phonegap.conf.extra.args.name"), myExtraArgsTextField).addLabeledComponent(myHasTarget, myTarget.getMainPanel()).getPanel();
}
Aggregations