本文整理汇总了Java中com.intellij.usages.ConfigurableUsageTarget类的典型用法代码示例。如果您正苦于以下问题:Java ConfigurableUsageTarget类的具体用法?Java ConfigurableUsageTarget怎么用?Java ConfigurableUsageTarget使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigurableUsageTarget类属于com.intellij.usages包,在下文中一共展示了ConfigurableUsageTarget类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAll
import com.intellij.usages.ConfigurableUsageTarget; //导入依赖的package包/类
@NotNull
public List<ConfigurableUsageTarget> getAll() {
synchronized (myHistory) {
List<ConfigurableUsageTarget> result = ContainerUtil.newArrayList();
final Set<ConfigurableUsageTarget> entries = myHistory.keySet();
for (Iterator<ConfigurableUsageTarget> iterator = entries.iterator(); iterator.hasNext(); ) {
final ConfigurableUsageTarget target = iterator.next();
if (!target.isValid()) {
iterator.remove();
} else {
result.add(target);
}
}
return result;
}
}
示例2: canShowSettings
import com.intellij.usages.ConfigurableUsageTarget; //导入依赖的package包/类
private boolean canShowSettings(UsageView usageView) {
if (!(usageView instanceof UsageViewImpl)) {
return false;
}
UsageViewImpl usageViewImpl = (UsageViewImpl) usageView;
return stream(usageViewImpl.getTargets())
.anyMatch(t -> t instanceof ConfigurableUsageTarget);
}
示例3: add
import com.intellij.usages.ConfigurableUsageTarget; //导入依赖的package包/类
public void add(@NotNull ConfigurableUsageTarget usageTarget) {
final String descriptiveName = usageTarget.getLongDescriptiveName();
synchronized (myHistory) {
final Set<Map.Entry<ConfigurableUsageTarget, String>> entries = myHistory.entrySet();
for (Iterator<Map.Entry<ConfigurableUsageTarget, String>> iterator = entries.iterator(); iterator.hasNext(); ) {
if (iterator.next().getValue().equals(descriptiveName)) {
iterator.remove();
}
}
myHistory.put(usageTarget, descriptiveName);
}
}
示例4: add
import com.intellij.usages.ConfigurableUsageTarget; //导入依赖的package包/类
public void add(@Nonnull ConfigurableUsageTarget usageTarget) {
final String descriptiveName = usageTarget.getLongDescriptiveName();
ContainerUtil.retainAll(myHistory, new Condition<ConfigurableUsageTarget>() {
@Override
public boolean value(ConfigurableUsageTarget existing) {
return !existing.getLongDescriptiveName().equals(descriptiveName);
}
});
myHistory.add(usageTarget);
// todo configure history depth limit
if (myHistory.size() > 15) {
myHistory.remove(0);
}
}
示例5: getTarget
import com.intellij.usages.ConfigurableUsageTarget; //导入依赖的package包/类
public ConfigurableUsageTarget getTarget() {
return new MyUsageTarget();
}
示例6: removeEldestEntry
import com.intellij.usages.ConfigurableUsageTarget; //导入依赖的package包/类
@Override
protected boolean removeEldestEntry(Map.Entry<ConfigurableUsageTarget, String> eldest) {
// todo configure history depth limit
return size() > 15;
}
示例7: getAll
import com.intellij.usages.ConfigurableUsageTarget; //导入依赖的package包/类
@Nonnull
public List<ConfigurableUsageTarget> getAll() {
removeInvalidElementsFromHistory();
return Collections.unmodifiableList(myHistory);
}
示例8: removeInvalidElementsFromHistory
import com.intellij.usages.ConfigurableUsageTarget; //导入依赖的package包/类
private void removeInvalidElementsFromHistory() {
for (ConfigurableUsageTarget target : myHistory) {
if (!target.isValid()) myHistory.remove(target);
}
}