本文整理汇总了Java中org.netbeans.spi.project.ui.support.ProjectCustomizer.createCustomizerDialog方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectCustomizer.createCustomizerDialog方法的具体用法?Java ProjectCustomizer.createCustomizerDialog怎么用?Java ProjectCustomizer.createCustomizerDialog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.spi.project.ui.support.ProjectCustomizer
的用法示例。
在下文中一共展示了ProjectCustomizer.createCustomizerDialog方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showCustomizer
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入方法依赖的package包/类
@Messages({
"PROGRESS_loading_data=Loading project information",
"# {0} - project display name", "LBL_CustomizerTitle=Project Properties - {0}"
})
public void showCustomizer(String preselectedCategory, final String preselectedSubCategory) {
if (dialog != null) {
dialog.setVisible(true);
} else {
final String category = (preselectedCategory != null) ? preselectedCategory : lastSelectedCategory;
final AtomicReference<Lookup> context = new AtomicReference<Lookup>();
ProgressUtils.runOffEventDispatchThread(new Runnable() {
@Override public void run() {
context.set(new ProxyLookup(prepareData(), Lookups.fixed(new SubCategoryProvider(category, preselectedSubCategory))));
}
}, PROGRESS_loading_data(), /* currently unused */new AtomicBoolean(), false);
if (context.get() == null) { // canceled
return;
}
OptionListener listener = new OptionListener();
dialog = ProjectCustomizer.createCustomizerDialog(layerPath, context.get(), category, listener, null);
dialog.addWindowListener(listener);
dialog.setTitle(LBL_CustomizerTitle(ProjectUtils.getInformation(getProject()).getDisplayName()));
dialog.setVisible(true);
}
}
示例2: showCustomizer
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入方法依赖的package包/类
@Override
@NbBundle.Messages("MSG_CustomizerForbidden=The customizer is disabled, using it would revert manual changes done to the nbproject/project.xml file.")
public void showCustomizer() {
AuxiliaryProperties props = project.getLookup().lookup(AuxiliaryProperties.class);
String show = props.get("show.customizer", true);
if (show != null && "false".equals(show)) {
String message = props.get("show.customizer.message", true);
if (message == null) {
message = MSG_CustomizerForbidden();
}
NotifyDescriptor nd = new NotifyDescriptor.Message(message, NotifyDescriptor.WARNING_MESSAGE);
DialogDisplayer.getDefault().notify(nd);
return;
}
Dialog dialog = project2Dialog.get (project);
if ( dialog != null ) {
dialog.setVisible(true);
}
else {
InstanceContent ic = new InstanceContent();
Lookup context = new AbstractLookup(ic);
ic.add(project);
ic.add(project.getLookup().lookup(ProjectAccessor.class));
ic.add(project.getLookup().lookup(AuxiliaryConfiguration.class));
//TODO replace with generic apis..
ic.add(ic);
OptionListener listener = new OptionListener();
dialog = ProjectCustomizer.createCustomizerDialog(CUSTOMIZER_FOLDER_PATH, context, null, listener, null );
dialog.addWindowListener( listener );
dialog.setTitle( MessageFormat.format(
NbBundle.getMessage( ProjectCustomizerProvider.class, "LBL_Customizer_Title" ), // NOI18N
new Object[] { ProjectUtils.getInformation(project).getDisplayName() } ) );
project2Dialog.put(project, dialog);
dialog.setVisible(true);
}
}