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


Java ProjectCustomizer.createCustomizerDialog方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:BasicCustomizer.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:ProjectCustomizerProvider.java


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