本文整理汇总了Java中com.intellij.ui.SortedListModel类的典型用法代码示例。如果您正苦于以下问题:Java SortedListModel类的具体用法?Java SortedListModel怎么用?Java SortedListModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SortedListModel类属于com.intellij.ui包,在下文中一共展示了SortedListModel类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CreateGradleLibraryFromFilesDialog
import com.intellij.ui.SortedListModel; //导入依赖的package包/类
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();
}
示例2: GroupList
import com.intellij.ui.SortedListModel; //导入依赖的package包/类
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);
}
示例3: SearchSupport
import com.intellij.ui.SortedListModel; //导入依赖的package包/类
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);
}
示例4: GroupList
import com.intellij.ui.SortedListModel; //导入依赖的package包/类
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);
}
示例5: run
import com.intellij.ui.SortedListModel; //导入依赖的package包/类
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();
}
示例6: SortedListBinding
import com.intellij.ui.SortedListModel; //导入依赖的package包/类
public SortedListBinding(JList list, ListProperty<T> property, Comparator<T> comparator) {
super(property, list);
list.setModel(new SortedListModel<T>(comparator));
}
示例7: getModel
import com.intellij.ui.SortedListModel; //导入依赖的package包/类
private SortedListModel<T> getModel() {
return ((SortedListModel<T>)getList().getModel());
}