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


Java DialogWrapper.showAndGet方法代碼示例

本文整理匯總了Java中com.intellij.openapi.ui.DialogWrapper.showAndGet方法的典型用法代碼示例。如果您正苦於以下問題:Java DialogWrapper.showAndGet方法的具體用法?Java DialogWrapper.showAndGet怎麽用?Java DialogWrapper.showAndGet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.ui.DialogWrapper的用法示例。


在下文中一共展示了DialogWrapper.showAndGet方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: selectFontButtonActionPerformed

import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
private void selectFontButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectFontButtonActionPerformed
    final TextFontPanel textFontPanel = new TextFontPanel();

    DefaultControlPanel textFontControlPanel = new DefaultControlPanel();
    textFontPanel.setStoredFont(deltaHexFont);
    textFontPanel.setVisible(true);
    JPanel dialogPanel = WindowUtils.createDialogPanel(textFontPanel, textFontControlPanel);
    WindowUtils.assignGlobalKeyListener(dialogPanel, textFontControlPanel.createOkCancelListener());
    final DialogWrapper dialog = DialogUtils.createDialog(dialogPanel, "Select Font");

    textFontControlPanel.setHandler(new DefaultControlHandler() {
        @Override
        public void controlActionPerformed(DefaultControlHandler.ControlActionType actionType) {
            if (actionType == DefaultControlHandler.ControlActionType.OK) {
                deltaHexFont = textFontPanel.getStoredFont();
                updateFontTextField();
                useDefaultFontCheckBox.setSelected(false);
            }

            dialog.close(0);
        }
    });
    dialog.showAndGet();
}
 
開發者ID:hajdam,項目名稱:deltahex-intellij-plugin,代碼行數:25,代碼來源:DeltaHexOptionsPanel.java

示例2: createPatch

import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
public static void createPatch(Project project, String commitMessage, List<Change> changeCollection) {
  project = project == null ? ProjectManager.getInstance().getDefaultProject() : project;
  final CreatePatchCommitExecutor executor = CreatePatchCommitExecutor.getInstance(project);
  CommitSession commitSession = executor.createCommitSession();
  if (commitSession instanceof CommitSessionContextAware) {
    ((CommitSessionContextAware)commitSession).setContext(new CommitContext());
  }
  DialogWrapper sessionDialog = new SessionDialog(executor.getActionText(),
                                                  project,
                                                  commitSession,
                                                  changeCollection,
                                                  commitMessage);
  if (!sessionDialog.showAndGet()) {
    return;
  }
  preloadContent(project, changeCollection);

  commitSession.execute(changeCollection, commitMessage);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:20,代碼來源:CreatePatchFromChangesAction.java

示例3: editConfigurable

import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
private static boolean editConfigurable(@Nullable Component parent,
                                        @Nullable Project project,
                                        @NotNull Configurable configurable,
                                        String dimensionKey,
                                        @Nullable final Runnable advancedInitialization,
                                        boolean showApplyButton) {
  final DialogWrapper editor;
  if (parent == null) {
    editor = Registry.is("ide.new.settings.view")
             ? new SettingsDialog(project, dimensionKey, configurable, showApplyButton, false)
             : new SingleConfigurableEditor(project, configurable, dimensionKey, showApplyButton);
  }
  else {
    editor = Registry.is("ide.new.settings.view")
             ? new SettingsDialog(parent, dimensionKey, configurable, showApplyButton, false)
             : new SingleConfigurableEditor(parent, configurable, dimensionKey, showApplyButton);
  }
  if (advancedInitialization != null) {
    new UiNotifyConnector.Once(editor.getContentPane(), new Activatable.Adapter() {
      @Override
      public void showNotify() {
        advancedInitialization.run();
      }
    });
  }
  return editor.showAndGet();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:28,代碼來源:ShowSettingsUtilImpl.java

示例4: showConflictsDialog

import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
@Override
public boolean showConflictsDialog(@NotNull final MultiMap<PyClass, PyMemberInfo<?>> duplicatesConflict,
                                   @NotNull final Collection<PyMemberInfo<?>> dependenciesConflicts) {
  Preconditions
    .checkArgument(!(duplicatesConflict.isEmpty() && dependenciesConflicts.isEmpty()), "Can't show dialog for empty conflicts");
  final DialogWrapper conflictsDialog = new MembersConflictDialog(myProject, duplicatesConflict, dependenciesConflicts);
  return conflictsDialog.showAndGet();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:MembersBasedViewSwingImpl.java

示例5: showDialog

import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
@Nullable
public AntInstallation showDialog(JComponent parent) {
  final DialogWrapper dialog = new MyDialog(parent);
  if (!dialog.showAndGet()) {
    return null;
  }

  apply();
  return myForm.getSelectedAnt();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:AntSetPanel.java

示例6: handleErrorsOnSave

import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
private void handleErrorsOnSave(@NotNull Map<Document, IOException> failures) {
  if (ApplicationManager.getApplication().isUnitTestMode()) {
    IOException ioException = ContainerUtil.getFirstItem(failures.values());
    if (ioException != null) {
      throw new RuntimeException(ioException);
    }
    return;
  }
  for (IOException exception : failures.values()) {
    LOG.warn(exception);
  }

  final String text = StringUtil.join(failures.values(), new Function<IOException, String>() {
    @Override
    public String fun(IOException e) {
      return e.getMessage();
    }
  }, "\n");

  final DialogWrapper dialog = new DialogWrapper(null) {
    {
      init();
      setTitle(UIBundle.message("cannot.save.files.dialog.title"));
    }

    @Override
    protected void createDefaultActions() {
      super.createDefaultActions();
      myOKAction.putValue(Action.NAME, UIBundle
        .message(myOnClose ? "cannot.save.files.dialog.ignore.changes" : "cannot.save.files.dialog.revert.changes"));
      myOKAction.putValue(DEFAULT_ACTION, null);

      if (!myOnClose) {
        myCancelAction.putValue(Action.NAME, CommonBundle.getCloseButtonText());
      }
    }

    @Override
    protected JComponent createCenterPanel() {
      final JPanel panel = new JPanel(new BorderLayout(0, 5));

      panel.add(new JLabel(UIBundle.message("cannot.save.files.dialog.message")), BorderLayout.NORTH);

      final JTextPane area = new JTextPane();
      area.setText(text);
      area.setEditable(false);
      area.setMinimumSize(new Dimension(area.getMinimumSize().width, 50));
      panel.add(new JBScrollPane(area, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER),
                BorderLayout.CENTER);

      return panel;
    }
  };

  if (dialog.showAndGet()) {
    for (Document document : failures.keySet()) {
      reloadFromDisk(document);
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:61,代碼來源:FileDocumentManagerImpl.java

示例7: show

import com.intellij.openapi.ui.DialogWrapper; //導入方法依賴的package包/類
public boolean show() {
  DialogWrapper dialog = new DialogWrapper(true) {
    {
      setTitle("Registry");
      setModal(true);
      init();
      revaliateActions();
    }

    private AbstractAction myCloseAction;

    @Override
    protected JComponent createCenterPanel() {
      return myContent;
    }

    @Override
    protected void dispose() {
      super.dispose();
      RegistryUi.this.dispose();
    }

    @Override
    protected String getDimensionServiceKey() {
      return "Registry";
    }


    @Override
    public JComponent getPreferredFocusedComponent() {
      return myTable;
    }

    @NotNull
    @Override
    protected Action[] createActions() {
      return new Action[]{myRestoreDefaultsAction, myCloseAction};
    }

    @Override
    protected void createDefaultActions() {
      super.createDefaultActions();
      myCloseAction = new AbstractAction("Close") {
        @Override
        public void actionPerformed(@NotNull ActionEvent e) {
          processClose();
          doOKAction();
        }
      };
      myCloseAction.putValue(DialogWrapper.DEFAULT_ACTION, true);
    }

    @Override
    public void doCancelAction() {
      final TableCellEditor cellEditor = myTable.getCellEditor();
      if (cellEditor != null) {
        cellEditor.stopCellEditing();
      }
      processClose();
      super.doCancelAction();
    }
  };

  return dialog.showAndGet();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:66,代碼來源:RegistryUi.java


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