本文整理汇总了Java中com.intellij.openapi.ui.LabeledComponent.create方法的典型用法代码示例。如果您正苦于以下问题:Java LabeledComponent.create方法的具体用法?Java LabeledComponent.create怎么用?Java LabeledComponent.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.ui.LabeledComponent
的用法示例。
在下文中一共展示了LabeledComponent.create方法的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: 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, "");
}
示例3: 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);
}
示例4: 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;
}
示例5: 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();
}
示例6: initComponents
import com.intellij.openapi.ui.LabeledComponent; //导入方法依赖的package包/类
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);
}
示例7: GenerateDialog
import com.intellij.openapi.ui.LabeledComponent; //导入方法依赖的package包/类
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();
}
示例8: getLanguageSettingsComponent
import com.intellij.openapi.ui.LabeledComponent; //导入方法依赖的package包/类
@Nullable
@Override
public LabeledComponent<JComponent> getLanguageSettingsComponent(@NotNull Course selectedCourse) {
final Project project = ProjectManager.getInstance().getDefaultProject();
PyConfigurableInterpreterList instance = PyConfigurableInterpreterList.getInstance(project);
if (instance == null) {
return null;
}
final List<Sdk> sdks = instance.getAllPythonSdks();
VirtualEnvProjectFilter.removeAllAssociated(sdks);
// by default we create new virtual env in project, we need to add this non-existing sdk to sdk list
ProjectJdkImpl fakeSdk = createFakeSdk(selectedCourse);
if (fakeSdk != null) {
sdks.add(0, fakeSdk);
}
PythonSdkChooserCombo combo = new PythonSdkChooserCombo(project, sdks, sdk -> true);
if (fakeSdk != null) {
patchRenderer(fakeSdk, combo);
combo.getComboBox().setSelectedItem(fakeSdk);
}
if (SystemInfo.isMac && !UIUtil.isUnderDarcula()) {
combo.putClientProperty("JButton.buttonType", null);
}
combo.setButtonIcon(PythonIcons.Python.InterpreterGear);
combo.addChangedListener(e -> {
Sdk selectedSdk = (Sdk)combo.getComboBox().getSelectedItem();
mySettings.setSdk(selectedSdk == fakeSdk ? null : selectedSdk);
});
return LabeledComponent.create(combo, "Interpreter", BorderLayout.WEST);
}
示例9: getLanguageSettingsComponent
import com.intellij.openapi.ui.LabeledComponent; //导入方法依赖的package包/类
@Nullable
@Override
public LabeledComponent<JComponent> getLanguageSettingsComponent(@NotNull Course selectedCourse) {
myModel = ProjectStructureConfigurable.getInstance(ProjectManager.getInstance().getDefaultProject()).getProjectJdksModel();
myJdkComboBox = new JdkComboBox(myModel, sdkTypeId -> sdkTypeId instanceof JavaSdkType && !((JavaSdkType)sdkTypeId).isDependent(), sdk -> true, sdkTypeId -> sdkTypeId instanceof JavaSdkType && !((JavaSdkType)sdkTypeId).isDependent(), true);
ComboboxWithBrowseButton comboboxWithBrowseButton = new ComboboxWithBrowseButton(myJdkComboBox);
FixedSizeButton setupButton = comboboxWithBrowseButton.getButton();
myJdkComboBox.setSetupButton(setupButton, null, myModel, (JdkComboBox.JdkComboBoxItem) myJdkComboBox.getModel().getSelectedItem(), null, false);
return LabeledComponent.create(comboboxWithBrowseButton, "Jdk", BorderLayout.WEST);
}
示例10: initializePanel
import com.intellij.openapi.ui.LabeledComponent; //导入方法依赖的package包/类
private void initializePanel(boolean isDp) {
controlPanel = new JPanel();
addInitialFields(isDp);
layout = new GroupLayout(controlPanel);
controlPanel.setLayout(layout);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);
setLayoutConstraints();
component = LabeledComponent.create(controlPanel, "");
}
示例11: initializePanel
import com.intellij.openapi.ui.LabeledComponent; //导入方法依赖的package包/类
private void initializePanel() {
controlPanel = new JPanel();
addInitialFields();
layout = new GroupLayout(controlPanel);
controlPanel.setLayout(layout);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);
setLayoutConstraints();
component = LabeledComponent.create(controlPanel, "");
}
示例12: addComponents
import com.intellij.openapi.ui.LabeledComponent; //导入方法依赖的package包/类
@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();
}
示例13: initComponents
import com.intellij.openapi.ui.LabeledComponent; //导入方法依赖的package包/类
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"));
myWorkingDirectoryField = new TextFieldWithBrowseButton();
myWorkingDirectoryField.addBrowseFolderListener(new MacroAwareTextBrowseFolderListener(fileChooserDescriptor, getProject()) {
@Override
public void actionPerformed(ActionEvent e) {
myFileChooserDescriptor.putUserData(LangDataKeys.MODULE_CONTEXT, myModuleContext);
setProject(getProject());
super.actionPerformed(e);
}
});
myWorkingDirectoryComponent = LabeledComponent.create(createComponentWithMacroBrowse(myWorkingDirectoryField), 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));
setAnchor(myEnvVariablesComponent.getLabel());
}
示例14: createBasePanel
import com.intellij.openapi.ui.LabeledComponent; //导入方法依赖的package包/类
@Override
protected JPanel createBasePanel() {
final JPanel panel = super.createBasePanel();
final Project project = ProjectManager.getInstance().getDefaultProject();
final List<Sdk> sdks = PyConfigurableInterpreterList.getInstance(project).getAllPythonSdks();
VirtualEnvProjectFilter.removeAllAssociated(sdks);
Sdk compatibleSdk = sdks.isEmpty() ? null : sdks.iterator().next();
DirectoryProjectGenerator generator = getProjectGenerator();
if (generator instanceof PyFrameworkProjectGenerator && !((PyFrameworkProjectGenerator)generator).supportsPython3()) {
if (compatibleSdk != null && PythonSdkType.getLanguageLevelForSdk(compatibleSdk).isPy3K()) {
Sdk python2Sdk = PythonSdkType.findPython2Sdk(sdks);
if (python2Sdk != null) {
compatibleSdk = python2Sdk;
}
}
}
final Sdk preferred = compatibleSdk;
mySdkCombo = new PythonSdkChooserCombo(project, sdks, new Condition<Sdk>() {
@Override
public boolean value(Sdk sdk) {
return sdk == preferred;
}
});
mySdkCombo.setButtonIcon(PythonIcons.Python.InterpreterGear);
final LabeledComponent<PythonSdkChooserCombo> labeled = LabeledComponent.create(mySdkCombo, "Interpreter");
labeled.setLabelLocation(BorderLayout.WEST);
UIUtil.mergeComponentsWithAnchor(labeled, (PanelWithAnchor)panel.getComponent(0));
panel.add(labeled);
final JPanel basePanelExtension = extendBasePanel();
if (basePanelExtension != null) {
panel.add(basePanelExtension);
}
return panel;
}
示例15: initOwnComponents
import com.intellij.openapi.ui.LabeledComponent; //导入方法依赖的package包/类
protected void initOwnComponents() {
FileChooserDescriptor chooseScriptDescriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor();
scriptNameField = new TextFieldWithBrowseButton();
scriptNameField.addBrowseFolderListener(new MacroAwareTextBrowseFolderListener(chooseScriptDescriptor,
getProject()));
scriptNameComponent = LabeledComponent.create(createComponentWithMacroBrowse(scriptNameField), "Script:");
scriptNameComponent.setLabelLocation(BorderLayout.WEST);
}