本文整理汇总了Java中org.jdesktop.swingx.combobox.ListComboBoxModel类的典型用法代码示例。如果您正苦于以下问题:Java ListComboBoxModel类的具体用法?Java ListComboBoxModel怎么用?Java ListComboBoxModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListComboBoxModel类属于org.jdesktop.swingx.combobox包,在下文中一共展示了ListComboBoxModel类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getTableCellEditorComponent
import org.jdesktop.swingx.combobox.ListComboBoxModel; //导入依赖的package包/类
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
if (value instanceof ListWithSelection) {
ListWithSelection options = (ListWithSelection)value;
//noinspection unchecked
comboBox.setModel(new ListComboBoxModel(options));
if (options.getSelection() == null) {
options.selectFirst();
}
comboBox.setSelectedItem(options.getSelection());
}
else {
Enum enumValue = (Enum)value;
Class enumClass = enumValue.getDeclaringClass();
//noinspection unchecked
ComboBoxModel model = comboBox.getModel();
if (!(model instanceof EnumComboBoxModel && model.getSize() > 0 && ((Enum)model.getElementAt(0)).getDeclaringClass() == enumClass)) {
//noinspection unchecked
comboBox.setModel(new EnumComboBoxModel(enumClass));
}
comboBox.setSelectedItem(value);
}
return comboBox;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:ComboBoxTableCellEditor.java
示例2: NewStringKeyDialog
import org.jdesktop.swingx.combobox.ListComboBoxModel; //导入依赖的package包/类
public NewStringKeyDialog(@NotNull final AndroidFacet facet, @NotNull Set<String> existing) {
super(facet.getModule().getProject(), false);
final VirtualFile baseDir = facet.getModule().getProject().getBaseDir();
myResFolderCombo.setModel(new ListComboBoxModel(facet.getAllResourceDirectories()));
myResFolderCombo.setRenderer(new ListCellRendererWrapper<VirtualFile>() {
@Override
public void customize(JList list, VirtualFile file, int index, boolean selected, boolean hasFocus) {
setText(VfsUtilCore.getRelativePath(file, baseDir, File.separatorChar));
}
});
myResFolderCombo.setSelectedIndex(0);
myResourceNameValidator = ResourceNameValidator.create(false, existing, ResourceType.STRING);
init();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:NewStringKeyDialog.java
示例3: updateContent
import org.jdesktop.swingx.combobox.ListComboBoxModel; //导入依赖的package包/类
private void updateContent() {
if (myCurrentModule == null || myCurrentModule.isDisposed()) {
return;
}
getComboBox().setModel(new ListComboBoxModel(myTestingConfigurations));
if (myCurrentAndroidConfiguration == null) {
CloudConfiguration cloudConfiguration = myLastChosenCloudConfigurationPerKind.get(myConfigurationKind);
if (cloudConfiguration != null && myTestingConfigurations.contains(cloudConfiguration)) {
getComboBox().setSelectedItem(cloudConfiguration);
}
} else {
Map<Pair<Kind, Module>, CloudConfiguration> matrixConfigurationByModuleCache =
myMatrixConfigurationByAndroidConfigurationAndModuleCache.get(myCurrentAndroidConfiguration);
if (matrixConfigurationByModuleCache != null) {
CloudConfiguration selectedConfig = matrixConfigurationByModuleCache.get(Pair.create(myConfigurationKind, myCurrentModule));
if (selectedConfig != null && myTestingConfigurations.contains(selectedConfig)) {
getComboBox().setSelectedItem(selectedConfig);
}
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:CloudConfigurationComboBox.java
示例4: interactiveAutoScrollOnSelectionList
import org.jdesktop.swingx.combobox.ListComboBoxModel; //导入依赖的package包/类
/**
* #703-swingx: select date doesn't ensure visibility of selected.
* #712-swingx: support optional auto-scroll on selection.
*
* compare with core list: doesn't scroll as well.
*
*/
public void interactiveAutoScrollOnSelectionList() {
// add hoc model
SortedSet<Date> dates = getDates();
final JXList us = new JXList(new ListComboBoxModel<Date>(new ArrayList<Date>(dates)));
us.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
JXFrame frame = wrapWithScrollingInFrame(us, "list - autoscroll on selection");
Action next = new AbstractActionExt("select last + 1") {
public void actionPerformed(ActionEvent e) {
int last = us.getLastVisibleIndex();
us.setSelectedIndex(last + 1);
// shouldn't effect scrolling state
us.revalidate();
// client code must trigger
// us.ensureIndexIsVisible(last+1);
}
};
addAction(frame, next);
frame.pack();
frame.setVisible(true);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:31,代码来源:SelectionIssues.java
示例5: getStripingOptionsModel
import org.jdesktop.swingx.combobox.ListComboBoxModel; //导入依赖的package包/类
private ComboBoxModel getStripingOptionsModel() {
List<HighlighterInfo> info = new ArrayList<HighlighterInfo>();
info.add(new HighlighterInfo("No Striping", null));
info.add(new HighlighterInfo("Alternating UI-Dependent",
HighlighterFactory.createAlternateStriping()));
info.add(new HighlighterInfo("Alternating Groups (2) UI-Dependent",
HighlighterFactory.createAlternateStriping(2)));
info.add(new HighlighterInfo("Alternating Groups (3) UI-Dependent",
HighlighterFactory.createAlternateStriping(3)));
Color lightBlue = new Color(0xC0D9D9);
Color gold = new Color(0xDBDB70);
info.add(new HighlighterInfo("Alternating Blue-Gold",
HighlighterFactory.createAlternateStriping(lightBlue, gold)));
info.add(new HighlighterInfo("Alternating Groups (2) Blue-Gold",
HighlighterFactory.createAlternateStriping(lightBlue, gold, 2)));
info.add(new HighlighterInfo("Alternating Groups (3) Blue-Gold",
HighlighterFactory.createAlternateStriping(lightBlue, gold, 3)));
return new ListComboBoxModel<HighlighterInfo>(info);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:22,代码来源:HighlighterDemo.java
示例6: getPredicateOptionsModel
import org.jdesktop.swingx.combobox.ListComboBoxModel; //导入依赖的package包/类
private ComboBoxModel getPredicateOptionsModel() {
List<HighlightPredicateInfo> info = new ArrayList<HighlightPredicateInfo>();
info.add(new HighlightPredicateInfo("Always Off", HighlightPredicate.NEVER));
info.add(new HighlightPredicateInfo("Always On", HighlightPredicate.ALWAYS));
info.add(new HighlightPredicateInfo("Focused Cell", HighlightPredicate.HAS_FOCUS));
info.add(new HighlightPredicateInfo("Non-Leaf Node", HighlightPredicate.IS_FOLDER));
info.add(new HighlightPredicateInfo("Leaf Node", HighlightPredicate.IS_LEAF));
info.add(new HighlightPredicateInfo("Rollover Row", HighlightPredicate.ROLLOVER_ROW));
info.add(new HighlightPredicateInfo("Columns 0 and 3",
new HighlightPredicate.ColumnHighlightPredicate(0, 3)));
info.add(new HighlightPredicateInfo("Node Depth Columns 0 and 3",
new HighlightPredicate.DepthHighlightPredicate(0, 3)));
info.add(new HighlightPredicateInfo("JButton Type",
new HighlightPredicate.TypeHighlightPredicate(JButton.class)));
return new ListComboBoxModel<HighlightPredicateInfo>(info);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:18,代码来源:HighlighterDemo.java
示例7: getTableCellEditorComponent
import org.jdesktop.swingx.combobox.ListComboBoxModel; //导入依赖的package包/类
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
final JComboBox comboBox = (JComboBox) this.getComponent();
comboBox.setEditable(true);
comboBox.setModel(new ListComboBoxModel(AormConstants.dbTypes));
// String old = (String) value;
comboBox.setSelectedItem(value);
return comboBox;
}
开发者ID:Jamling,项目名称:Android-ORM-ASPlugin,代码行数:10,代码来源:FieldsTypeCellEditor.java
示例8: getHighlighterOptionsModel
import org.jdesktop.swingx.combobox.ListComboBoxModel; //导入依赖的package包/类
private ComboBoxModel getHighlighterOptionsModel() {
List<HighlighterInfo> info = new ArrayList<HighlighterInfo>();
info.add(new HighlighterInfo("No Additional Highlighter", null));
info.add(new HighlighterInfo("Green Border",
new BorderHighlighter(BorderFactory.createLineBorder(Color.GREEN, 1))));
info.add(new HighlighterInfo("Blue Border",
new BorderHighlighter(BorderFactory.createLineBorder(Color.BLUE, 1))));
info.add(new HighlighterInfo("Red Text",
new ColorHighlighter(null, Color.RED)));
info.add(new HighlighterInfo("Purple Text",
new ColorHighlighter(null, new Color(0x80, 0x00, 0x80))));
info.add(new HighlighterInfo("Blended Red Background",
new ColorHighlighter(new Color(255, 0, 0, 127), null)));
info.add(new HighlighterInfo("Blended Green Background",
new ColorHighlighter(new Color(0, 180, 0, 80), null)));
info.add(new HighlighterInfo("Green Orb Icon",
new IconHighlighter(Application.getInstance().getContext()
.getResourceMap(HighlighterDemo.class).getIcon("greenOrb"))));
info.add(new HighlighterInfo("Aerith Gradient Painter",
new PainterHighlighter(new MattePainter(PaintUtils.AERITH, true))));
info.add(new HighlighterInfo("Star Shape Painter",
new PainterHighlighter(new ShapePainter(
ShapeUtils.generatePolygon(5, 10, 5, true), PaintUtils.NIGHT_GRAY_LIGHT))));
info.add(new HighlighterInfo("10pt. Bold Dialog Font",
new FontHighlighter(new Font("Dialog", Font.BOLD, 10))));
info.add(new HighlighterInfo("Italic Font",
new DerivedFontHighlighter(Font.ITALIC)));
info.add(new HighlighterInfo("Trailing Alignment",
new AlignmentHighlighter(SwingConstants.TRAILING)));
info.add(new HighlighterInfo("Show As Disabled",
new EnabledHighlighter(false)));
return new ListComboBoxModel<HighlighterInfo>(info);
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:35,代码来源:HighlighterDemo.java
示例9: bind
import org.jdesktop.swingx.combobox.ListComboBoxModel; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
protected void bind() {
strictComboBox.setModel(new ListComboBoxModel<String>(names));
nonStrictComboBox.setModel(new ListComboBoxModel<String>(names));
airportComboBox.setModel(new ListComboBoxModel<Airport>(Airports.ALL_AIRPORTS));
//use the combo box model because it's SwingX
list.setModel(new ListComboBoxModel<String>(names));
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:11,代码来源:AutoCompleteDemo.java
示例10: appendShopwareVersions
import org.jdesktop.swingx.combobox.ListComboBoxModel; //导入依赖的package包/类
private void appendShopwareVersions()
{
comboVersions.setModel(new ListComboBoxModel<>(new ArrayList<ShopwareInstallerVersion>()));
ApplicationManager.getApplication().executeOnPooledThread(() -> {
final List<ShopwareInstallerVersion> shopwareInstallerVersions1 = getVersions();
if (shopwareInstallerVersions1 != null) {
UIUtil.invokeLaterIfNeeded(() -> comboVersions.setModel(new ListComboBoxModel<>(shopwareInstallerVersions1)));
}
});
}
开发者ID:Haehnchen,项目名称:idea-php-shopware-plugin,代码行数:14,代码来源:ShopwareInstallerForm.java
示例11: appendSymfonyVersions
import org.jdesktop.swingx.combobox.ListComboBoxModel; //导入依赖的package包/类
private void appendSymfonyVersions()
{
comboVersions.setModel(new ListComboBoxModel<>(new ArrayList<>()));
ApplicationManager.getApplication().executeOnPooledThread(() -> {
final List<SymfonyInstallerVersion> symfonyInstallerVersions1 = getVersions();
if (symfonyInstallerVersions1 != null) {
UIUtil.invokeLaterIfNeeded(() -> comboVersions.setModel(new ListComboBoxModel<>(symfonyInstallerVersions1)));
}
});
}
开发者ID:Haehnchen,项目名称:idea-php-symfony2-plugin,代码行数:14,代码来源:SymfonyInstallerForm.java
示例12: BrowserSettingsPanel
import org.jdesktop.swingx.combobox.ListComboBoxModel; //导入依赖的package包/类
public BrowserSettingsPanel() {
alternativeBrowserPathField.addBrowseFolderListener(IdeBundle.message("title.select.path.to.browser"), null, null, APP_FILE_CHOOSER_DESCRIPTOR);
defaultBrowserPanel.setBorder(TitledSeparator.EMPTY_BORDER);
ArrayList<DefaultBrowserPolicy> defaultBrowserPolicies = new ArrayList<DefaultBrowserPolicy>();
if (BrowserLauncherAppless.canUseSystemDefaultBrowserPolicy()) {
defaultBrowserPolicies.add(DefaultBrowserPolicy.SYSTEM);
}
defaultBrowserPolicies.add(DefaultBrowserPolicy.FIRST);
defaultBrowserPolicies.add(DefaultBrowserPolicy.ALTERNATIVE);
//noinspection Since15,unchecked
defaultBrowserPolicyComboBox.setModel(new ListComboBoxModel<DefaultBrowserPolicy>(defaultBrowserPolicies));
defaultBrowserPolicyComboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(@NotNull ItemEvent e) {
boolean customPathEnabled = e.getItem() == DefaultBrowserPolicy.ALTERNATIVE;
if (e.getStateChange() == ItemEvent.DESELECTED) {
if (customPathEnabled) {
customPathValue = alternativeBrowserPathField.getText();
}
}
else if (e.getStateChange() == ItemEvent.SELECTED) {
alternativeBrowserPathField.setEnabled(customPathEnabled);
updateCustomPathTextFieldValue((DefaultBrowserPolicy)e.getItem());
}
}
});
defaultBrowserPolicyComboBox.setRenderer(new ListCellRendererWrapper<DefaultBrowserPolicy>() {
@Override
public void customize(JList list, DefaultBrowserPolicy value, int index, boolean selected, boolean hasFocus) {
String name;
switch (value) {
case SYSTEM:
name = "System default";
break;
case FIRST:
name = "First listed";
break;
case ALTERNATIVE:
name = "Custom path";
break;
default:
throw new IllegalStateException();
}
setText(name);
}
});
if (UIUtil.isUnderAquaLookAndFeel()) {
defaultBrowserPolicyComboBox.setBorder(new EmptyBorder(3, 0, 0, 0));
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:56,代码来源:BrowserSettingsPanel.java
示例13: getComboBoxModel
import org.jdesktop.swingx.combobox.ListComboBoxModel; //导入依赖的package包/类
public static ComboBoxModel getComboBoxModel(Component root) {
return new ListComboBoxModel<Component>(getComponents(root));
}
开发者ID:RockManJoe64,项目名称:swingx,代码行数:4,代码来源:ComponentModels.java
注:本文中的org.jdesktop.swingx.combobox.ListComboBoxModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论