com.intellij.openapi.ui.LabeledComponent Java Examples

The following examples show how to use com.intellij.openapi.ui.LabeledComponent. 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: GenerateDialog.java    From android-parcelable-intellij-plugin with Apache License 2.0 6 votes vote down vote up
protected GenerateDialog(final PsiClass psiClass) {
    super(psiClass.getProject());
    setTitle("Select Fields for Parcelable Generation");

    fieldsCollection = new CollectionListModel<PsiField>();
    final JBList fieldList = new JBList(fieldsCollection);
    fieldList.setCellRenderer(new DefaultPsiElementCellRenderer());
    final ToolbarDecorator decorator = ToolbarDecorator.createDecorator(fieldList).disableAddAction();
    final JPanel panel = decorator.createPanel();

    fieldsComponent = LabeledComponent.create(panel, "Fields to include in Parcelable");

    includeSubclasses = new JBCheckBox("Include fields from base classes");
    setupCheckboxClickAction(psiClass);
    showCheckbox = psiClass.getFields().length != psiClass.getAllFields().length;

    updateFieldsDisplay(psiClass);
    init();
}
 
Example #2
Source File: RunConfigurable.java    From consulo with Apache License 2.0 6 votes vote down vote up
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);
  }
}
 
Example #3
Source File: CommonProgramParametersPanel.java    From consulo with Apache License 2.0 6 votes vote down vote up
protected void initComponents() {
  myProgramParametersComponent = LabeledComponent.create(new RawCommandLineEditor(), ExecutionBundle.message("run.configuration.program.parameters"));

  FileChooserDescriptor fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  //noinspection DialogTitleCapitalization
  fileChooserDescriptor.setTitle(ExecutionBundle.message("select.working.directory.message"));
  myWorkingDirectoryComboBox = new MacroComboBoxWithBrowseButton(fileChooserDescriptor, getProject());

  myWorkingDirectoryComponent = LabeledComponent.create(myWorkingDirectoryComboBox, ExecutionBundle.message("run.configuration.working.directory.label"));
  myEnvVariablesComponent = new EnvironmentVariablesComponent();

  myEnvVariablesComponent.setLabelLocation(BorderLayout.WEST);
  myProgramParametersComponent.setLabelLocation(BorderLayout.WEST);
  myWorkingDirectoryComponent.setLabelLocation(BorderLayout.WEST);

  addComponents();

  setPreferredSize(new Dimension(10, 10));

  copyDialogCaption(myProgramParametersComponent);
}
 
Example #4
Source File: EditTestsDialog.java    From JHelper with GNU Lesser General Public License v3.0 6 votes vote down vote up
private JPanel generateTestPanel() {
	JPanel testPanel = new JPanel(new GridLayout(2, 1, GRID_LAYOUT_GAP, GRID_LAYOUT_GAP));

	input = generateSavingTextArea();
	JPanel inputPanel = LabeledComponent.create(new JBScrollPane(input), "Input");

	output = generateSavingTextArea();
	outputPanel = LabeledComponent.create(new JBScrollPane(output), "Output");

	knowAnswer = new JCheckBox("Know answer?");
	knowAnswer.addActionListener(e -> saveCurrentTest());
	JPanel outputAndCheckBoxPanel = new JPanel(new BorderLayout());
	outputAndCheckBoxPanel.add(knowAnswer, BorderLayout.NORTH);
	outputAndCheckBoxPanel.add(outputPanel, BorderLayout.CENTER);
	testPanel.add(inputPanel);
	testPanel.add(outputAndCheckBoxPanel);
	return testPanel;
}
 
Example #5
Source File: ArtifactConfigurable.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
protected JComponent createTopRightComponent(final JTextField nameField) {
  final ComboBox artifactTypeBox = new ComboBox();
  for (ArtifactType type : ArtifactType.EP_NAME.getExtensions()) {
    artifactTypeBox.addItem(type);
  }

  artifactTypeBox.setRenderer(new ArtifactTypeCellRenderer());

  artifactTypeBox.setSelectedItem(getArtifact().getArtifactType());
  artifactTypeBox.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      final ArtifactType selected = (ArtifactType)artifactTypeBox.getSelectedItem();
      if (selected != null && !Comparing.equal(selected, getArtifact().getArtifactType())) {
        getEditor().setArtifactType(selected);
      }
    }
  });

  return LabeledComponent.left(artifactTypeBox, "Type");
}
 
Example #6
Source File: ProjectSettingsPanel.java    From consulo with Apache License 2.0 6 votes vote down vote up
public JComponent getMainComponent() {
  final JPanel panel = new JPanel(new BorderLayout(0, 10));
  final LabeledComponent<JComboBox> component = new LabeledComponent<JComboBox>();
  component.setText("Default &project copyright:");
  component.setLabelLocation(BorderLayout.WEST);
  component.setComponent(myProfilesComboBox);
  panel.add(component, BorderLayout.NORTH);
  ElementProducer<ScopeSetting> producer = new ElementProducer<ScopeSetting>() {
    @Override
    public ScopeSetting createElement() {
      return new ScopeSetting(DefaultScopesProvider.getAllScope(), myProfilesModel.getAllProfiles().values().iterator().next());
    }

    @Override
    public boolean canCreateElement() {
      return !myProfilesModel.getAllProfiles().isEmpty();
    }
  };
  ToolbarDecorator decorator = ToolbarDecorator.createDecorator(myScopeMappingTable, producer);
  panel.add(decorator.createPanel(), BorderLayout.CENTER);
  panel.add(myScopesLink, BorderLayout.SOUTH);
  return panel;
}
 
Example #7
Source File: ServiceAuthDialog.java    From consulo with Apache License 2.0 5 votes vote down vote up
public ServiceAuthDialog() {
  super(null);
  setTitle("Service Authorization");
  myRoot = new JPanel(new VerticalFlowLayout(0, 0));

  myServiceAuthConfiguration = ServiceAuthConfiguration.getInstance();

  myAsAnonymousButton = new JBRadioButton("Logged as anonymous");
  myLogAsButton = new JBRadioButton("Log as user");

  JPanel loginPanel = new JPanel(new VerticalFlowLayout(0, 0));
  myEmailField = new JBTextField();
  loginPanel.add(LabeledComponent.left(myEmailField, "Email"));

  ButtonGroup group = new ButtonGroup();
  group.add(myAsAnonymousButton);
  group.add(myLogAsButton);

  myLogAsButton.addItemListener(e -> UIUtil.setEnabled(loginPanel, e.getStateChange() == ItemEvent.SELECTED, true));

  myRoot.add(myAsAnonymousButton);
  myRoot.add(myLogAsButton);
  myRoot.add(loginPanel);

  String email = myServiceAuthConfiguration.getEmail();
  if (email == null) {
    myAsAnonymousButton.setSelected(true);
  }
  else {
    myLogAsButton.setSelected(true);
    myEmailField.setText(email);
  }

  pack();
  init();
}
 
Example #8
Source File: ExportToHTMLDialog.java    From consulo with Apache License 2.0 5 votes vote down vote up
public static LabeledComponent<TextFieldWithBrowseButton> assignLabel(TextFieldWithBrowseButton targetDirectoryField, Project project) {
  LabeledComponent<TextFieldWithBrowseButton> labeledComponent = new LabeledComponent<TextFieldWithBrowseButton>();
  labeledComponent.setText(CodeEditorBundle.message("export.to.html.output.directory.label"));
  targetDirectoryField.addBrowseFolderListener(CodeEditorBundle.message("export.to.html.select.output.directory.title"),
                                               CodeEditorBundle.message("export.to.html.select.output.directory.description"),
                                               project, FileChooserDescriptorFactory.createSingleFolderDescriptor());
  labeledComponent.setComponent(targetDirectoryField);
  return labeledComponent;
}
 
Example #9
Source File: MergePanel2.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
private Collection<EditorPlace> getEditorPlaces() {
  Collection<EditorPlace> editorPlaces = new ArrayList<EditorPlace>(3);
  for (LabeledComponent editorsPanel : myEditorsPanels) {
    editorPlaces.add((EditorPlace) editorsPanel.getComponent());
  }
  return editorPlaces;
}
 
Example #10
Source File: MergePanel2.java    From consulo with Apache License 2.0 5 votes vote down vote up
public MergePanel2(DialogBuilder builder, @Nonnull Disposable parent) {
  ArrayList<EditorPlace> editorPlaces = new ArrayList<EditorPlace>();
  EditorPlace.EditorListener placeListener = new EditorPlace.EditorListener() {
    @Override
    public void onEditorCreated(EditorPlace place) {
      if (myDuringCreation) return;
      disposeMergeList();
      myDuringCreation = true;
      try {
        tryInitView();
      }
      finally {
        myDuringCreation = false;
      }
    }

    @Override
    public void onEditorReleased(Editor releasedEditor) {
      LOG.assertTrue(!myDuringCreation);
      disposeMergeList();
    }
  };
  for (int i = 0; i < EDITORS_COUNT; i++) {
    EditorPlace editorPlace = new EditorPlace(new DiffEditorState(i), indexToColumn(i), this);
    Disposer.register(parent, editorPlace);
    editorPlaces.add(editorPlace);
    editorPlace.addListener(placeListener);
    myEditorsPanels[i] = new LabeledComponent();
    myEditorsPanels[i].setLabelLocation(BorderLayout.NORTH);
    myEditorsPanels[i].setComponent(editorPlace);
  }
  FontSizeSynchronizer.attachTo(editorPlaces);
  myPanel = new DiffPanelOuterComponent(TextDiffType.MERGE_TYPES, createToolbar());
  myPanel.insertDiffComponent(new ThreePanels(myEditorsPanels, myDividers), new MyScrollingPanel());
  myProvider = new MyDataProvider();
  myPanel.setDataProvider(myProvider);
  myBuilder = builder;
}
 
Example #11
Source File: RunConfigurationEditor.java    From embeddedlinux-jvmdebugger-intellij with Apache License 2.0 5 votes vote down vote up
/**
 * Creates UI Components
 */
private void createUIComponents() {
    myMainClass = new LabeledComponent<>();
    myMainClass.setComponent(new EditorTextFieldWithBrowseButton(myProject, true, (declaration, place) -> {
        if (declaration instanceof PsiClass) {
            final PsiClass aClass = (PsiClass)declaration;
            if (ConfigurationUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.findMainMethod(aClass) != null || place.getParent() != null && myModuleSelector.findClass(((PsiClass)declaration).getQualifiedName()) != null) {
                return JavaCodeFragment.VisibilityChecker.Visibility.VISIBLE;
            }
        }
        return JavaCodeFragment.VisibilityChecker.Visibility.NOT_VISIBLE;
    }));
}
 
Example #12
Source File: CommonJavaParametersPanel.java    From intellij-xquery with Apache License 2.0 5 votes vote down vote up
@Override
protected void addComponents() {
    myVMParametersComponent = LabeledComponent.create(new RawCommandLineEditor(), ExecutionBundle.message("run.configuration.java.vm.parameters.label"));
    copyDialogCaption(myVMParametersComponent);

    myVMParametersComponent.setLabelLocation(BorderLayout.WEST);

    add(myVMParametersComponent);
    super.addComponents();
}
 
Example #13
Source File: ModuleSelectionPanel.java    From intellij-xquery with Apache License 2.0 5 votes vote down vote up
public ModuleSelectionPanel(Project project) {
    super(new BorderLayout());
    setName(MODULE_SELECTION_PANEL);
    mainFile = new LabeledComponent<ModuleSelector>();
    mainFile.setText("Main &file");
    mainFile.setLabelLocation("West");
    mainFile.setComponent(getModuleSelector(project));
    add(mainFile);
}
 
Example #14
Source File: DataSourcePanel.java    From intellij-xquery with Apache License 2.0 5 votes vote down vote up
public DataSourcePanel() {
    super(new BorderLayout());
    setName(DATA_SOURCE_PANEL);
    dataSourceSelectorComponent = new LabeledComponent<JComboBox>();
    dataSourceSelectorComponent.setLabelLocation("West");
    dataSourceSelectorComponent.setText("&Data source");
    dataSourceSelectorComponent.setComponent(new JComboBox());
    dataSourceSelector = getDataSourceSelector();
    add(dataSourceSelectorComponent, BorderLayout.CENTER);
    configureDataSourcesButton = new JButton("Configure");
    configureDataSourcesButton.setName(CONFIGURE_DATA_SOURCES_BUTTON);
    configureDataSourcesButton.setMnemonic(KeyEvent.VK_O);
    configureDataSourcesButton.addActionListener(getShowDialogActionListener());
    add(configureDataSourcesButton, BorderLayout.EAST);
}
 
Example #15
Source File: NoSqlConfigurable.java    From nosql4idea with Apache License 2.0 5 votes vote down vote up
private LabeledComponent<TextFieldWithBrowseButton> createShellPathField(DatabaseVendor databaseVendor) {
    LabeledComponent<TextFieldWithBrowseButton> shellPathField = new LabeledComponent<>();
    TextFieldWithBrowseButton component = new TextFieldWithBrowseButton();
    component.getChildComponent().setName("shellPathField");
    shellPathField.setComponent(component);
    shellPathField.getComponent().addBrowseFolderListener(String.format("%s CLI configuration", databaseVendor.name), "", null,
            new FileChooserDescriptor(true, false, false, false, false, false));

    shellPathField.getComponent().setText(configuration.getShellPath(databaseVendor));

    return shellPathField;
}
 
Example #16
Source File: EditTestsDialog.java    From JHelper with GNU Lesser General Public License v3.0 5 votes vote down vote up
public EditTestsDialog(Test[] tests, Project project) {
	super(project);
	setTitle("Tests");
	this.tests = new ArrayList<>(Arrays.asList(tests));
	VariableGridLayout mainLayout = new VariableGridLayout(1, 2, GRID_LAYOUT_GAP, GRID_LAYOUT_GAP);
	mainLayout.setColFraction(0, LIST_PANEL_FRACTION);
	JPanel mainPanel = new JPanel(mainLayout);
	JPanel selectorAndButtonsPanel = new JPanel(new BorderLayout());

	selectorAndButtonsPanel.add(
			LabeledComponent.create(
					new JBScrollPane(
							generateListPanel(),
							ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
							ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER
					),
					"Tests"
			)
	);

	selectorAndButtonsPanel.add(createButtonPanel(), BorderLayout.PAGE_END);
	mainPanel.add(selectorAndButtonsPanel);
	mainPanel.add(generateTestPanel());

	mainPanel.setPreferredSize(PREFERRED_SIZE);
	component = mainPanel;
	setSelectedTest(Math.min(0, tests.length - 1));

	init();
}
 
Example #17
Source File: TaskSettingsComponent.java    From JHelper with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void setTaskData(TaskData taskData) {
	removeAll();
	name = new JTextField(taskData.getName());
	name.setEnabled(canChangeName);

	className = new JTextField(taskData.getClassName());
	cppPath = new FileSelector(
			project,
			taskData.getCppPath(),
			RelativeFileChooserDescriptor.fileChooser(project.getBaseDir())
	);
	input = new StreamConfigurationPanel(
			taskData.getInput(),
			StreamConfiguration.StreamType.values(),
			"input.txt",
			listener
	);
	output = new StreamConfigurationPanel(
			taskData.getOutput(),
			StreamConfiguration.OUTPUT_TYPES,
			"output.txt",
			listener
	);

	testType = new ComboBox<>(TestType.values());
	testType.setSelectedItem(taskData.getTestType());

	add(LabeledComponent.create(name, "Task name"));
	add(LabeledComponent.create(className, "Class name"));
	add(LabeledComponent.create(cppPath, "Path"));
	add(LabeledComponent.create(input, "Input"));
	add(LabeledComponent.create(output, "Output"));
	add(LabeledComponent.create(testType, "Test type"));

	UIUtils.mirrorFields(name, className);
	UIUtils.mirrorFields(name, cppPath.getTextField(), TaskData.defaultCppPathFormat(project));
}
 
Example #18
Source File: ConfigurationDialog.java    From JHelper with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ConfigurationDialog(@NotNull Project project, Configurator.State configuration) {
	super(project);
	setTitle("JHelper configuration for " + project.getName());

	author = new JTextField(configuration.getAuthor());

	tasksDirectory = new FileSelector(
			project,
			configuration.getTasksDirectory(),
			RelativeFileChooserDescriptor.directoryChooser(project.getBaseDir())
	);
	outputFile = new FileSelector(
			project,
			configuration.getOutputFile(),
			RelativeFileChooserDescriptor.fileChooser(project.getBaseDir())
	);
	runFile = new FileSelector(
			project,
			configuration.getRunFile(),
			RelativeFileChooserDescriptor.fileChooser(project.getBaseDir())
	);

	codeEliminationOn = new JCheckBox("Eliminate code?", configuration.isCodeEliminationOn());
	codeReformattingOn = new JCheckBox("Reformat code?", configuration.isCodeReformattingOn());

	JPanel panel = new JPanel(new VerticalLayout());
	panel.add(LabeledComponent.create(author, "Author"));
	panel.add(LabeledComponent.create(tasksDirectory, "Tasks directory"));
	panel.add(LabeledComponent.create(outputFile, "Output file"));
	panel.add(LabeledComponent.create(runFile, "Run File"));
	panel.add(codeEliminationOn);
	panel.add(codeReformattingOn);

	component = panel;

	init();
}
 
Example #19
Source File: BashConfigForm.java    From BashSupport with Apache License 2.0 5 votes vote down vote up
protected void initOwnComponents() {
    Project project = getProject();

    FileChooserDescriptor chooseInterpreterDescriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor();
    chooseInterpreterDescriptor.setTitle("Choose Interpreter...");

    interpreterPathField = new TextFieldWithBrowseButton();
    interpreterPathField.addBrowseFolderListener(new MacroAwareTextBrowseFolderListener(chooseInterpreterDescriptor, project));

    interpreterPathComponent = LabeledComponent.create(createComponentWithMacroBrowse(interpreterPathField), "Interpreter path:");
    interpreterPathComponent.setLabelLocation(BorderLayout.WEST);

    projectInterpreterCheckbox = new JBCheckBox();
    projectInterpreterCheckbox.setToolTipText("If enabled then the interpreter path configured in the project settings will be used instead of a custom location.");
    projectInterpreterCheckbox.addChangeListener(e -> {
        boolean selected = projectInterpreterCheckbox.isSelected();
        UIUtil.setEnabled(interpreterPathComponent, !selected, true);
    });
    projectInterpreterLabeled = LabeledComponent.create(projectInterpreterCheckbox, "Use project interpreter");
    projectInterpreterLabeled.setLabelLocation(BorderLayout.WEST);

    interpreterParametersComponent = LabeledComponent.create(new RawCommandLineEditor(), "Interpreter options");
    interpreterParametersComponent.setLabelLocation(BorderLayout.WEST);

    scriptNameField = new TextFieldWithBrowseButton();
    scriptNameField.addBrowseFolderListener(new MacroAwareTextBrowseFolderListener(FileChooserDescriptorFactory.createSingleLocalFileDescriptor(), project));

    scriptNameComponent = LabeledComponent.create(createComponentWithMacroBrowse(scriptNameField), "Script:");
    scriptNameComponent.setLabelLocation(BorderLayout.WEST);
}
 
Example #20
Source File: HaxeFlexSDKConfigurable.java    From intellij-haxe with Apache License 2.0 4 votes vote down vote up
@Override
public JComponent createComponent() {
  return LabeledComponent.create(flexSdkCombo, HaxeBundle.message("flex.sdk.label"));
}
 
Example #21
Source File: CSharpSetupStep.java    From consulo-csharp with Apache License 2.0 4 votes vote down vote up
public CSharpSetupStep(CSharpNewModuleContext context)
{
	super(context);

	JPanel panel = new JPanel(new VerticalFlowLayout());

	myTargetComboBox = new ComboBox<>(DotNetTarget.values());
	myTargetComboBox.setRenderer(new ColoredListCellRenderer<DotNetTarget>()
	{
		@Override
		protected void customizeCellRenderer(@Nonnull JList<? extends DotNetTarget> jList, DotNetTarget target, int i, boolean b, boolean b1)
		{
			append(target.getDescription());
		}
	});
	myTargetComboBox.addItemListener(e -> {
		if(e.getStateChange() == ItemEvent.SELECTED)
		{
			context.setTarget((DotNetTarget) myTargetComboBox.getSelectedItem());
		}
	});

	panel.add(myTargetComponent = LabeledComponent.create(myTargetComboBox, "Target"));

	List<String> validSdkTypes = new SmartList<>();
	for(Map.Entry<String, String[]> entry : CSharpNewModuleBuilder.ourExtensionMapping.entrySet())
	{
		// need check C# extension
		ModuleExtensionProviderEP providerEP = ModuleExtensionProviders.findProvider(entry.getValue()[1]);
		if(providerEP == null)
		{
			continue;
		}
		validSdkTypes.add(entry.getKey());
	}

	myComboBox = new SdkComboBox(SdkTable.getInstance(), sdkTypeId -> validSdkTypes.contains(sdkTypeId.getName()), false);
	myComboBox.addItemListener(e -> {
		if(e.getStateChange() == ItemEvent.SELECTED)
		{
			context.setSdk(myComboBox.getSelectedSdk());
		}
	});
	context.setSdk(myComboBox.getSelectedSdk());

	panel.add(LabeledComponent.create(myComboBox, ".NET SDK"));

	myAdditionalContentPanel.add(panel, BorderLayout.NORTH);
}
 
Example #22
Source File: MergePanel2.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void setDiffRequest(DiffRequest data) {
  setTitle(data.getWindowTitle());
  disposeMergeList();
  for (int i = 0; i < EDITORS_COUNT; i++) {
    getEditorPlace(i).setDocument(null);
  }
  LOG.assertTrue(!myDuringCreation);
  myDuringCreation = true;
  myProvider.putData(data.getGenericData());
  try {
    myData = data;
    String[] titles = myData.getContentTitles();
    for (int i = 0; i < myEditorsPanels.length; i++) {
      LabeledComponent editorsPanel = myEditorsPanels[i];
      editorsPanel.getLabel().setText(titles[i].isEmpty() ? " " : titles[i]);
    }
    createMergeList();
    data.customizeToolbar(myPanel.resetToolbar());
    myPanel.registerToolbarActions();
    if ( data instanceof MergeRequestImpl && myBuilder != null){
      Convertor<DialogWrapper, Boolean> preOkHook = new Convertor<DialogWrapper, Boolean>() {
        @Override
        public Boolean convert(DialogWrapper dialog) {
          ChangeCounter counter = ChangeCounter.getOrCreate(myMergeList);
          int changes = counter.getChangeCounter();
          int conflicts = counter.getConflictCounter();
          if (changes == 0 && conflicts == 0) return true;
          return Messages.showYesNoDialog(dialog.getRootPane(),
                                          DiffBundle.message("merge.dialog.apply.partially.resolved.changes.confirmation.message", changes, conflicts),
                                          DiffBundle.message("apply.partially.resolved.merge.dialog.title"),
                                          Messages.getQuestionIcon()) == Messages.YES;
        }
      };
      ((MergeRequestImpl)data).setActions(myBuilder, this, preOkHook);
    }
  }
  finally {
    myDuringCreation = false;
  }
}
 
Example #23
Source File: DemoSettingsEditor.java    From intellij-sdk-docs with Apache License 2.0 4 votes vote down vote up
private void createUIComponents() {
  myScriptName = new LabeledComponent<>();
  myScriptName.setComponent(new TextFieldWithBrowseButton());
}
 
Example #24
Source File: ExportToHTMLDialog.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
protected JComponent createNorthPanel() {
  OptionGroup optionGroup = new OptionGroup();

  myRbCurrentFile = new JRadioButton(CodeEditorBundle.message("export.to.html.file.name.radio", (myFileName != null ? myFileName : "")));
  optionGroup.add(myRbCurrentFile);

  myRbSelectedText = new JRadioButton(CodeEditorBundle.message("export.to.html.selected.text.radio"));
  optionGroup.add(myRbSelectedText);

  myRbCurrentPackage = new JRadioButton(
    CodeEditorBundle.message("export.to.html.all.files.in.directory.radio", (myDirectoryName != null ? myDirectoryName : "")));
  optionGroup.add(myRbCurrentPackage);

  myCbIncludeSubpackages = new JCheckBox(CodeEditorBundle.message("export.to.html.include.subdirectories.checkbox"));
  optionGroup.add(myCbIncludeSubpackages, true);

  FileTextField field = FileChooserFactory.getInstance().createFileTextField(FileChooserDescriptorFactory.createSingleFolderDescriptor(), myDisposable);
  myTargetDirectoryField = new TextFieldWithBrowseButton(field.getField());
  LabeledComponent<TextFieldWithBrowseButton> labeledComponent = assignLabel(myTargetDirectoryField, myProject);

  optionGroup.add(labeledComponent);

  ButtonGroup buttonGroup = new ButtonGroup();
  buttonGroup.add(myRbCurrentFile);
  buttonGroup.add(myRbSelectedText);
  buttonGroup.add(myRbCurrentPackage);

  ActionListener actionListener = new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      myCbIncludeSubpackages.setEnabled(myRbCurrentPackage.isSelected());
    }
  };

  myRbCurrentFile.addActionListener(actionListener);
  myRbSelectedText.addActionListener(actionListener);
  myRbCurrentPackage.addActionListener(actionListener);

  return optionGroup.createPanel();
}
 
Example #25
Source File: CommonProgramParametersPanel.java    From consulo with Apache License 2.0 4 votes vote down vote up
protected void copyDialogCaption(final LabeledComponent<RawCommandLineEditor> component) {
  final RawCommandLineEditor rawCommandLineEditor = component.getComponent();
  rawCommandLineEditor.setDialogCaption(component.getRawText());
  component.getLabel().setLabelFor(rawCommandLineEditor.getTextField());
}
 
Example #26
Source File: CommonProgramParametersPanel.java    From consulo with Apache License 2.0 4 votes vote down vote up
public LabeledComponent<RawCommandLineEditor> getProgramParametersComponent() {
  return myProgramParametersComponent;
}