本文整理匯總了Java中com.intellij.openapi.ui.DialogWrapper.findInstance方法的典型用法代碼示例。如果您正苦於以下問題:Java DialogWrapper.findInstance方法的具體用法?Java DialogWrapper.findInstance怎麽用?Java DialogWrapper.findInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.ui.DialogWrapper
的用法示例。
在下文中一共展示了DialogWrapper.findInstance方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: canShow
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
@Override
public boolean canShow(DiffRequest request) {
final DiffContent[] contents = request.getContents();
final DialogWrapper instance = DialogWrapper.findInstance(IdeFocusManager.getInstance(request.getProject()).getFocusOwner());
if (instance != null && instance.isModal()) return false;
if (contents.length == 2) {
final VirtualFile file1 = contents[0].getFile();
final VirtualFile file2 = contents[1].getFile();
if (file1 != null && file2 != null) {
final FileType type1 = contents[0].getContentType();
final FileType type2 = contents[1].getContentType();
return type1 == type2 && type1 instanceof ArchiveFileType;
}
}
return false;
}
示例2: processFocusLost
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
private void processFocusLost(FocusEvent e) {
final Component opposite = e.getOppositeComponent();
if (myPanel.isInFloatingMode() && opposite != null && DialogWrapper.findInstance(opposite) != null) {
myPanel.hideHint();
return;
}
final boolean nodePopupInactive = !myPanel.isNodePopupActive();
boolean childPopupInactive = !JBPopupFactory.getInstance().isChildPopupFocused(myPanel);
if (nodePopupInactive && childPopupInactive) {
if (opposite != null && opposite != myPanel && !myPanel.isAncestorOf(opposite) && !e.isTemporary()) {
myPanel.setContextComponent(null);
myPanel.hideHint();
}
}
myPanel.updateItems();
}
示例3: isFromModalDialog
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
public static boolean isFromModalDialog(Project project) {
final Component owner = IdeFocusManager.getInstance(project).getFocusOwner();
if (owner != null) {
final DialogWrapper instance = DialogWrapper.findInstance(owner);
return instance != null && instance.isModal();
}
return false;
}
示例4: processDefaultFocusRequest
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
private ActionCallback processDefaultFocusRequest(boolean forced) {
if (ModalityState.NON_MODAL.equals(ModalityState.current())) {
final String activeId = getActiveToolWindowId();
if (isEditorComponentActive() || activeId == null || getToolWindow(activeId) == null) {
activateEditorComponent(forced, true);
}
else {
activateToolWindow(activeId, forced, true);
}
return ActionCallback.DONE;
}
Window activeWindow = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();
if (activeWindow != null) {
JRootPane root = null;
if (activeWindow instanceof JDialog) {
root = ((JDialog)activeWindow).getRootPane();
}
else if (activeWindow instanceof JFrame) {
root = ((JFrame)activeWindow).getRootPane();
}
if (root != null) {
JComponent toFocus = IdeFocusTraversalPolicy.getPreferredFocusedComponent(root);
if (toFocus != null) {
if (DialogWrapper.findInstance(toFocus) != null) {
return ActionCallback.DONE; //IDEA-80929
}
return IdeFocusManager.findInstanceByComponent(toFocus).requestFocus(toFocus, forced);
}
}
}
return ActionCallback.REJECTED;
}
示例5: findWindow
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
private static Window findWindow(Component component) {
DialogWrapper dialogWrapper = DialogWrapper.findInstance(component);
if (dialogWrapper != null) {
return dialogWrapper.getPeer().getWindow();
}
return null;
}
示例6: actionPerformed
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
public void actionPerformed(AnActionEvent e) {
final Navigatable[] navigatableArray = e.getData(CommonDataKeys.NAVIGATABLE_ARRAY);
if (navigatableArray != null && navigatableArray.length > 0) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
public void run() {
OpenSourceUtil.navigate(navigatableArray);
}
});
DialogWrapper dialog = DialogWrapper.findInstance(mySourceComponent);
if (dialog != null && dialog.isModal()) {
dialog.doCancelAction();
}
}
}
示例7: focusLost
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
@Override
public void focusLost(final FocusEvent e) {
if (myPanel.getProject().isDisposed()) {
myPanel.setContextComponent(null);
myPanel.hideHint();
return;
}
final DialogWrapper dialog = DialogWrapper.findInstance(e.getOppositeComponent());
shouldFocusEditor = dialog != null;
if (dialog != null) {
Disposer.register(dialog.getDisposable(), new Disposable() {
@Override
public void dispose() {
if (dialog.getExitCode() == DialogWrapper.CANCEL_EXIT_CODE) {
shouldFocusEditor = false;
}
}
});
}
// required invokeLater since in current call sequence KeyboardFocusManager is not initialized yet
// but future focused component
//noinspection SSBasedInspection
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
processFocusLost(e);
}
});
}
示例8: canFocusChangeFrom
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
@Override
public boolean canFocusChangeFrom(@Nullable Component component) {
DialogWrapper dialog = DialogWrapper.findInstance(component);
return (dialog == null) || (dialog == DialogWrapper.findInstance(myToFocus));
}
示例9: isControlEnterOnDialog
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
private static boolean isControlEnterOnDialog(Component component, Shortcut sc) {
return CONTROL_ENTER.equals(sc)
&& !IdeEventQueue.getInstance().isPopupActive() //avoid Control+Enter in completion
&& DialogWrapper.findInstance(component) != null;
}
示例10: hasModalDialog
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
private static boolean hasModalDialog(MouseEvent e) {
final Component c = e.getComponent();
final DialogWrapper dialog = DialogWrapper.findInstance(c);
return dialog != null && dialog.isModal();
}
示例11: setButtonsVisible
import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
private void setButtonsVisible(boolean visible) {
DialogWrapper window = DialogWrapper.findInstance(this);
if (window instanceof CustomizeIDEWizardDialog) {
((CustomizeIDEWizardDialog)window).setButtonsVisible(visible);
}
}