本文整理汇总了Java中com.intellij.openapi.util.ActionCallback.doWhenDone方法的典型用法代码示例。如果您正苦于以下问题:Java ActionCallback.doWhenDone方法的具体用法?Java ActionCallback.doWhenDone怎么用?Java ActionCallback.doWhenDone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.util.ActionCallback
的用法示例。
在下文中一共展示了ActionCallback.doWhenDone方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: refilterNow
import com.intellij.openapi.util.ActionCallback; //导入方法依赖的package包/类
@Override
protected ActionCallback refilterNow(Object preferredSelection, boolean adjustSelection) {
final List<Object> toRestore = new ArrayList<Object>();
if (myFilter.myContext.isHoldingFilter() && !myWasHoldingFilter && myToExpandOnResetFilter == null) {
myToExpandOnResetFilter = myBuilder.getUi().getExpandedElements();
}
else if (!myFilter.myContext.isHoldingFilter() && myWasHoldingFilter && myToExpandOnResetFilter != null) {
toRestore.addAll(myToExpandOnResetFilter);
myToExpandOnResetFilter = null;
}
myWasHoldingFilter = myFilter.myContext.isHoldingFilter();
ActionCallback result = super.refilterNow(preferredSelection, adjustSelection);
myRefilteringNow = true;
return result.doWhenDone(new Runnable() {
public void run() {
myRefilteringNow = false;
if (!myFilter.myContext.isHoldingFilter() && getSelectedElements().isEmpty()) {
restoreExpandedState(toRestore);
}
}
});
}
示例2: refilterNow
import com.intellij.openapi.util.ActionCallback; //导入方法依赖的package包/类
@Override
protected ActionCallback refilterNow(Object preferredSelection, boolean adjustSelection) {
final List<Object> toRestore = new ArrayList<Object>();
if (myFilter.myContext.isHoldingFilter() && !myWasHoldingFilter && myToExpandOnResetFilter == null) {
myToExpandOnResetFilter = myBuilder.getUi().getExpandedElements();
} else if (!myFilter.myContext.isHoldingFilter() && myWasHoldingFilter && myToExpandOnResetFilter != null) {
toRestore.addAll(myToExpandOnResetFilter);
myToExpandOnResetFilter = null;
}
myWasHoldingFilter = myFilter.myContext.isHoldingFilter();
ActionCallback result = super.refilterNow(preferredSelection, adjustSelection);
myRefilteringNow = true;
return result.doWhenDone(new Runnable() {
public void run() {
myRefilteringNow = false;
if (!myFilter.myContext.isHoldingFilter() && getSelectedElements().isEmpty()) {
restoreExpandedState(toRestore);
}
}
});
}
示例3: restore
import com.intellij.openapi.util.ActionCallback; //导入方法依赖的package包/类
private ActionCallback restore(final int index) {
final ActionCallback result = new ActionCallback();
final Restore action = myActions.get(index);
final ActionCallback actionCalback = action.restoreInGrid();
actionCalback.doWhenDone(new Runnable() {
@Override
public void run() {
if (index < myActions.size() - 1) {
restore(index + 1).notifyWhenDone(result);
} else {
result.setDone();
}
}
});
return result;
}
示例4: selectOrderEntry
import com.intellij.openapi.util.ActionCallback; //导入方法依赖的package包/类
public ActionCallback selectOrderEntry(@NotNull final Module module, @Nullable final OrderEntry orderEntry) {
for (final ModuleStructureExtension extension : ModuleStructureExtension.EP_NAME.getExtensions()) {
final ActionCallback callback = extension.selectOrderEntry(module, orderEntry);
if (callback != null) {
return callback;
}
}
Place p = new Place();
p.putPath(ProjectStructureConfigurable.CATEGORY, this);
Runnable r = null;
final MasterDetailsComponent.MyNode node = findModuleNode(module);
if (node != null) {
p.putPath(TREE_OBJECT, module);
p.putPath(ModuleEditor.SELECTED_EDITOR_NAME, ClasspathEditor.NAME);
r = new Runnable() {
@Override
public void run() {
if (orderEntry != null) {
ModuleEditor moduleEditor = ((ModuleConfigurable)node.getConfigurable()).getModuleEditor();
ModuleConfigurationEditor editor = moduleEditor.getEditor(ClasspathEditor.NAME);
if (editor instanceof ClasspathEditor) {
((ClasspathEditor)editor).selectOrderEntry(orderEntry);
}
}
}
};
}
final ActionCallback result = ProjectStructureConfigurable.getInstance(myProject).navigateTo(p, true);
return r != null ? result.doWhenDone(r) : result;
}
示例5: restoreInGrid
import com.intellij.openapi.util.ActionCallback; //导入方法依赖的package包/类
@Override
public ActionCallback restoreInGrid() {
myRestoringNow = true;
if (myActions.size() == 0) return ActionCallback.DONE;
final ActionCallback topCallback = restore(0);
return topCallback.doWhenDone(new Runnable() {
@Override
public void run() {
myActions.clear();
myRestoringNow = false;
}
});
}