本文整理汇总了Java中com.intellij.application.options.ModuleListCellRenderer类的典型用法代码示例。如果您正苦于以下问题:Java ModuleListCellRenderer类的具体用法?Java ModuleListCellRenderer怎么用?Java ModuleListCellRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModuleListCellRenderer类属于com.intellij.application.options包,在下文中一共展示了ModuleListCellRenderer类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ConfigurationModuleSelector
import com.intellij.application.options.ModuleListCellRenderer; //导入依赖的package包/类
/**
* @deprecated use {@link #ConfigurationModuleSelector(Project, ModulesComboBox, String)} instead
*/
public ConfigurationModuleSelector(final Project project, final JComboBox modulesList, final String noModule) {
myProject = project;
myModulesList = modulesList;
new ComboboxSpeedSearch(modulesList){
protected String getElementText(Object element) {
if (element instanceof Module){
return ((Module)element).getName();
} else if (element == null) {
return noModule;
}
return super.getElementText(element);
}
};
myModulesList.setModel(new SortedComboBoxModel<Module>(ModulesAlphaComparator.INSTANCE));
myModulesList.setRenderer(new ModuleListCellRenderer(noModule));
}
示例2: initComponents
import com.intellij.application.options.ModuleListCellRenderer; //导入依赖的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();
}
示例3: ConfigurationModuleSelector
import com.intellij.application.options.ModuleListCellRenderer; //导入依赖的package包/类
public ConfigurationModuleSelector(final Project project, final JComboBox<Module> modulesList, final String noModule) {
myProject = project;
myModulesList = modulesList;
new ComboboxSpeedSearch(modulesList) {
protected String getElementText(Object element) {
if (element instanceof Module) {
return ((Module) element).getName();
} else if (element == null) {
return noModule;
}
return super.getElementText(element);
}
};
myModulesList.setModel(new SortedComboBoxModel<>(ModulesAlphaComparator.INSTANCE));
myModulesList.setRenderer(new ModuleListCellRenderer(noModule));
}
示例4: ConfigurationModuleSelector
import com.intellij.application.options.ModuleListCellRenderer; //导入依赖的package包/类
/**
* @deprecated use {@link #ConfigurationModuleSelector(Project, ModulesComboBox, String)} instead
*/
public ConfigurationModuleSelector(final Project project, final JComboBox<Module> modulesList, final String noModule)
{
myProject = project;
myModulesList = modulesList;
myModulesDescriptionsComboBox = null;
new ComboboxSpeedSearch(modulesList)
{
protected String getElementText(Object element)
{
if(element instanceof Module)
{
return ((Module) element).getName();
}
else if(element == null)
{
return noModule;
}
return super.getElementText(element);
}
};
myModulesList.setModel(new SortedComboBoxModel<>(ModulesAlphaComparator.INSTANCE));
myModulesList.setRenderer(new ModuleListCellRenderer(noModule));
}
示例5: invoke
import com.intellij.application.options.ModuleListCellRenderer; //导入依赖的package包/类
@Override
public void invoke(@NotNull Project project, @Nullable Editor editor, PsiFile file)
{
if(myModules.size() == 1)
{
addDependencyOnModule(project, editor, ContainerUtil.getFirstItem(myModules));
}
else
{
JBList<Module> list = new JBList<>(myModules);
list.setCellRenderer(new ModuleListCellRenderer());
JBPopup popup = JBPopupFactory.getInstance().createListPopupBuilder(list).setTitle(JavaQuickFixBundle.message("orderEntry.fix.choose.module.to.add.dependency.on")).setMovable(false)
.setResizable(false).setRequestFocus(true).setItemChoosenCallback(() -> addDependencyOnModule(project, editor, list.getSelectedValue())).createPopup();
if(editor != null)
{
popup.showInBestPositionFor(editor);
}
else
{
popup.showCenteredInCurrentWindow(project);
}
}
}
示例6: invoke
import com.intellij.application.options.ModuleListCellRenderer; //导入依赖的package包/类
@Override
public void invoke(@NotNull final Project project, @Nullable final Editor editor, PsiFile file) {
if (myModules.size() == 1) {
addDependencyOnModule(project, editor, ContainerUtil.getFirstItem(myModules));
}
else {
final JBList list = new JBList(myModules);
list.setCellRenderer(new ModuleListCellRenderer());
final JBPopup popup = JBPopupFactory.getInstance().createListPopupBuilder(list)
.setTitle("Choose Module to Add Dependency on")
.setMovable(false)
.setResizable(false)
.setRequestFocus(true)
.setItemChoosenCallback(new Runnable() {
@Override
public void run() {
final Object value = list.getSelectedValue();
if (value instanceof Module) {
addDependencyOnModule(project, editor, (Module)value);
}
}
}).createPopup();
if (editor != null) {
popup.showInBestPositionFor(editor);
} else {
popup.showCenteredInCurrentWindow(project);
}
}
}
示例7: createEditor
import com.intellij.application.options.ModuleListCellRenderer; //导入依赖的package包/类
@NotNull
@Override
protected JComponent createEditor()
{
myProgramParametersPanel = new CommonProgramParametersPanel();
myModuleComboBox = new JComboBox();
myModuleComboBox.setRenderer(new ModuleListCellRenderer());
for(Module module : ModuleManager.getInstance(myProject).getModules())
{
if(ModuleUtilCore.getExtension(module, DotNetModuleExtension.class) != null)
{
myModuleComboBox.addItem(module);
}
}
myModuleComboBox.addItemListener(new ItemListener()
{
@Override
public void itemStateChanged(ItemEvent e)
{
if(e.getStateChange() == ItemEvent.SELECTED)
{
myProgramParametersPanel.setModuleContext((Module) myModuleComboBox.getSelectedItem());
}
}
});
FormBuilder formBuilder = FormBuilder.createFormBuilder();
formBuilder.addLabeledComponent("Module", myModuleComboBox);
myProgramParametersPanel.add(formBuilder.getPanel());
return myProgramParametersPanel;
}
示例8: ModuleDependencyTabContext
import com.intellij.application.options.ModuleListCellRenderer; //导入依赖的package包/类
public ModuleDependencyTabContext(ClasspathPanel panel, StructureConfigurableContext context) {
super(panel, context);
myNotAddedModules = getNotAddedModules();
myModuleList = new JBList(myNotAddedModules);
myModuleList.setCellRenderer(new ModuleListCellRenderer());
new ListSpeedSearch(myModuleList);
}