本文整理汇总了Java中com.intellij.ui.speedSearch.NameFilteringListModel类的典型用法代码示例。如果您正苦于以下问题:Java NameFilteringListModel类的具体用法?Java NameFilteringListModel怎么用?Java NameFilteringListModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NameFilteringListModel类属于com.intellij.ui.speedSearch包,在下文中一共展示了NameFilteringListModel类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: propertyChange
import com.intellij.ui.speedSearch.NameFilteringListModel; //导入依赖的package包/类
@Override
public void propertyChange(@NotNull PropertyChangeEvent evt) {
if (project.isDisposed()) {
myPopup.cancel();
return;
}
((NameFilteringListModel)files.getModel()).refilter();
((NameFilteringListModel)toolWindows.getModel()).refilter();
if (files.getModel().getSize() + toolWindows.getModel().getSize() == 0) {
toolWindows.getEmptyText().setText("");
files.getEmptyText().setText("Press 'Enter' to search in Project");
}
else {
files.getEmptyText().setText(StatusText.DEFAULT_EMPTY_TEXT);
toolWindows.getEmptyText().setText(StatusText.DEFAULT_EMPTY_TEXT);
}
}
示例2: propertyChange
import com.intellij.ui.speedSearch.NameFilteringListModel; //导入依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
final MyList list = getSelectedList();
final Object value = list.getSelectedValue();
((NameFilteringListModel)files.getModel()).refilter();
((NameFilteringListModel)toolWindows.getModel()).refilter();
if (files.getModel().getSize() + toolWindows.getModel().getSize() == 0) {
toolWindows.getEmptyText().setText("");
files.getEmptyText().setText("Press 'Enter' to search in Project");
} else {
files.getEmptyText().setText(StatusText.DEFAULT_EMPTY_TEXT);
toolWindows.getEmptyText().setText(StatusText.DEFAULT_EMPTY_TEXT);
}
files.repaint();
toolWindows.repaint();
getSelectedList(list).setSelectedValue(value, true);
}
示例3: propertyChange
import com.intellij.ui.speedSearch.NameFilteringListModel; //导入依赖的package包/类
@Override
public void propertyChange(@Nonnull PropertyChangeEvent evt) {
if (project.isDisposed()) {
myPopup.cancel();
return;
}
((NameFilteringListModel)files.getModel()).refilter();
((NameFilteringListModel)toolWindows.getModel()).refilter();
if (files.getModel().getSize() + toolWindows.getModel().getSize() == 0) {
toolWindows.getEmptyText().setText("");
files.getEmptyText().setText("Press 'Enter' to search in Project");
}
else {
files.getEmptyText().setText(StatusText.DEFAULT_EMPTY_TEXT);
toolWindows.getEmptyText().setText(StatusText.DEFAULT_EMPTY_TEXT);
}
}
示例4: getDataModel
import com.intellij.ui.speedSearch.NameFilteringListModel; //导入依赖的package包/类
@Nullable
public static DefaultListModel getDataModel(AnActionEvent e) {
final JList list = getList(e);
if (list != null) {
ListModel model = list.getModel();
if (model instanceof NameFilteringListModel) {
model = ((NameFilteringListModel)model).getOriginalModel();
if (model instanceof DefaultListModel) {
return (DefaultListModel)model;
}
}
}
return null;
}
示例5: removeElementAt
import com.intellij.ui.speedSearch.NameFilteringListModel; //导入依赖的package包/类
private static void removeElementAt(@NotNull JList jList, int index) {
final ListModel model = jList.getModel();
if (model instanceof DefaultListModel) {
((DefaultListModel)model).removeElementAt(index);
}
else if (model instanceof NameFilteringListModel) {
((NameFilteringListModel)model).remove(index);
}
else {
throw new IllegalArgumentException("Wrong list model " + model.getClass());
}
}
示例6: replaceModel
import com.intellij.ui.speedSearch.NameFilteringListModel; //导入依赖的package包/类
@Override
protected void replaceModel(@NotNull List<PsiElement> data) {
final Object selectedValue = myComponent.getSelectedValue();
final int index = myComponent.getSelectedIndex();
((NameFilteringListModel)myComponent.getModel()).replaceAll(data);
if (index == 0) {
myComponent.setSelectedIndex(0);
}
else {
myComponent.setSelectedValue(selectedValue, true);
}
}
示例7: removeElementAt
import com.intellij.ui.speedSearch.NameFilteringListModel; //导入依赖的package包/类
private static void removeElementAt(JList jList, int index) {
final ListModel model = jList.getModel();
if (model instanceof DefaultListModel) {
((DefaultListModel)model).removeElementAt(index);
} else if (model instanceof NameFilteringListModel) {
((NameFilteringListModel)model).remove(index);
} else {
throw new IllegalArgumentException("Wrong list model " + model.getClass());
}
}
示例8: removeElementAt
import com.intellij.ui.speedSearch.NameFilteringListModel; //导入依赖的package包/类
private static void removeElementAt(@Nonnull JList jList, int index) {
final ListModel model = jList.getModel();
if (model instanceof DefaultListModel) {
((DefaultListModel)model).removeElementAt(index);
}
else if (model instanceof NameFilteringListModel) {
((NameFilteringListModel)model).remove(index);
}
else {
throw new IllegalArgumentException("Wrong list model " + model.getClass());
}
}
示例9: replaceModel
import com.intellij.ui.speedSearch.NameFilteringListModel; //导入依赖的package包/类
@Override
protected void replaceModel(@Nonnull List<PsiElement> data) {
final Object selectedValue = myComponent.getSelectedValue();
final int index = myComponent.getSelectedIndex();
((NameFilteringListModel)myComponent.getModel()).replaceAll(data);
if (index == 0) {
myComponent.setSelectedIndex(0);
}
else {
myComponent.setSelectedValue(selectedValue, true);
}
}