本文整理汇总了Java中com.intellij.openapi.ui.LabeledComponent.setLabelLocation方法的典型用法代码示例。如果您正苦于以下问题:Java LabeledComponent.setLabelLocation方法的具体用法?Java LabeledComponent.setLabelLocation怎么用?Java LabeledComponent.setLabelLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.ui.LabeledComponent
的用法示例。
在下文中一共展示了LabeledComponent.setLabelLocation方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: 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;
}
示例4: createReplaceFieldsWithGettersPanel
import com.intellij.openapi.ui.LabeledComponent; //导入方法依赖的package包/类
@Override
protected JPanel createReplaceFieldsWithGettersPanel() {
final LabeledComponent<JComboBox> component = new LabeledComponent<JComboBox>();
myReplaceFieldsCb = new JComboBox(new Integer[]{IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_ALL,
IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_INACCESSIBLE,
IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_NONE});
myReplaceFieldsCb.setRenderer(new ListCellRendererWrapper<Integer>() {
@Override
public void customize(JList list, Integer value, int index, boolean selected, boolean hasFocus) {
switch (value) {
case IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_NONE:
setText(UIUtil.removeMnemonic(RefactoringBundle.message("do.not.replace")));
break;
case IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_INACCESSIBLE:
setText(UIUtil.removeMnemonic(RefactoringBundle.message("replace.fields.inaccessible.in.usage.context")));
break;
default:
setText(UIUtil.removeMnemonic(RefactoringBundle.message("replace.all.fields")));
}
}
});
myReplaceFieldsCb.setSelectedItem(JavaRefactoringSettings.getInstance().INTRODUCE_PARAMETER_REPLACE_FIELDS_WITH_GETTERS);
KeyboardComboSwitcher.setupActions(myReplaceFieldsCb, myProject);
component.setComponent(myReplaceFieldsCb);
component.setText(RefactoringBundle.message("replace.fields.used.in.expressions.with.their.getters"));
component.getLabel().setDisplayedMnemonic('u');
component.setLabelLocation(BorderLayout.NORTH);
component.setBorder(IdeBorderFactory.createEmptyBorder(3, 3, 2, 2));
return component;
}
示例5: 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;
}
示例6: 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 Nuxeo SDK:");
component.setLabelLocation(BorderLayout.WEST);
component.setComponent(nuxeoSDKsComboBox);
panel.add(component, BorderLayout.NORTH);
return panel;
}