当前位置: 首页>>代码示例>>Java>>正文


Java DialogBuilder.setCenterPanel方法代码示例

本文整理汇总了Java中com.intellij.openapi.ui.DialogBuilder.setCenterPanel方法的典型用法代码示例。如果您正苦于以下问题:Java DialogBuilder.setCenterPanel方法的具体用法?Java DialogBuilder.setCenterPanel怎么用?Java DialogBuilder.setCenterPanel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.ui.DialogBuilder的用法示例。


在下文中一共展示了DialogBuilder.setCenterPanel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
    cacheFile = new File(Constant.CACHE_PATH);
    if (!cacheFile.exists()) {
        cacheFile.mkdirs();
    }
    long size = FileUtils.sizeOfDirectory(cacheFile);
    DialogBuilder builder = new DialogBuilder();
    builder.setTitle(Constant.TITLE);
    builder.resizable(false);
    builder.setCenterPanel(new JLabel(String.format("Currently occupy storage %.2fM, "
            + "Clean Cache immediately?", size/1024.0/1024.0),
            Messages.getInformationIcon(), SwingConstants.CENTER));
    builder.addOkAction().setText("Clean Now");
    builder.addCancelAction().setText("Cancel");
    builder.setButtonsAlignment(SwingConstants.RIGHT);
    if (builder.show() == 0) {
        clean();
    }
}
 
开发者ID:pengwei1024,项目名称:AndroidSourceViewer,代码行数:21,代码来源:CleanAction.java

示例2: doShowError

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
private static void doShowError(String title, String description, DialogBuilder builder) {
    builder.setTitle(title);
    final JTextArea textArea = new JTextArea();
    textArea.setEditable(false);
    textArea.setText(description);
    textArea.setWrapStyleWord(false);
    textArea.setLineWrap(true);
    final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(textArea);
    scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    final JPanel panel = new JPanel(new BorderLayout(10, 0));
    panel.setPreferredSize(new Dimension(600, 400));
    panel.add(scrollPane, BorderLayout.CENTER);
    panel.add(new JBLabel("Details:", Messages.getErrorIcon(), SwingConstants.LEFT), BorderLayout.NORTH);
    builder.setCenterPanel(panel);
    builder.setButtonsAlignment(SwingConstants.CENTER);
    builder.addOkAction();
    builder.show();
}
 
开发者ID:sertae,项目名称:stylint-plugin,代码行数:19,代码来源:PackagesNotificationPanel.java

示例3: configureTask

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
public boolean configureTask(RunConfiguration runConfiguration, BuildArtifactsBeforeRunTask task) {
  final Artifact[] artifacts = ArtifactManager.getInstance(myProject).getArtifacts();
  Set<ArtifactPointer> pointers = new THashSet<ArtifactPointer>();
  for (Artifact artifact : artifacts) {
    pointers.add(ArtifactPointerManager.getInstance(myProject).createPointer(artifact));
  }
  pointers.addAll(task.getArtifactPointers());
  ArtifactChooser chooser = new ArtifactChooser(new ArrayList<ArtifactPointer>(pointers));
  chooser.markElements(task.getArtifactPointers());
  chooser.setPreferredSize(JBUI.size(400, 300));

  DialogBuilder builder = new DialogBuilder(myProject);
  builder.setTitle(CompilerBundle.message("build.artifacts.before.run.selector.title"));
  builder.setDimensionServiceKey("#BuildArtifactsBeforeRunChooser");
  builder.addOkAction();
  builder.addCancelAction();
  builder.setCenterPanel(chooser);
  builder.setPreferredFocusComponent(chooser);
  if (builder.show() == DialogWrapper.OK_EXIT_CODE) {
    task.setArtifactPointers(chooser.getMarkedElements());
    return true;
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:BuildArtifactsBeforeRunTaskProvider.java

示例4: actionPerformed

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
  final DateFilterComponent dateComponent = new DateFilterComponent(false, DateFormatUtil.getDateFormat().getDelegate());
  VcsLogDateFilter currentFilter = myFilterModel.getFilter();
  if (currentFilter != null) {
    if (currentFilter.getBefore() != null) {
      dateComponent.setBefore(currentFilter.getBefore().getTime());
    }
    if (currentFilter.getAfter() != null) {
      dateComponent.setAfter(currentFilter.getAfter().getTime());
    }
  }

  DialogBuilder db = new DialogBuilder(DateFilterPopupComponent.this);
  db.addOkAction();
  db.setCenterPanel(dateComponent.getPanel());
  db.setPreferredFocusComponent(dateComponent.getPanel());
  db.setTitle("Select Period");
  if (DialogWrapper.OK_EXIT_CODE == db.show()) {
    long after = dateComponent.getAfter();
    long before = dateComponent.getBefore();
    VcsLogDateFilter filter = new VcsLogDateFilterImpl(after > 0 ? new Date(after) : null, before > 0 ? new Date(before) : null);
    myFilterModel.setFilter(filter);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:DateFilterPopupComponent.java

示例5: showDialog

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
private static void showDialog(MergeRequestImpl data) {
  if (LOG.isDebugEnabled()) {
    LOG.debug("MergeTool - dialog");
  }
  DialogBuilder builder = new DialogBuilder(data.getProject());
  builder.setDimensionServiceKey(data.getGroupKey());
  builder.setTitle(data.getWindowTitle());
  Disposable parent = Disposer.newDisposable();
  builder.addDisposable(parent);
  MergePanel2 mergePanel = createMergeComponent(data, builder, parent);
  builder.setCenterPanel(mergePanel.getComponent());
  builder.setPreferredFocusComponent(mergePanel.getPreferredFocusedComponent());
  builder.setHelpId(data.getHelpId());
  int result = builder.show();
  MergeRequestImpl lastData = mergePanel.getMergeRequest();
  if (lastData != null) {
    lastData.setResult(result);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:MergeTool.java

示例6: showDialog

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
private boolean showDialog() {
  DialogBuilder builder = new DialogBuilder(myBuildFile.getProject());
  builder.setCenterPanel(myForm.myWholePanel);
  builder.setDimensionServiceKey(DIMENSION_SERVICE_KEY);
  builder.setPreferredFocusComponent(myForm.getPreferedFocusComponent());
  builder.setTitle(AntBundle.message("build.file.properties.dialog.title"));
  builder.removeAllActions();
  builder.addOkAction();
  builder.addCancelAction();
  builder.setHelpId("reference.dialogs.buildfileproperties");

  boolean isOk = builder.show() == DialogWrapper.OK_EXIT_CODE;
  if (isOk) {
    apply();
  }
  beforeClose();
  return isOk;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:BuildFilePropertiesPanel.java

示例7: showErrorDialog

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
private static void showErrorDialog(@NotNull Project project, @NotNull String operationName, @NotNull List<Change> changes,
                                    @NotNull Collection<String> absolutePaths) {
  String title = "Local Changes Prevent from " + StringUtil.capitalize(operationName);
  String description = getErrorDialogDescription();
  if (changes.isEmpty()) {
    GitUtil.showPathsInDialog(project, absolutePaths, title, description);
  }
  else {
    DialogBuilder builder = new DialogBuilder(project);
    builder.setNorthPanel(new MultiLineLabel(description));
    builder.setCenterPanel(new ChangesBrowserWithRollback(project, changes));
    builder.addOkAction();
    builder.setTitle(title);
    builder.show();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:LocalChangesWouldBeOverwrittenHelper.java

示例8: showInjectionUI

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
private static BaseInjection showInjectionUI(final Project project, final MethodParameterInjection methodParameterInjection) {
  final AbstractInjectionPanel panel = new MethodParameterPanel(methodParameterInjection, project);
  panel.reset();
  final DialogBuilder builder = new DialogBuilder(project);
  builder.setHelpId("reference.settings.injection.language.injection.settings.java.parameter");
  builder.addOkAction();
  builder.addCancelAction();
  builder.setCenterPanel(panel.getComponent());
  builder.setTitle(EditInjectionSettingsAction.EDIT_INJECTION_TITLE);
  builder.setOkOperation(new Runnable() {
    public void run() {
      panel.apply();
      builder.getDialogWrapper().close(DialogWrapper.OK_EXIT_CODE);
    }
  });
  if (builder.show() == DialogWrapper.OK_EXIT_CODE) {
    return new BaseInjection(methodParameterInjection.getSupportId()).copyFrom(methodParameterInjection);
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:JavaLanguageInjectionSupport.java

示例9: CodeDialogBuilder

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
public CodeDialogBuilder(Project project, String title, String producedCode) {
    dialogBuilder = new DialogBuilder(project);
    dialogBuilder.setTitle(title);

    JPanel centerPanel = new JPanel(new BorderLayout());
    codeArea = prepareCodeArea(producedCode);
    codeArea.setLineWrap(true);
    JBScrollPane codeScroll = new JBScrollPane(codeArea);

    centerPanel.add(codeScroll, BorderLayout.CENTER);
    dialogBuilder.setCenterPanel(centerPanel);

    topPanel = new JPanel(new GridLayout(0, 2));
    centerPanel.add(topPanel, BorderLayout.PAGE_START);

    dialogBuilder.removeAllActions();
}
 
开发者ID:cooliean,项目名称:android-codegenerator-plugin-intellij,代码行数:18,代码来源:CodeDialogBuilder.java

示例10: showSettingsDialog

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
public void showSettingsDialog() {
    final OCamlToolWindowSettingsForm settingsForm = new OCamlToolWindowSettingsForm(myProject);
    settingsForm.setSelectedSdk(OCamlSettings.getInstance().getTopLevelSdk());
    settingsForm.setCmdParams(OCamlSettings.getInstance().getTopLevelCmdOptions());
    settingsForm.setWorkingDirectory(OCamlSettings.getInstance().getTopLevelCmdWorkingDir());

    final DialogBuilder dialogBuilder = new DialogBuilder(myProject);
    dialogBuilder.setCenterPanel(settingsForm.getRootPanel());
    dialogBuilder.addOkAction().setText("Ok");
    dialogBuilder.addCancelAction().setText("Cancel");
    dialogBuilder.setPreferedFocusComponent(settingsForm.getSdkComboBox());
    dialogBuilder.setTitle("OCaml Top Level Console Settings");
    dialogBuilder.setOkOperation(new Runnable() {
        public void run() {
            OCamlSettings.getInstance().setTopLevelSdk(settingsForm.getSelectedSdk());
            OCamlSettings.getInstance().setTopLevelCmdOptions(settingsForm.getCmdParams());
            OCamlSettings.getInstance().setTopLevelCmdWorkingDir(settingsForm.getWorkingDirectory());
            dialogBuilder.getWindow().setVisible(false);
            if (myAction != null) {
                myAction.run();
            }
        }
    });
    dialogBuilder.show();
}
 
开发者ID:traff,项目名称:intellij-ocaml,代码行数:26,代码来源:OCamlToolWindowSettingsAction.java

示例11: showDialog

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
public void showDialog(final Project project, final Runnable callback) {
  final DialogBuilder builder = new DialogBuilder(project);
  builder.setCenterPanel(createPanel(project, new Consumer<Boolean>() {
    @Override
    public void consume(Boolean aBoolean) {
      builder.setOkActionEnabled(aBoolean);
    }
  }));
  builder.addOkAction();
  builder.addCancelAction();
  builder.setDimensionServiceKey(getClass().getName());
  builder.setTitle("Open Fossil Repository");
  builder.setOkOperation(new Runnable() {
    @Override
    public void run() {
      builder.getWindow().setVisible(false);
      callback.run();
    }
  });
  builder.setPreferredFocusComponent(myRepoField);
  builder.show();
}
 
开发者ID:irengrig,项目名称:fossil4idea,代码行数:23,代码来源:OpenAction.java

示例12: showDialog

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
public void showDialog(final Project project, final Runnable callback) {
  final DialogBuilder builder = new DialogBuilder(project);
  builder.setCenterPanel(createPanel(project, new Consumer<Boolean>() {
    @Override
    public void consume(Boolean aBoolean) {
      builder.setOkActionEnabled(aBoolean);
    }
  }));
  builder.addOkAction();
  builder.addCancelAction();
  builder.setDimensionServiceKey(getClass().getName());
  builder.setTitle("Clone and Open Fossil Repository");
  builder.setOkOperation(new Runnable() {
    @Override
    public void run() {
      builder.getWindow().setVisible(false);
      callback.run();
    }
  });
  builder.setPreferredFocusComponent(myUrlField);
  builder.show();
}
 
开发者ID:irengrig,项目名称:fossil4idea,代码行数:23,代码来源:CloneAndOpenAction.java

示例13: showDialog

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
public void showDialog(final Project project, final Runnable callback) {
  final DialogBuilder builder = new DialogBuilder(project);
  builder.setCenterPanel(createPanel(project, new Consumer<Boolean>() {
    @Override
    public void consume(Boolean aBoolean) {
      builder.setOkActionEnabled(aBoolean);
    }
  }));
  builder.addOkAction();
  builder.addCancelAction();
  builder.setDimensionServiceKey(getClass().getName());
  builder.setTitle("Clone Fossil Repository");
  builder.setOkOperation(new Runnable() {
    @Override
    public void run() {
      builder.getWindow().setVisible(false);
      callback.run();
    }
  });
  builder.setPreferredFocusComponent(myUrlField);
  builder.show();
}
 
开发者ID:irengrig,项目名称:fossil4idea,代码行数:23,代码来源:CloneAction.java

示例14: show

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
/**
 * Show the search dialog
 * @param searchTerm
 */
public void show(@Nullable final String searchTerm) {

    final JTextField searchTextField = new JTextField(searchTerm);

    JPanel panel = new JPanel(new BorderLayout());
    panel.add(new JLabel(UI5Bundle.getString("api.searchterm")), BorderLayout.WEST);
    panel.add(searchTextField, BorderLayout.CENTER);

    final DialogBuilder dialogBuilder = new DialogBuilder(project);
    dialogBuilder.setTitle(UI5Bundle.getString("api.search"));
    dialogBuilder.setCenterPanel(panel);
    dialogBuilder.addAction(getSearchAction(dialogBuilder, searchTextField.getText()));
    dialogBuilder.addCancelAction();
    dialogBuilder.showModal(true);
}
 
开发者ID:asebak,项目名称:ui5-intellij-plugin,代码行数:20,代码来源:UI5ApiSearchDialog.java

示例15: configureTask

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
public boolean configureTask(RunConfiguration runConfiguration, BuildArtifactsBeforeRunTask task) {
  final Artifact[] artifacts = ArtifactManager.getInstance(myProject).getArtifacts();
  Set<ArtifactPointer> pointers = new THashSet<ArtifactPointer>();
  for (Artifact artifact : artifacts) {
    pointers.add(ArtifactPointerManager.getInstance(myProject).createPointer(artifact));
  }
  pointers.addAll(task.getArtifactPointers());
  ArtifactChooser chooser = new ArtifactChooser(new ArrayList<ArtifactPointer>(pointers));
  chooser.markElements(task.getArtifactPointers());
  chooser.setPreferredSize(new Dimension(400, 300));

  DialogBuilder builder = new DialogBuilder(myProject);
  builder.setTitle(CompilerBundle.message("build.artifacts.before.run.selector.title"));
  builder.setDimensionServiceKey("#BuildArtifactsBeforeRunChooser");
  builder.addOkAction();
  builder.addCancelAction();
  builder.setCenterPanel(chooser);
  builder.setPreferredFocusComponent(chooser);
  if (builder.show() == DialogWrapper.OK_EXIT_CODE) {
    task.setArtifactPointers(chooser.getMarkedElements());
    return true;
  }
  return false;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:BuildArtifactsBeforeRunTaskProvider.java


注:本文中的com.intellij.openapi.ui.DialogBuilder.setCenterPanel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。