本文整理汇总了Java中com.intellij.openapi.ui.DialogBuilder.setDimensionServiceKey方法的典型用法代码示例。如果您正苦于以下问题:Java DialogBuilder.setDimensionServiceKey方法的具体用法?Java DialogBuilder.setDimensionServiceKey怎么用?Java DialogBuilder.setDimensionServiceKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.ui.DialogBuilder
的用法示例。
在下文中一共展示了DialogBuilder.setDimensionServiceKey方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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);
}
}
示例3: 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;
}
示例4: 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();
}
示例5: 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();
}
示例6: 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();
}
示例7: 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;
}
示例8: showDialog
import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
private static void showDialog(MergeRequestImpl data) {
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);
}
}
示例9: 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;
}
示例10: configureTask
import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
@Override
public boolean configureTask(RunConfiguration runConfiguration, T task) {
final Artifact[] artifacts = ArtifactManager.getInstance(myProject).getArtifacts();
Set<ArtifactPointer> pointers = new THashSet<ArtifactPointer>();
for (Artifact artifact : artifacts) {
pointers.add(ArtifactPointerUtil.getPointerManager(myProject).create(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;
}
示例11: showDefaultInjectionUI
import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
@Nullable
protected static BaseInjection showDefaultInjectionUI(final Project project, BaseInjection injection) {
final BaseInjectionPanel panel = new BaseInjectionPanel(injection, project);
panel.reset();
final DialogBuilder builder = new DialogBuilder(project);
LanguageInjectionSupport support = InjectorUtils.findInjectionSupport(injection.getSupportId());
if (support instanceof AbstractLanguageInjectionSupport) {
builder.setHelpId(((AbstractLanguageInjectionSupport)support).getHelpId());
}
builder.addOkAction();
builder.addCancelAction();
builder.setDimensionServiceKey("#org.intellij.plugins.intelliLang.inject.config.ui.BaseInjectionDialog");
builder.setCenterPanel(panel.getComponent());
builder.setTitle(EditInjectionSettingsAction.EDIT_INJECTION_TITLE);
builder.setOkOperation(new Runnable() {
public void run() {
try {
panel.apply();
builder.getDialogWrapper().close(DialogWrapper.OK_EXIT_CODE);
}
catch (Exception e) {
final Throwable cause = e.getCause();
final String message = e.getMessage() + (cause != null? "\n "+cause.getMessage():"");
Messages.showErrorDialog(project, message, "Unable to Save");
}
}
});
if (builder.show() == DialogWrapper.OK_EXIT_CODE) {
return injection;
}
return null;
}
示例12: showDefaultInjectionUI
import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
@Nullable
protected static BaseInjection showDefaultInjectionUI(final Project project, BaseInjection injection) {
final BaseInjectionPanel panel = new BaseInjectionPanel(injection, project);
panel.reset();
final DialogBuilder builder = new DialogBuilder(project);
LanguageInjectionSupport support = InjectorUtils.findInjectionSupport(injection.getSupportId());
if (support != null && support instanceof AbstractLanguageInjectionSupport) {
builder.setHelpId(((AbstractLanguageInjectionSupport)support).getHelpId());
}
builder.addOkAction();
builder.addCancelAction();
builder.setDimensionServiceKey("#org.intellij.plugins.intelliLang.inject.config.ui.BaseInjectionDialog");
builder.setCenterPanel(panel.getComponent());
builder.setTitle(EditInjectionSettingsAction.EDIT_INJECTION_TITLE);
builder.setOkOperation(new Runnable() {
public void run() {
try {
panel.apply();
builder.getDialogWrapper().close(DialogWrapper.OK_EXIT_CODE);
}
catch (Exception e) {
final Throwable cause = e.getCause();
final String message = e.getMessage() + (cause != null? "\n "+cause.getMessage():"");
Messages.showErrorDialog(project, message, "Unable to Save");
}
}
});
if (builder.show() == DialogWrapper.OK_EXIT_CODE) {
return injection;
}
return null;
}
示例13: showDialog
import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
private static ImageInsertSettingsPanel showDialog(File curDocument, Dimension imgDim) {
DialogBuilder builder = new DialogBuilder();
ImageInsertSettingsPanel contentPanel = new ImageInsertSettingsPanel();
ChangeListener listener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
double scalingFactor = (Integer) contentPanel.getScaleSpinner().getValue() * 0.1;
JLabel targetSizeLabel = contentPanel.getTargetSizeLabel();
if (scalingFactor == 100) {
targetSizeLabel.setText(imgDim.getWidth() + " x " + imgDim.getHeight());
} else {
long newWidth = Math.round(imgDim.getWidth() * scalingFactor);
long newHeight = Math.round(imgDim.getHeight() * scalingFactor);
targetSizeLabel.setText(newWidth + " x " + newHeight);
}
}
};
listener.stateChanged(null);
contentPanel.getScaleSpinner().addChangeListener(listener);
// restore directory pattern preferences for file and globally
PropertiesComponent propComp = PropertiesComponent.getInstance();
String dirPattern = propComp.getValue("PI__DIR_PATTERN_FOR_" + curDocument.getPath());
if (dirPattern == null) dirPattern = propComp.getValue("PI__LAST_DIR_PATTERN");
if (dirPattern == null) dirPattern = "." + DOC_BASE_NAME + "_images";
contentPanel.getDirectoryField().setText(dirPattern);
contentPanel.getNameInput().setText(UUID.randomUUID().toString().substring(0, 8));
builder.setCenterPanel(contentPanel);
builder.setDimensionServiceKey("GrepConsoleSound");
builder.setTitle("Paste Image Settings");
builder.removeAllActions();
builder.addOkAction();
builder.addCancelAction();
builder.setPreferredFocusComponent(contentPanel.getNameInput());
boolean isOk = builder.show() == DialogWrapper.OK_EXIT_CODE;
if (!isOk) {
return null;
}
return contentPanel;
}