当前位置: 首页>>代码示例>>Java>>正文


Java JdkConstants.ListSelectionMode方法代码示例

本文整理汇总了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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:SelectFromListDialog.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ChangesTreeList.java

示例3: setSelectionMode

import org.intellij.lang.annotations.JdkConstants; //导入方法依赖的package包/类
public void setSelectionMode(@JdkConstants.ListSelectionMode int mode) {
  myViewer.setSelectionMode(mode);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ChangesBrowser.java

示例4: setSelectionMode

import org.intellij.lang.annotations.JdkConstants; //导入方法依赖的package包/类
public void setSelectionMode(@JdkConstants.ListSelectionMode int mode) {
  myList.setSelectionMode(mode);
  myTree.getSelectionModel().setSelectionMode(getTreeSelectionModeFromListSelectionMode(mode));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ChangesTreeList.java


注:本文中的org.intellij.lang.annotations.JdkConstants.ListSelectionMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。