Java 类com.intellij.ui.SortedListModel 实例源码

项目:intellij-ce-playground    文件:CreateLibraryFromFilesAction.java   
public CreateGradleLibraryFromFilesDialog(@NotNull Project project, @NotNull List<OrderRoot> roots) {
  super(project, true);
  setTitle(COMMAND_TITLE);
  myProject = project;
  myRoots = roots;
  mySettingsFile = GradleSettingsFile.get(myProject);

  final FormBuilder builder = LibraryNameAndLevelPanel.createFormBuilder();
  myModulesComboBox = new ModulesComboBox();
  myModulesComboBox.fillModules(myProject);
  myModulesComboBox.setSelectedModule(findModule(roots));
  for (Iterator iter = ((SortedListModel)myModulesComboBox.getModel()).iterator(); iter.hasNext(); ) {
    Module module = (Module)iter.next();
    String path = GradleSettingsFile.getModuleGradlePath(module);
    if (path == null || !mySettingsFile.hasBuildFile(path)) {
      iter.remove();
    }
  }
  builder.addLabeledComponent("&Add to module:", myModulesComboBox);
  myPanel = builder.getPanel();
  init();
}
项目:intellij-ce-playground    文件:GroupList.java   
public GroupList(PsiClass[] classes)
{
    super(new BorderLayout());
    SortedListModel<String> model = new SortedListModel<String>(new Comparator<String>()
    {
        public int compare(String s1, String s2) {
            return s1.compareTo(s2);
        }
    });
    list = new JBList(model);
    Set<String> groups = TestNGUtil.getAnnotationValues("groups", classes);
  String[] array = ArrayUtil.toStringArray(groups);
    Arrays.sort(array);
    model.addAll(array);
    add(ScrollPaneFactory.createScrollPane(list));
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    ScrollingUtil.ensureSelectionExists(list);
}
项目:intellij-ce-playground    文件:SearchSupport.java   
public SearchSupport(EditorTextField textField) {

    myTextField = textField;
    myTextField.getDocument().addDocumentListener(new DocumentAdapter() {
      @Override
      public void documentChanged(DocumentEvent event) {
        onTextChanged();
      }
    });

    //noinspection SSBasedInspection
    SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        myTextField.addKeyListener(new KeyAdapter() {
          public void keyPressed(final KeyEvent e) {
              processListSelection(e);
          }
        });
      }
    });

    myList.setVisibleRowCount(10);
    myListModel = new SortedListModel<T>(null);
    myList.setModel(myListModel);
  }
项目:tools-idea    文件:GroupList.java   
public GroupList(PsiClass[] classes)
{
    super(new BorderLayout());
    SortedListModel<String> model = new SortedListModel<String>(new Comparator<String>()
    {
        public int compare(String s1, String s2) {
            return s1.compareTo(s2);
        }
    });
    list = new JBList(model);
    Set<String> groups = TestNGUtil.getAnnotationValues("groups", classes);
  String[] array = ArrayUtil.toStringArray(groups);
    Arrays.sort(array);
    model.addAll(array);
    add(ScrollPaneFactory.createScrollPane(list));
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    ListScrollingUtil.ensureSelectionExists(list);
}
项目:tools-idea    文件:SearchSupport.java   
public SearchSupport(EditorTextField textField) {

    myTextField = textField;
    myTextField.getDocument().addDocumentListener(new DocumentAdapter() {
      @Override
      public void documentChanged(DocumentEvent event) {
        onTextChanged();
      }
    });

    //noinspection SSBasedInspection
    SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        myTextField.addKeyListener(new KeyAdapter() {
          public void keyPressed(final KeyEvent e) {
              processListSelection(e);
          }
        });
      }
    });

    myList.setVisibleRowCount(10);
    myListModel = new SortedListModel<T>(null);
    myList.setModel(myListModel);
  }
项目:consulo-tasks    文件:SearchSupport.java   
public SearchSupport(EditorTextField textField) {

    myTextField = textField;
    myTextField.getDocument().addDocumentListener(new DocumentAdapter() {
      @Override
      public void documentChanged(DocumentEvent event) {
        onTextChanged();
      }
    });

    //noinspection SSBasedInspection
    SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        myTextField.addKeyListener(new KeyAdapter() {
          public void keyPressed(final KeyEvent e) {
              processListSelection(e);
          }
        });
      }
    });

    myList.setVisibleRowCount(10);
    myListModel = new SortedListModel<T>(null);
    myList.setModel(myListModel);
  }
项目:intellij-mattermost-plugin    文件:MattermostClient.java   
public void run(SortedListModel<MMUserStatus> listModel, String username, String password, String url) throws IOException, URISyntaxException, CertificateException, InterruptedException, UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException {
    MM_URL = url;
    login(username, password);
    users();
    teams();
    userStatus();
    ws = websocket(listModel);
    java.util.Timer timer = new Timer();
    timer.schedule(new TimerTask() {
        @Override
        public void run() {
            try {
                if (ws == null || ws.isClosed()) {
                    Notifications.Bus.notify(new Notification("team", "mattermost websocket", "websocket reconnecting...", NotificationType.INFORMATION));
                    ws = websocket(listModel);
                }
                ws.send("{\"action\":\"get_statuses\",\"seq\":" + (++seq) + "}");
                statusSeq = seq;
            } catch (Throwable t) {
                t.printStackTrace();
                Notifications.Bus.notify(new Notification("team", "mattermost Error", t.getMessage(), NotificationType.ERROR));
            }
        }
    }, 5000, 60000);
    this.listModel = listModel;
    fillListModel();
}
项目:intellij-ce-playground    文件:UIPropertyBinding.java   
public SortedListBinding(JList list, ListProperty<T> property, Comparator<T> comparator) {
  super(property, list);
  list.setModel(new SortedListModel<T>(comparator));
}
项目:intellij-ce-playground    文件:UIPropertyBinding.java   
private SortedListModel<T> getModel() {
  return ((SortedListModel<T>)getList().getModel());
}
项目:tools-idea    文件:UIPropertyBinding.java   
public SortedListBinding(JList list, ListProperty<T> property, Comparator<T> comparator) {
  super(property, list);
  list.setModel(new SortedListModel<T>(comparator));
}
项目:tools-idea    文件:UIPropertyBinding.java   
private SortedListModel<T> getModel() {
  return ((SortedListModel<T>)getList().getModel());
}
项目:consulo-apache-ant    文件:UIPropertyBinding.java   
public SortedListBinding(JList list, ListProperty<T> property, Comparator<T> comparator) {
  super(property, list);
  list.setModel(new SortedListModel<T>(comparator));
}
项目:consulo-apache-ant    文件:UIPropertyBinding.java   
private SortedListModel<T> getModel() {
  return ((SortedListModel<T>)getList().getModel());
}