本文整理汇总了Java中com.intellij.openapi.ui.DialogBuilder.setPreferredFocusComponent方法的典型用法代码示例。如果您正苦于以下问题:Java DialogBuilder.setPreferredFocusComponent方法的具体用法?Java DialogBuilder.setPreferredFocusComponent怎么用?Java DialogBuilder.setPreferredFocusComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.ui.DialogBuilder
的用法示例。
在下文中一共展示了DialogBuilder.setPreferredFocusComponent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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);
}
}
示例3: 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);
}
}
示例4: 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;
}
示例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("Open Fossil Repository");
builder.setOkOperation(new Runnable() {
@Override
public void run() {
builder.getWindow().setVisible(false);
callback.run();
}
});
builder.setPreferredFocusComponent(myRepoField);
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 and Open Fossil Repository");
builder.setOkOperation(new Runnable() {
@Override
public void run() {
builder.getWindow().setVisible(false);
callback.run();
}
});
builder.setPreferredFocusComponent(myUrlField);
builder.show();
}
示例7: 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();
}
示例8: 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;
}
示例9: 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);
}
}
示例10: 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;
}
示例11: actionPerformed
import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
@Override
public void actionPerformed(@Nonnull 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);
}
}
示例12: 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;
}
示例13: initComponent
import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
@Override
public void initComponent() {
ActionManager am = ActionManager.getInstance();
AnAction action = new AnAction("JNomad Configuration") {
@Override
public void actionPerformed(AnActionEvent anActionEvent) {
Project project = Objects.requireNonNull(anActionEvent.getData(PlatformDataKeys.PROJECT));
JNomadConfigurationPanel configPanel = new JNomadConfigurationPanel();
DialogBuilder builder = new DialogBuilder(project);
builder.setTitle("JNomad Configuration");
builder.setCenterPanel(configPanel);
builder.setOkActionEnabled(true);
if (configPanel.getPluginConfiguration().getEnvironmentList().isEmpty()) {
builder.setPreferredFocusComponent(configPanel.getEnvironmentNameTextField());
} else {
builder.setPreferredFocusComponent(configPanel.getDatabaseHostTextField());
}
if (DialogWrapper.OK_EXIT_CODE == builder.show()) {
JNomadPluginConfiguration pluginConfiguration = configPanel.getPluginConfiguration();
pluginConfiguration.setSlowQueryThreshold(configPanel.getSlowQueryThreshold());
pluginConfiguration.setRecommendIndexThreshold(configPanel.getRecommendIndexThreshold());
PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(project);
propertiesComponent.setValue("jnomad.plugin.configuration", new Gson().toJson(pluginConfiguration));
JNomadInspection.resetJNomadSetup();
}
}
};
am.registerAction("JNomadPluginAction", action);
//add to analyze menu
DefaultActionGroup windowM = (DefaultActionGroup) am.getAction("AnalyzeMenu");
windowM.addSeparator();
windowM.add(action);
}
示例14: showChangesDialog
import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
protected void showChangesDialog(@NotNull String title, @NotNull List<Change> changes) {
DialogBuilder dialogBuilder = new DialogBuilder(myProject);
dialogBuilder.setTitle(title);
dialogBuilder.setActionDescriptors(new DialogBuilder.ActionDescriptor[]{new DialogBuilder.CloseDialogAction()});
final ChangesBrowser changesBrowser =
new ChangesBrowser(myProject, null, changes, null, false, true, null, ChangesBrowser.MyUseCase.COMMITTED_CHANGES, null);
changesBrowser.setChangesToDisplay(changes);
dialogBuilder.setCenterPanel(changesBrowser);
dialogBuilder.setPreferredFocusComponent(changesBrowser.getPreferredFocusedComponent());
dialogBuilder.showNotModal();
}
示例15: showDialog
import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
public static String showDialog(PsiClass[] classes, JComponent component)
{
GroupList groupList = new GroupList(classes);
DialogBuilder builder = new DialogBuilder(component);
builder.setCenterPanel(groupList);
builder.setPreferredFocusComponent(groupList.list);
builder.setTitle("Choose Test Group");
return builder.show() != 0 ? null : groupList.getSelected();
}