本文整理汇总了Java中com.intellij.openapi.ui.LabeledComponent类的典型用法代码示例。如果您正苦于以下问题:Java LabeledComponent类的具体用法?Java LabeledComponent怎么用?Java LabeledComponent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LabeledComponent类属于com.intellij.openapi.ui包,在下文中一共展示了LabeledComponent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SortDialog
import com.intellij.openapi.ui.LabeledComponent; //导入依赖的package包/类
public SortDialog(Project project) {
super(project);
cbSpace = new JCheckBox("Add space around delimiter", null, true);
cbSplit = new JCheckBox("Split in Groups", null, true);
cbRearrangeAll = new JCheckBox("Rearrange intention over all", null, false);
cbRearrangeGroup = new JCheckBox("Rearrange intention in groups", null, true);
setTitle("Sort Properties");
JPanel panel = new JPanel();
panel.setBounds(61, 11, 81, 140);
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
panel.add(cbSpace);
panel.add(cbSplit);
panel.add(cbRearrangeAll);
panel.add(cbRearrangeGroup);
component = LabeledComponent.create(panel, "Sort Options");
init();
}
示例2: createCenterPanel
import com.intellij.openapi.ui.LabeledComponent; //导入依赖的package包/类
@Override
protected JComponent createCenterPanel() {
final JPanel panel = new JPanel(new GridBagLayout());
final GridBagConstraints gc = new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1, 0, GridBagConstraints.NORTHWEST,
GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0);
final PsiType type = getRootType();
final String typeText = type != null ? type.getPresentableText() : "<unknown>";
panel.add(new JLabel("Migrate " + getElementPresentation(myRoot) + " \"" + typeText + "\" to"), gc);
panel.add(myToTypeEditor, gc);
LabeledComponent<ScopeChooserCombo> scopeChooserComponent = new LabeledComponent<ScopeChooserCombo>();
scopeChooserComponent.setComponent(myScopeChooserCombo);
scopeChooserComponent.setText("Choose scope where change signature may occur");
panel.add(scopeChooserComponent, gc);
return panel;
}
示例3: RawCommandLineEditor
import com.intellij.openapi.ui.LabeledComponent; //导入依赖的package包/类
public RawCommandLineEditor(final Function<String, List<String>> lineParser, final Function<List<String>, String> lineJoiner) {
super(new BorderLayout());
myTextField = new TextFieldWithBrowseButton(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (myDialogCaption == null) {
Container parent = getParent();
if (parent instanceof LabeledComponent) {
parent = parent.getParent();
}
LOG.error("Did not call RawCommandLineEditor.setDialogCaption() in " + parent);
myDialogCaption = "Parameters";
}
Messages.showTextAreaDialog(myTextField.getTextField(), myDialogCaption, "EditParametersPopupWindow", lineParser, lineJoiner);
}
});
myTextField.setButtonIcon(AllIcons.Actions.ShowViewer);
add(myTextField, BorderLayout.CENTER);
setDescriptor(null);
}
示例4: getCommandLine
import com.intellij.openapi.ui.LabeledComponent; //导入依赖的package包/类
public List<String> getCommandLine() {
if (myCurrentCard.equals(CARD_COMMAND_LINE)) {
return StringUtil.split(myCommandLineField.getText(), " ");
}
List<String> result = new ArrayList<String>();
for (Map.Entry<SetupTask.Option, JComponent> entry : myOptionComponents.entrySet()) {
final SetupTask.Option option = entry.getKey();
if (option.checkbox) {
JCheckBox checkBox = (JCheckBox)entry.getValue();
if (checkBox.isSelected() != option.negative) {
result.add(option.name);
}
}
else {
LabeledComponent<JTextField> textField = (LabeledComponent<JTextField>)entry.getValue();
String text = textField.getComponent().getText();
if (text.length() > 0) {
result.add("--" + option.name + text);
}
}
}
return result;
}
示例5: createOptionsPanel
import com.intellij.openapi.ui.LabeledComponent; //导入依赖的package包/类
@Nullable
public JComponent createOptionsPanel() {
final LabeledComponent<JTextField> definedGroups = new LabeledComponent<JTextField>();
definedGroups.setText("&Defined Groups");
final JTextField textField = new JTextField(StringUtil.join(ArrayUtil.toStringArray(groups), ","));
textField.getDocument().addDocumentListener(new DocumentAdapter() {
protected void textChanged(final DocumentEvent e) {
groups.clear();
final String[] groupsFromString = textField.getText().split("[, ]");
ContainerUtil.addAll(groups, groupsFromString);
}
});
definedGroups.setComponent(textField);
final JPanel optionsPanel = new JPanel(new BorderLayout());
optionsPanel.add(definedGroups, BorderLayout.NORTH);
return optionsPanel;
}
示例6: createUIComponents
import com.intellij.openapi.ui.LabeledComponent; //导入依赖的package包/类
private void createUIComponents() {
mavenHomeField = new TextFieldWithHistory();
mavenHomeField.setHistorySize(-1);
final ArrayList<String> foundMavenHomes = new ArrayList<String>();
foundMavenHomes.add(MavenServerManager.BUNDLED_MAVEN_2);
foundMavenHomes.add(MavenServerManager.BUNDLED_MAVEN_3);
final File mavenHomeDirectory = MavenUtil.resolveMavenHomeDirectory(null);
if (mavenHomeDirectory != null) {
foundMavenHomes.add(FileUtil.toSystemIndependentName(mavenHomeDirectory.getPath()));
}
mavenHomeField.setHistory(foundMavenHomes);
mavenHomeComponent = LabeledComponent.create(
new ComponentWithBrowseButton<TextFieldWithHistory>(mavenHomeField, null), "Maven &home directory");
final JBLabel versionLabel = new JBLabel();
versionLabel.setOpaque(true);
versionLabel.setVerticalAlignment(SwingConstants.TOP);
versionLabel.setVerticalTextPosition(SwingConstants.TOP);
mavenVersionLabelComponent = LabeledComponent.create(versionLabel, "");
}
示例7: getMainComponent
import com.intellij.openapi.ui.LabeledComponent; //导入依赖的package包/类
public JComponent getMainComponent() {
final LabeledComponent<JComboBox> component = new LabeledComponent<JComboBox>();
component.setText("Default &project copyright:");
component.setLabelLocation(BorderLayout.WEST);
component.setComponent(myProfilesComboBox);
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);
return JBUI.Panels.simplePanel(0, 10)
.addToTop(component)
.addToCenter(decorator.createPanel())
.addToBottom(myScopesLink);
}
示例8: addComponents
import com.intellij.openapi.ui.LabeledComponent; //导入依赖的package包/类
@Override
protected void addComponents() {
interpreterNameField = new TextFieldWithBrowseButton();
interpreterNameField.addBrowseFolderListener("Choose interpreter...", "", getProject(), FileChooserDescriptorFactory.createSingleLocalFileDescriptor());
LabeledComponent<JComponent> interpreterNameComponent = LabeledComponent.create(createComponentWithMacroBrowse(interpreterNameField), "Interpreter:");
interpreterNameComponent.setLabelLocation(BorderLayout.WEST);
add(interpreterNameComponent);
interpreterOptionsComponent = LabeledComponent.create(new RawCommandLineEditor(), "Interpreter options");
interpreterOptionsComponent.setLabelLocation(BorderLayout.WEST);
add(interpreterOptionsComponent);
programNameField = new TextFieldWithBrowseButton();
programNameField.addBrowseFolderListener("Choose script...", "", getProject(), FileChooserDescriptorFactory.createSingleLocalFileDescriptor());
LabeledComponent<JComponent> programNameComponent = LabeledComponent.create(createComponentWithMacroBrowse(programNameField), "Script:");
programNameComponent.setLabelLocation(BorderLayout.WEST);
add(programNameComponent);
programParametersComponent = LabeledComponent.create(new RawCommandLineEditor(), "Script parameters:");
programParametersComponent.setLabelLocation(BorderLayout.WEST);
add(programParametersComponent);
}
示例9: generateTestPanel
import com.intellij.openapi.ui.LabeledComponent; //导入依赖的package包/类
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;
}
示例10: initComponents
import com.intellij.openapi.ui.LabeledComponent; //导入依赖的package包/类
@Override
protected void initComponents()
{
myModuleBox = new ComboBox();
myModuleBox.setRenderer(new ModuleListCellRenderer());
myVmParametersComponent = LabeledComponent.create(new RawCommandLineEditor(), "VM arguments");
myVmParametersComponent.setLabelLocation(BorderLayout.WEST);
copyDialogCaption(myVmParametersComponent);
myUseAlternativeBundleCheckBox = new JCheckBox("Use alternative bundle: ");
ProjectSdksModel projectSdksModel = new ProjectSdksModel();
projectSdksModel.reset();
myAlternativeBundleComboBox = new SdkComboBox(projectSdksModel, Conditions.<SdkTypeId>is(NodeJSBundleType.getInstance()), true);
myAlternativeBundleComboBox.setEnabled(false);
myUseAlternativeBundleCheckBox.addItemListener(new ItemListener()
{
@Override
public void itemStateChanged(ItemEvent e)
{
myAlternativeBundleComboBox.setEnabled(myUseAlternativeBundleCheckBox.isSelected());
}
});
super.initComponents();
}
示例11: RawCommandLineEditor
import com.intellij.openapi.ui.LabeledComponent; //导入依赖的package包/类
public RawCommandLineEditor(final Function<String, List<String>> lineParser, final Function<List<String>, String> lineJoiner) {
super(new BorderLayout());
myTextField = new TextFieldWithBrowseButton(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (myDialogCaption == null) {
Container parent = getParent();
if (parent instanceof LabeledComponent) {
parent = parent.getParent();
}
LOG.error("Did not call RawCommandLineEditor.setDialogCaption() in " + parent);
myDialogCaption = "Parameters";
}
Messages.showTextAreaDialog(myTextField.getTextField(), myDialogCaption, "EditParametersPopupWindow", lineParser, lineJoiner);
}
});
myTextField.setButtonIcon(AllIcons.Actions.ShowViewer);
add(myTextField, BorderLayout.CENTER);
setDescriptor(null);
}
示例12: getMainComponent
import com.intellij.openapi.ui.LabeledComponent; //导入依赖的package包/类
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;
}
示例13: createEditor
import com.intellij.openapi.ui.LabeledComponent; //导入依赖的package包/类
@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;
}
示例14: DotNetCoverageConfigurationEditor
import com.intellij.openapi.ui.LabeledComponent; //导入依赖的package包/类
public DotNetCoverageConfigurationEditor()
{
myPanel.add(myEnabledCheckBox);
myPanel.add(LabeledComponent.left(myRunnersBox, "Runner"));
myRunnersBox.setRenderer(new ColoredListCellRendererWrapper<Object>()
{
@Override
protected void doCustomize(JList list, Object value, int index, boolean selected, boolean hasFocus)
{
if(value == null)
{
append("<none>");
}
else if(value instanceof String)
{
append((String) value, SimpleTextAttributes.ERROR_ATTRIBUTES);
}
else if(value instanceof CoverageRunner)
{
append(((CoverageRunner) value).getPresentableName());
}
}
});
}
示例15: RawCommandLineEditor
import com.intellij.openapi.ui.LabeledComponent; //导入依赖的package包/类
public RawCommandLineEditor(final Function<String, List<String>> lineParser, final Function<List<String>, String> lineJoiner) {
super(new BorderLayout());
myTextField = new TextFieldWithBrowseButton(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (StringUtil.isEmpty(myDialogCaption)) {
Container parent = getParent();
if (parent instanceof LabeledComponent) {
parent = parent.getParent();
}
LOG.error("Did not call RawCommandLineEditor.setDialogCaption() in " + parent);
myDialogCaption = "Parameters";
}
Messages.showTextAreaDialog(myTextField.getTextField(), myDialogCaption, "EditParametersPopupWindow", lineParser, lineJoiner);
}
});
myTextField.setButtonIcon(AllIcons.Actions.ShowViewer);
add(myTextField, BorderLayout.CENTER);
setDescriptor(null);
}