本文整理汇总了Java中org.netbeans.modules.maven.api.customizer.ModelHandle2类的典型用法代码示例。如果您正苦于以下问题:Java ModelHandle2类的具体用法?Java ModelHandle2怎么用?Java ModelHandle2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModelHandle2类属于org.netbeans.modules.maven.api.customizer包,在下文中一共展示了ModelHandle2类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CompilePanel
import org.netbeans.modules.maven.api.customizer.ModelHandle2; //导入依赖的package包/类
/** Creates new form CompilePanel */
public CompilePanel(ModelHandle2 handle, Project prj) {
initComponents();
this.handle = handle;
project = prj;
comJavaPlatform.setModel(new PlatformsModel());
comJavaPlatform.setRenderer(new PlatformsRenderer());
origComPlatformFore = comJavaPlatform.getForeground();
btnLearnMore.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
btnLearnMore.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
HtmlBrowser.URLDisplayer.getDefault().showURL(new URL("http://wiki.netbeans.org/FaqCompileOnSave#Using_Compile_on_Save_in_Maven_Projects"));
} catch (MalformedURLException ex) {
Exceptions.printStackTrace(ex);
}
}
});
initValues();
}
示例2: btnAddActionPerformed
import org.netbeans.modules.maven.api.customizer.ModelHandle2; //导入依赖的package包/类
private void btnAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddActionPerformed
NewConfigurationPanel pnl = new NewConfigurationPanel();
pnl.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(ConfigurationsPanel.class, "ACSD_Add_Config"));
DialogDescriptor dd = new DialogDescriptor(pnl, NbBundle.getMessage(ConfigurationsPanel.class, "TIT_Add_Config"));
pnl.attachDescriptor(dd);
Object ret = DialogDisplayer.getDefault().notify(dd);
if (ret == DialogDescriptor.OK_OPTION) {
ModelHandle2.Configuration conf = ModelHandle2.createCustomConfiguration(pnl.getConfigurationId());
conf.setShared(pnl.isShared());
conf.setActivatedProfiles(pnl.getProfiles());
conf.setProperties(ActionMappings.convertStringToActionProperties(pnl.getProperties()));
handle.addConfiguration(conf);
handle.markConfigurationsAsModified();
createListModel();
lstConfigurations.setSelectedValue(conf, true);
}
}
示例3: btnEditActionPerformed
import org.netbeans.modules.maven.api.customizer.ModelHandle2; //导入依赖的package包/类
private void btnEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditActionPerformed
ModelHandle2.Configuration conf = (ModelHandle2.Configuration) lstConfigurations.getSelectedValue();
if (conf != null) {
NewConfigurationPanel pnl = new NewConfigurationPanel();
pnl.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(ConfigurationsPanel.class, "ACSD_Edit_Config"));
pnl.setConfigurationId(conf.getId());
pnl.setProfiles(conf.getActivatedProfiles());
pnl.setProperties(ActionMappings.createPropertiesList(conf.getProperties()));
pnl.setShared(conf.isShared());
DialogDescriptor dd = new DialogDescriptor(pnl, NbBundle.getMessage(ConfigurationsPanel.class, "TIT_Edit_Config"));
Object ret = DialogDisplayer.getDefault().notify(dd);
if (ret == DialogDescriptor.OK_OPTION) {
conf.setShared(pnl.isShared());
conf.setActivatedProfiles(pnl.getProfiles());
conf.setProperties(ActionMappings.convertStringToActionProperties(pnl.getProperties()));
handle.markConfigurationsAsModified();
createListModel();
lstConfigurations.setSelectedValue(conf, true);
}
}
}
示例4: assertArgs
import org.netbeans.modules.maven.api.customizer.ModelHandle2; //导入依赖的package包/类
private void assertArgs(String argsString, String propString, AssertArgs a) throws IOException {
FileObject pom = TestFileUtils.writeFile(FileUtil.toFileObject(getWorkDir()), "pom.xml", "<project xmlns='http://maven.apache.org/POM/4.0.0'>\n"
+ " <modelVersion>4.0.0</modelVersion>\n"
+ " <groupId>grp</groupId>\n"
+ " <artifactId>art</artifactId>\n"
+ " <version>1.0</version>\n"
+ propString
+ " <build>\n"
+ " <plugins>\n"
+ " <plugin>\n"
+ " <groupId>org.codehaus.mojo</groupId>\n"
+ " <artifactId>exec-maven-plugin</artifactId>\n"
+ " <version>1.4.0</version>\n"
+ " <configuration>\n"
+ " <executable>${java.home}/bin/java</executable>\n"
+ argsString
+ " </configuration>\n"
+ " </plugin>\n"
+ " </plugins>\n"
+ " </build>\n"
+ "</project>\n");
Project project = ProjectManager.getDefault().findProject(pom.getParent());
NetbeansActionMapping mapp = ModelHandle2.getMapping("run", project, project.getLookup().lookup(M2ConfigProvider.class).getActiveConfiguration());
a.assertArgs(ModelRunConfig.getExecArgsByPom(mapp, project));
}
示例5: createCategory
import org.netbeans.modules.maven.api.customizer.ModelHandle2; //导入依赖的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;
}
示例6: createCategory
import org.netbeans.modules.maven.api.customizer.ModelHandle2; //导入依赖的package包/类
@Override
@Messages("TIT_Packages=Public Packages")
public Category createCategory(Lookup context) {
Project project = context.lookup(Project.class);
NbMavenProject watcher = project.getLookup().lookup(NbMavenProject.class);
if (NbMavenProject.TYPE_NBM.equalsIgnoreCase(watcher.getPackagingType())) {
return ProjectCustomizer.Category.create(
ModelHandle2.PANEL_COMPILE,
TIT_Packages(),
null);
}
return null;
}
示例7: InstallerPanel
import org.netbeans.modules.maven.api.customizer.ModelHandle2; //导入依赖的package包/类
@SuppressWarnings("ResultOfObjectAllocationIgnored")
private InstallerPanel(ProjectCustomizer.Category category, Project project, ModelHandle2 handle) {
this.category = category;
this.project = project;
this.handle = handle;
initComponents();
new BooleanPropUpdater(PROP_WINDOWS, true, windowsCheckBox);
new BooleanPropUpdater(PROP_SOLARIS, true, solarisCheckBox);
new BooleanPropUpdater(PROP_LINUX, true, linuxCheckBox);
new BooleanPropUpdater(PROP_MAC, true, macCheckBox);
new StringPropUpdater(PROP_LICENSE, licenseField, licenseLabel);
new BooleanPropUpdater(PROP_PACK200, true, pack200CheckBox);
}
示例8: PublicPackagesPanel
import org.netbeans.modules.maven.api.customizer.ModelHandle2; //导入依赖的package包/类
/** Creates new form PublicPackagesPanel */
public PublicPackagesPanel(ModelHandle2 handle, Project prj) {
this.handle = handle;
this.project = prj;
tableModel = new SelectedItemsTableModel(this);
initComponents();
jScrollPane1.getViewport().setBackground(exportTable.getBackground());
}
示例9: createCategory
import org.netbeans.modules.maven.api.customizer.ModelHandle2; //导入依赖的package包/类
@Override
@Messages("TIT_Compile=Compile")
public Category createCategory(Lookup context) {
return ProjectCustomizer.Category.create(
ModelHandle2.PANEL_COMPILE,
TIT_Compile(),
null);
}
示例10: setupConfigurations
import org.netbeans.modules.maven.api.customizer.ModelHandle2; //导入依赖的package包/类
private void setupConfigurations() {
lblConfiguration.setVisible(true);
comConfiguration.setVisible(true);
DefaultComboBoxModel comModel = new DefaultComboBoxModel();
for (ModelHandle2.Configuration conf : handle.getConfigurations()) {
comModel.addElement(conf);
}
comConfiguration.setModel(comModel);
comConfiguration.setSelectedItem(handle.getActiveConfiguration());
}
示例11: getCompilerParam
import org.netbeans.modules.maven.api.customizer.ModelHandle2; //导入依赖的package包/类
String getCompilerParam(ModelHandle2 handle, String param) {
CompilerParamOperation oper = operations.get(param);
if (oper != null) {
return oper.getValue();
}
String value = PluginPropertyUtils.getPluginProperty(handle.getProject(),
Constants.GROUP_APACHE_PLUGINS, Constants.PLUGIN_COMPILER, param,
"compile"); //NOI18N
if (value != null) {
return value;
}
return null;
}
示例12: createCategory
import org.netbeans.modules.maven.api.customizer.ModelHandle2; //导入依赖的package包/类
@Override
@Messages("TIT_Action_Mappings=Actions")
public Category createCategory(Lookup context) {
return ProjectCustomizer.Category.create(
ModelHandle2.PANEL_MAPPING,
TIT_Action_Mappings(),
null);
}
示例13: createCategory
import org.netbeans.modules.maven.api.customizer.ModelHandle2; //导入依赖的package包/类
@Override
@Messages("TIT_Basic=General")
public Category createCategory(Lookup context) {
return ProjectCustomizer.Category.create(
ModelHandle2.PANEL_BASIC,
TIT_Basic(),
null);
}
示例14: createCategory
import org.netbeans.modules.maven.api.customizer.ModelHandle2; //导入依赖的package包/类
@Override
@Messages("TIT_Headers=License Headers")
public Category createCategory(Lookup context) {
return ProjectCustomizer.Category.create(
ModelHandle2.PANEL_HEADERS,
TIT_Headers(),
null);
}
示例15: createCategory
import org.netbeans.modules.maven.api.customizer.ModelHandle2; //导入依赖的package包/类
@Override
@Messages("TIT_Run=Run")
public Category createCategory(Lookup context) {
NbMavenProjectImpl project = context.lookup(NbMavenProjectImpl.class);
NbMavenProject watcher = project.getLookup().lookup(NbMavenProject.class);
if (NbMavenProject.TYPE_JAR.equalsIgnoreCase(watcher.getPackagingType())) {
return ProjectCustomizer.Category.create(
ModelHandle2.PANEL_RUN,
TIT_Run(),
null);
}
return null;
}