本文整理汇总了Java中org.netbeans.spi.project.ui.support.ProjectCustomizer类的典型用法代码示例。如果您正苦于以下问题:Java ProjectCustomizer类的具体用法?Java ProjectCustomizer怎么用?Java ProjectCustomizer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ProjectCustomizer类属于org.netbeans.spi.project.ui.support包,在下文中一共展示了ProjectCustomizer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SuiteCustomizerBasicBranding
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入依赖的package包/类
/**
* Creates new form SuiteCustomizerLibraries
*/
public SuiteCustomizerBasicBranding(final SuiteProperties suiteProps, ProjectCustomizer.Category cat,
BasicCustomizer.SubCategoryProvider prov) {
super(suiteProps, SuiteCustomizerBasicBranding.class, cat);
initComponents();
this.prov = prov;
refresh();
checkValidity();
DocumentListener textFieldChangeListener = new UIUtil.DocumentAdapter() {
@Override
public void insertUpdate(DocumentEvent e) {
checkValidity();
}
};
nameValue.getDocument().addDocumentListener(textFieldChangeListener);
}
示例2: 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);
}
}
示例3: findCategoryByName
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入依赖的package包/类
private static ProjectCustomizer.Category findCategoryByName( String name, ProjectCustomizer.Category[] categories ) {
for( int i = 0; i < categories.length; i++ ) {
if ( name.equals( categories[i].getName() ) ) {
return categories[i];
}
ProjectCustomizer.Category[] subcategories = categories[i].getSubcategories();
if ( subcategories != null ) {
ProjectCustomizer.Category category = findCategoryByName( name, subcategories );
if ( category != null ) {
return category;
}
}
}
return null;
}
示例4: createComponent
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入依赖的package包/类
@Override
public JComponent createComponent(ProjectCustomizer.Category category, Lookup context) {
final BuildCustomizerPanel panel = new BuildCustomizerPanel();
Project prj = context.lookup(Project.class);
if (prj != null) {
final BuildVariant buildVariant = prj.getLookup().lookup(BuildVariant.class);
if (buildVariant != null) {
panel.setData(buildVariant);
category.setStoreListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
buildVariant.setVariantName(panel.getData());
}
});
}
}
return panel;
}
示例5: findNode
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入依赖的package包/类
private Node findNode( ProjectCustomizer.Category category, Node node ) {
Children ch = node.getChildren();
if ( ch != null && ch != Children.LEAF ) {
Node nodes[] = ch.getNodes( true );
if ( nodes != null ) {
for (Node child : nodes) {
ProjectCustomizer.Category cc = child.getLookup().lookup(ProjectCustomizer.Category.class);
if ( cc == category ) {
return child;
}
else {
Node n = findNode(category, child);
if ( n != null ) {
return n;
}
}
}
}
}
return null;
}
示例6: propertyChange
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入依赖的package包/类
public void propertyChange(PropertyChangeEvent evt) {
Object source = evt.getSource();
String propertyName = evt.getPropertyName();
if ( source== manager && ExplorerManager.PROP_SELECTED_NODES.equals( propertyName ) ) {
Node nodes[] = manager.getSelectedNodes();
if ( nodes == null || nodes.length <= 0 ) {
return;
}
Node node = nodes[0];
ProjectCustomizer.Category category = node.getLookup().lookup(ProjectCustomizer.Category.class);
if ( category != categoryModel.getCurrentCategory() ) {
categoryModel.setCurrentCategory( category );
}
}
if ( source == categoryModel && CategoryModel.PROP_CURRENT_CATEGORY.equals( propertyName ) ) {
selectNode( (ProjectCustomizer.Category)evt.getNewValue() );
}
}
示例7: AndroidProjectSdkConfig
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入依赖的package包/类
/**
* Creates new form AndroidProjectSdkConfig
*/
public AndroidProjectSdkConfig(ProjectCustomizer.Category category, Lookup context) {
initComponents();
this.category = category;
this.context = context;
NbGradleProject project = context.lookup(NbGradleProject.class);
sdk = project.getLookup().lookup(AndroidSdk.class);
androidGradleExtension = project.getLookup().lookup(AndroidGradleExtensionV2.class);
if (sdk != null && androidGradleExtension != null) {
sdkList.setModel(new DefaultComboBoxModel(AndroidSdkProvider.getInstalledSDKs()));
sdkList.setSelectedItem(sdk);
AndroidSdkProvider.getDefault().addPropertyChangeListener(WeakListeners.propertyChange(this, AndroidSdkProvider.PROP_INSTALLED_SDKS, AndroidSdkProvider.getDefault()));
}
System.out.println("org.nbandroid.netbeans.gradle.v2.project.ui.AndroidProjectSdkConfig.<init>()");
category.setStoreListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (!sdk.equals(sdkList.getSelectedItem())) {
androidGradleExtension.propertyChange(new PropertyChangeEvent(this, PROPERTY_CHANGE_SDK, null, sdkList.getSelectedItem()));
}
}
});
}
示例8: createCategory
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入依赖的package包/类
@Override
public ProjectCustomizer.Category createCategory(Lookup context) {
// suppress panel for JEE projects ... generally anything other than JAR packaging
// type:
Project p = context.lookup(Project.class);
if (p == null) {
return null;
}
NbMavenProject mvnProject = p.getLookup().lookup(NbMavenProject.class);
if (mvnProject == null ||
!NbMavenProject.TYPE_JAR.equals(mvnProject.getPackagingType())) {
return null;
}
return ProjectCustomizer.Category.create(
CATEGORY,
Bundle.CAT_RunJShell(),
null
);
}
示例9: createCategory
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入依赖的package包/类
@Override
public Category createCategory(Lookup context) {
Project project = context.lookup(Project.class);
NbMavenProject watcher = project.getLookup().lookup(NbMavenProject.class);
String effPackaging = watcher.getPackagingType();
String[] types = PluginPropertyUtils.getPluginPropertyList(project, OSGiConstants.GROUPID_FELIX, OSGiConstants.ARTIFACTID_BUNDLE_PLUGIN, "supportedProjectTypes", "supportedProjectType", /*"bundle" would not work for GlassFish parent POM*/null);
if (types != null) {
for (String type : types) {
if (effPackaging.equals(type)) {
effPackaging = NbMavenProject.TYPE_OSGI;
}
}
}
if (NbMavenProject.TYPE_OSGI.equalsIgnoreCase(effPackaging)) {
return ProjectCustomizer.Category.create(
ModelHandle2.PANEL_COMPILE,
org.openide.util.NbBundle.getMessage(PackagesPanelProvider.class, "TIT_Packages"),
null);
}
return null;
}
示例10: createCategory
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入依赖的package包/类
@Override
public Category createCategory(Lookup context) {
boolean fxProjectEnabled = true;
final Project project = context.lookup(Project.class);
if (project != null) {
final J2SEPropertyEvaluator j2sepe = project.getLookup().lookup(J2SEPropertyEvaluator.class);
fxProjectEnabled = JFXProjectProperties.isTrue(j2sepe.evaluator().getProperty(JFXProjectProperties.JAVAFX_ENABLED)) //NOI18N
&& !JFXProjectProperties.isTrue(j2sepe.evaluator().getProperty(JFXProjectProperties.JAVAFX_PRELOADER)); //NOI18N
}
if(fxProjectEnabled) {
return ProjectCustomizer.Category.create(CAT_RUN,
NbBundle.getMessage(JFXRunCategoryProvider.class, "LBL_Category_Run"), null); //NOI18N
}
return null;
}
示例11: CustomizerDisplay
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入依赖的package包/类
CustomizerDisplay(final SingleModuleProperties props, ProjectCustomizer.Category cat) {
super(props, CustomizerDisplay.class, cat);
initComponents();
initAccessibility();
refresh();
checkValidity();
}
示例12: NbPropertyPanel
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入依赖的package包/类
@SuppressWarnings("LeakingThisInConstructor")
NbPropertyPanel(@NonNull ModuleProperties props, Class<?> helpCtxClass, ProjectCustomizer.Category cat) {
this.props = props;
category = cat;
props.addLazyStorage(this);
initComponents();
props.addPropertyChangeListener(this);
this.helpCtxClass = helpCtxClass;
}
示例13: CustomizerSources
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入依赖的package包/类
CustomizerSources(final SingleModuleProperties props, ProjectCustomizer.Category category) {
super(props, CustomizerSources.class, category);
initComponents();
initAccessibility();
refresh();
srcLevelValue.addActionListener(new ActionListener() { // #66278
public void actionPerformed(ActionEvent e) {
if (srcLevelValueBeingUpdated) {
return;
}
final String oldLevel = getProperty(SingleModuleProperties.JAVAC_SOURCE);
final String newLevel = (String) srcLevelValue.getSelectedItem();
SpecificationVersion jdk5 = new SpecificationVersion("1.5"); // NOI18N
if (new SpecificationVersion(oldLevel).compareTo(jdk5) < 0 && new SpecificationVersion(newLevel).compareTo(jdk5) >= 0) {
EventQueue.invokeLater(new Runnable() { // wait for combo to close, at least
public void run() {
if (!ApisupportAntUIUtils.showAcceptCancelDialog(
getMessage("CustomizerSources.title.enable_lint"),
getMessage("CustomizerSources.text.enable_lint"),
getMessage("CustomizerSources.button.enable_lint"),
getMessage("CustomizerSources.button.skip_lint"),
NotifyDescriptor.QUESTION_MESSAGE)) {
return;
}
String options = getProperty(SingleModuleProperties.JAVAC_COMPILERARGS);
String added = "-Xlint -Xlint:-serial"; // NOI18N
if (options == null || options.length() == 0) {
options = added;
} else {
options = options + " " + added; // NOI18N
}
setProperty(SingleModuleProperties.JAVAC_COMPILERARGS, options);
}
});
}
}
});
}
示例14: createJavadoc
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入依赖的package包/类
@ProjectCustomizer.CompositeCategoryProvider.Registration(
projectType="org-netbeans-modules-java-j2seproject",
category="BuildCategory",
position=300
)
public static J2SECompositePanelProvider createJavadoc() {
return new J2SECompositePanelProvider(JAVADOC);
}
示例15: createComponent
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入依赖的package包/类
public JComponent createComponent(ProjectCustomizer.Category category, Lookup context) {
SingleModuleProperties props = context.lookup(SingleModuleProperties.class);
assert props != null;
Project p = props.getProject();
if (!(p instanceof NbModuleProject)) {
return new JPanel(); // broken project?
}
return new CustomizerLibraries(props, category, (NbModuleProject) p);
}