本文整理汇总了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();
}
}
示例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();
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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();
}
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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;
}