本文整理汇总了Java中org.intellij.lang.annotations.JdkConstants.ListSelectionMode方法的典型用法代码示例。如果您正苦于以下问题:Java JdkConstants.ListSelectionMode方法的具体用法?Java JdkConstants.ListSelectionMode怎么用?Java JdkConstants.ListSelectionMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.intellij.lang.annotations.JdkConstants
的用法示例。
在下文中一共展示了JdkConstants.ListSelectionMode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SelectFromListDialog
import org.intellij.lang.annotations.JdkConstants; //导入方法依赖的package包/类
public SelectFromListDialog(Project project,
Object[] objects,
ToStringAspect toStringAspect,
String title,
@JdkConstants.ListSelectionMode int selectionMode) {
super(project, true);
myToStringAspect = toStringAspect;
myList.setSelectionMode(selectionMode);
setTitle(title);
for (Object object : objects) {
myModel.addElement(object);
}
myList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
setOKActionEnabled(myList.getSelectedValues().length > 0);
}
});
myList.setSelectedIndex(0);
myList.setCellRenderer(new ColoredListCellRenderer(){
protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean hasFocus) {
append(myToStringAspect.getToStirng(value),
new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, list.getForeground()));
}
});
init();
}
示例2: getTreeSelectionModeFromListSelectionMode
import org.intellij.lang.annotations.JdkConstants; //导入方法依赖的package包/类
@JdkConstants.TreeSelectionMode
private static int getTreeSelectionModeFromListSelectionMode(@JdkConstants.ListSelectionMode int mode) {
switch (mode) {
case ListSelectionModel.SINGLE_SELECTION: return TreeSelectionModel.SINGLE_TREE_SELECTION;
case ListSelectionModel.SINGLE_INTERVAL_SELECTION: return TreeSelectionModel.CONTIGUOUS_TREE_SELECTION;
case ListSelectionModel.MULTIPLE_INTERVAL_SELECTION: return TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION;
}
throw new IllegalArgumentException("Illegal selection mode: " + mode);
}
示例3: setSelectionMode
import org.intellij.lang.annotations.JdkConstants; //导入方法依赖的package包/类
public void setSelectionMode(@JdkConstants.ListSelectionMode int mode) {
myViewer.setSelectionMode(mode);
}
示例4: setSelectionMode
import org.intellij.lang.annotations.JdkConstants; //导入方法依赖的package包/类
public void setSelectionMode(@JdkConstants.ListSelectionMode int mode) {
myList.setSelectionMode(mode);
myTree.getSelectionModel().setSelectionMode(getTreeSelectionModeFromListSelectionMode(mode));
}