org.netbeans.spi.project.ui.templates.support.Templates.getProject()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中org.netbeans.spi.project.ui.templates.support.Templates.getProject()方法的一些代码示例,展示了Templates.getProject()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Templates.getProject()方法的具体详情如下:
包路径:org.netbeans.spi.project.ui.templates.support.Templates
类名称:Templates
方法名:getProject

Templates.getProject介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf

public CompositeComponentWizardPanel(TemplateWizard wizard, SourceGroup[] folders, String selectedText) {
  this.wizard = wizard;
  text = selectedText;
  this.folders = folders;
  project = Templates.getProject(wizard);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf

ResourceLibraryIteratorPanel(WizardDescriptor descriptor, FileObject contractsParent, ProjectType projectType) {
  this.descriptor = descriptor;
  this.contractsParent = contractsParent;
  this.projectType = projectType;
  this.project = Templates.getProject(descriptor);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project

private PhpProject getPhpProject() {
  Project project = Templates.getProject(wizard);
  if (project == null) {
    // no project => ignore
    return null;
  }
  if (!(project instanceof PhpProject)) {
    LOGGER.log(Level.WARNING, "PHP project expected but found {0}", project.getClass().getName());
    return null;
  }
  return (PhpProject) project;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-sun-ddui

public void readSettings(Object settings) {
  wizardDescriptor = (WizardDescriptor) settings;
  if (project == null) {
    project = Templates.getProject(wizardDescriptor);
    component.setProject(project);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-glassfish-javaee

@Override
public void readSettings(Object settings) {
  wizardDescriptor = (WizardDescriptor) settings;
  if (project == null) {
    project = Templates.getProject(wizardDescriptor);
    component.setProject(project);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javaee-project

public void readSettings(Object settings) {
  wizardDescriptor = (WizardDescriptor) settings;
  if (project == null) {
    project = Templates.getProject(wizardDescriptor);
    component.setProject(project);
  }
  wizardDescriptor.putProperty ("NewFileWizard_Title", // NOI18N
    NbBundle.getMessage(ApplicationXmlWizardPanel1.class, "TITLE_StdDdFile"));
  
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-core

public void readSettings(Object settings) {
  wizardDescriptor = (WizardDescriptor) settings;
  if (project == null) {
    project = Templates.getProject(wizardDescriptor);
    component.setProject(project);
  }
  wizardDescriptor.putProperty("NewFileWizard_Title", // NOI18N
    NbBundle.getMessage(WebXmlWizardPanel1.class, "TITLE_webXmlFile")); // NOI18N
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-core

public void readSettings(Object settings) {
  wizardDescriptor = (WizardDescriptor) settings;
  if (project == null) {
    project = Templates.getProject(wizardDescriptor);
    component.setProject(project);
  }
  wizardDescriptor.putProperty("NewFileWizard_Title", // NOI18N
    NbBundle.getMessage(WebFragmentXmlWizardPanel1.class, "TITLE_webFragmentXmlFile")); // NOI18N
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-groovy-support

@Override
public void initialize(WizardDescriptor wiz) {
  project = Templates.getProject(wiz);
  strategy = findCorrectStrategy();
  super.initialize(wiz);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-core

public static WebModule findWebModule(TemplateWizard wizard) {
    Project project = Templates.getProject(wizard);
    return WebModule.getWebModule(project.getProjectDirectory());
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf

@Override
public void initialize(TemplateWizard wiz) {
  descriptor = wiz;
  Project project = Templates.getProject(wiz);
  FileObject contractsParent = getNearestContractsParent(project);
  loadPanelsAndSteps(contractsParent);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf

private void browseFolderButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseFolderButtonActionPerformed
  Sources s = (Sources) Templates.getProject(wizard).getLookup().lookup(Sources.class);
  org.netbeans.api.project.SourceGroup[] groups = s.getSourceGroups(WebProjectConstants.TYPE_DOC_ROOT);
  org.openide.filesystems.FileObject fo = BrowseFolders.showDialog(groups);
  if (fo!=null) {
    String res = "/"+JSFConfigUtilities.getResourcePath(groups,fo,'/',true);
    jsfFolder.setText(res);
  }
}//GEN-LAST:event_browseFolderButtonActionPerformed

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-selenium2-php

@Override
public WizardDescriptor.Panel createTargetChooserPanel(WizardDescriptor wiz) {
  Project project = Templates.getProject(wiz);
  SourceGroup seleniumSourceGroup = getSeleniumSourceGroup(project);
  return Templates.buildSimpleTargetChooser(project, new SourceGroup[]{seleniumSourceGroup}).create();
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd

@Override
protected Panel<WizardDescriptor> createPanel(TemplateWizard wiz) {
  Project project = Templates.getProject(wiz);
  Sources sources = ProjectUtils.getSources(project);
  SourceGroup[] groups = sources.getSourceGroups(Sources.TYPE_GENERIC);
  return new NewQtFormPanel(project, groups);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd

@Override
public void initialize(WizardDescriptor wiz) {
  templateWizard = (TemplateWizard) wiz;
  Project project = Templates.getProject(wiz);
  Sources sources = ProjectUtils.getSources(project);
  SourceGroup[] groups = sources.getSourceGroups(Sources.TYPE_GENERIC);
  targetChooserDescriptorPanel = new NewCndClassPanel(project, groups, null);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf

@Override
public Set<DataObject> instantiate(TemplateWizard wizard) throws IOException {
  Project project = Templates.getProject( wizard );
  String targetName = Templates.getTargetName(wizard);
  FileObject targetDir = Templates.getTargetFolder(wizard);
  FileObject fo = createFacesConfig(project, targetDir, targetName, true);
  if (fo != null) {
    return Collections.singleton(DataObject.find(fo));
  } else {
    return Collections.EMPTY_SET;
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf

public static boolean isJavaEE5(TemplateWizard wizard) {
  Project project = Templates.getProject(wizard);
  WebModule wm = WebModule.getWebModule(project.getProjectDirectory());
  if (wm != null) {
    Profile profile = wm.getJ2eeProfile();
    return (profile == Profile.JAVA_EE_5);
  }
  return false;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-spring-beans

private void addLibrariesToClassPath(Library[] libraries) throws IOException {
  FileObject artifact = getSourceGroupArtifact(Templates.getProject(wizard), Templates.getTargetFolder(wizard));
  if (artifact != null) {
    ProjectClassPathModifier.addLibraries(libraries, artifact, ClassPath.COMPILE);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf

private SourceGroup[] getProjectDocumentSourceGroups() {
  Sources sources = ProjectUtils.getSources(Templates.getProject(wizardDescriptor));
  SourceGroup[] docSourceGroups = sources.getSourceGroups(WebProjectConstants.TYPE_DOC_ROOT);
  SourceGroup[] sourceGroups;
  if (docSourceGroups.length == 0) {
    sourceGroups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
  } else {
    sourceGroups = docSourceGroups;
  }
  return sourceGroups;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-clientproject

private WizardDescriptor.Panel<WizardDescriptor>[] getPanels() {
  Project project = Templates.getProject(descriptor);
  SourceGroup[] groups = getSourceGroups(project, Templates.getTemplate(descriptor));
  WizardDescriptor.Panel<WizardDescriptor> simpleTargetChooserPanel = Templates.buildSimpleTargetChooser(project, groups).create();
  @SuppressWarnings({"unchecked", "rawtypes"})
  WizardDescriptor.Panel<WizardDescriptor>[] panels = new WizardDescriptor.Panel[] {simpleTargetChooserPanel};
  return panels;
}

相关文章