本文整理汇总了Java中org.netbeans.spi.project.ui.support.ProjectCustomizer.Category方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectCustomizer.Category方法的具体用法?Java ProjectCustomizer.Category怎么用?Java ProjectCustomizer.Category使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.spi.project.ui.support.ProjectCustomizer
的用法示例。
在下文中一共展示了ProjectCustomizer.Category方法的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: propertyChange
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入方法依赖的package包/类
public void propertyChange(PropertyChangeEvent evt) {
if ( CategoryModel.PROP_CURRENT_CATEGORY.equals( evt.getPropertyName() ) ) {
ProjectCustomizer.Category newCategory = (ProjectCustomizer.Category)evt.getNewValue();
setCategory( newCategory );
}
}
示例3: ListeningButton
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入方法依赖的package包/类
public ListeningButton(String label, ProjectCustomizer.Category[] categories) {
super(label);
this.categories = categories;
for (ProjectCustomizer.Category c : categories) {
Utilities.getCategoryChangeSupport(c).addPropertyChangeListener(this);
}
}
示例4: 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);
}
});
}
}
});
}
示例5: createCategory
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入方法依赖的package包/类
public @Override ProjectCustomizer.Category createCategory(Lookup context) {
return ProjectCustomizer.Category.create(
"Installer",
NbBundle.getMessage(ExtraPanel.class, "LBL_InstallerPanel"),
null,
(ProjectCustomizer.Category[])null);
}
示例6: createCategory
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入方法依赖的package包/类
@NbBundle.Messages("TypeScriptCustomizer.displayName=Clojure")
@Override
public ProjectCustomizer.Category createCategory(Lookup context) {
return ProjectCustomizer.Category.create(
"clojure", // NOI18N
Bundle.TypeScriptCustomizer_displayName(),
null, (ProjectCustomizer.Category[]) null);
}
示例7: selectNode
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入方法依赖的package包/类
private void selectNode( ProjectCustomizer.Category category ) {
Node node = findNode( category, manager.getRootContext() );
if ( node != null ) {
try {
manager.setSelectedNodes( new Node[] { node } );
}
catch ( PropertyVetoException e ) {
// No node will be selected
}
}
}
示例8: OptionListener
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入方法依赖的package包/类
OptionListener(@NonNull ActionListener okOptionListener, @NullAllowed ActionListener storeListener, ProjectCustomizer.Category[] categs,
ProjectCustomizer.CategoryComponentProvider componentProvider) {
this.okOptionListener = okOptionListener;
this.storeListener = storeListener;
categories = categs;
//#97998 related
if (componentProvider instanceof Lookup.Provider) {
prov = (Lookup.Provider)componentProvider;
}
}
示例9: storePerformed
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入方法依赖的package包/类
private void storePerformed(ActionEvent e, ProjectCustomizer.Category[] categories) {
for (ProjectCustomizer.Category category : categories) {
ActionListener listener = category.getStoreListener();
if (listener != null) {
listener.actionPerformed(e); // XXX maybe create new event
}
if (category.getSubcategories() != null) {
storePerformed(e, category.getSubcategories());
}
}
}
示例10: setCategory
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入方法依赖的package包/类
private void setCategory(final ProjectCustomizer.Category newCategory) {
if ( newCategory == null ) {
return;
}
if ( currentCustomizer != null ) {
customizerPanel.remove( currentCustomizer );
}
JComponent newCustomizer = panelCache.get(newCategory);
if (newCustomizer == null && !panelCache.containsKey(newCustomizer)) {
newCustomizer = componentProvider.create( newCategory );
panelCache.put(newCategory, newCustomizer);
}
if ( newCustomizer != null ) {
Utilities.getCategoryChangeSupport(newCategory).addPropertyChangeListener(new PropertyChangeListener() {
public @Override void propertyChange(PropertyChangeEvent evt) {
setErrorMessage(newCategory.getErrorMessage(), newCategory.isValid());
}
});
currentCustomizer = newCustomizer;
currentHelpCtx = HelpCtx.findHelp( currentCustomizer );
/*if (previousDimension == null) {
previousDimension = currentCustomizer.getSize();
}
int newWidth = 0;
int newHeight = 0;
if (previousDimension != null) {
newWidth = previousDimension.width;
newHeight = previousDimension.height;
if (currentCustomizer.getPreferredSize().width > previousDimension.width) {
newWidth = currentCustomizer.getPreferredSize().width;
int maxWidth = WindowManager.getDefault().getMainWindow().getGraphicsConfiguration().getBounds().width * 3 / 4;
if (newWidth > maxWidth) {
newWidth = maxWidth;
}
}
if (currentCustomizer.getPreferredSize().height > previousDimension.height) {
newHeight = currentCustomizer.getPreferredSize().height;
int maxHeght = WindowManager.getDefault().getMainWindow().getGraphicsConfiguration().getBounds().height * 3 / 4;
if (newHeight > maxHeght) {
newHeight = maxHeght;
}
}
}
Dimension newDim = new Dimension(newWidth, newHeight);
currentCustomizer.setPreferredSize(newDim);
previousDimension = newDim;*/
/*Preferences prefs = NbPreferences.forModule(org.netbeans.modules.project.uiapi.CustomizerPane.class);
prefs.put(CUSTOMIZER_DIALOG_WIDTH, Integer.toString(newDim.width));
prefs.put(CUSTOMIZER_DIALOG_HEIGHT, Integer.toString(newDim.height));*/
customizerPanel.add( currentCustomizer, fillConstraints );
customizerPanel.validate();
customizerPanel.repaint();
/*if (customizerPanel != null) {
Window window = SwingUtilities.getWindowAncestor(customizerPanel);
if (window != null) {
window.pack();
window.setBounds(org.openide.util.Utilities.findCenterBounds(window.getSize()));
}
}*/
setErrorMessage(newCategory.getErrorMessage(), newCategory.isValid());
firePropertyChange( HELP_CTX_PROPERTY, null, getHelpCtx() );
} else {
currentCustomizer = null;
}
}
示例11: createComponent
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入方法依赖的package包/类
@Override
public JComponent createComponent(ProjectCustomizer.Category category, final Lookup context) {
String nm = category.getName();
final J2SEModularProjectProperties uiProps = context.lookup(J2SEModularProjectProperties.class);
if (SOURCES.equals(nm)) {
return new CustomizerSources(uiProps);
} else if (LIBRARIES.equals(nm)) {
CustomizerProviderImpl.SubCategoryProvider prov = context.lookup(CustomizerProviderImpl.SubCategoryProvider.class);
assert prov != null : "Assuming CustomizerProviderImpl.SubCategoryProvider in customizer context";
return new CustomizerLibraries(uiProps, prov, category);
} else if (BUILD.equals(nm)) {
return new CustomizerCompile(uiProps);
} else if (JAR.equals(nm)) {
return new CustomizerJar(uiProps);
} else if (JAVADOC.equals(nm)) {
return new CustomizerJavadoc(uiProps);
} else if (RUN.equals(nm)) {
return new CustomizerRun(uiProps);
} else if (APPLICATION.equals(nm)) {
return new CustomizerApplication(uiProps);
} else if (LICENSE.equals(nm)) {
CustomizerUtilities.LicensePanelContentHandler handler =
new CustomizerUtilities.LicensePanelContentHandler() {
@Override
public String getProjectLicenseLocation() {
return uiProps.LICENSE_PATH_VALUE;
}
@Override
public String getGlobalLicenseName() {
return uiProps.LICENSE_NAME_VALUE;
}
@Override
public FileObject resolveProjectLocation(@NonNull String path) {
final J2SEModularProject project = context.lookup(J2SEModularProject.class);
String evaluated = uiProps.getEvaluator().evaluate(path);
return project.getAntProjectHelper().resolveFileObject(evaluated);
}
@Override
public void setProjectLicenseLocation(@NullAllowed String newLocation) {
uiProps.LICENSE_PATH_VALUE = newLocation;
}
@Override
public void setGlobalLicenseName(@NullAllowed String newName) {
uiProps.LICENSE_NAME_VALUE = newName;
}
@Override
public String getDefaultProjectLicenseLocation() {
return "./nbproject/licenseheader.txt";
}
@Override
public void setProjectLicenseContent(@NullAllowed String text) {
uiProps.CHANGED_LICENSE_PATH_CONTENT = text;
}
};
return CustomizerUtilities.createLicenseHeaderCustomizerPanel(category, handler);
}
return new JPanel();
}
示例12: Single
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入方法依赖的package包/类
Single(SingleModuleProperties props, Class<?> helpCtxClass, ProjectCustomizer.Category cat) {
super(props, helpCtxClass, cat);
}
示例13: Suite
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入方法依赖的package包/类
public Suite(SuiteProperties props, Class<?> helpCtxClass, ProjectCustomizer.Category cat) {
super(props, helpCtxClass, cat);
}
示例14: createCategory
import org.netbeans.spi.project.ui.support.ProjectCustomizer; //导入方法依赖的package包/类
public ProjectCustomizer.Category createCategory(Lookup context) {
return ProjectCustomizer.Category.create(
CustomizerProviderImpl.CATEGORY_COMPILING,
NbBundle.getMessage(CustomizerCompilingFactory.class, "LBL_ConfigCompiling"),
null);
}
示例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;
return new CustomizerSources(props, category);
}