當前位置: 首頁>>代碼示例>>Java>>正文


Java DialogWrapper.findInstance方法代碼示例

本文整理匯總了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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:ArchiveDiffTool.java

示例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();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:20,代碼來源:NavBarListener.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:DirDiffManagerImpl.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:35,代碼來源:ToolWindowManagerImpl.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:UiInspectorAction.java

示例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();
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:15,代碼來源:EditSourceForDialogAction.java

示例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);
    }
  });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:31,代碼來源:NavBarListener.java

示例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));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:FocusCommand.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:IdeKeyEventDispatcher.java

示例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();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:BalloonImpl.java

示例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);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:CustomizePluginsStepPanel.java


注:本文中的com.intellij.openapi.ui.DialogWrapper.findInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。