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

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

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

Templates.setTargetName介绍

暂无

代码示例

代码示例来源:origin: AlexFalappa/nb-springboot

boolean valid(WizardDescriptor wizardDescriptor) {
  if (txBaseName.getText().isEmpty()) {
    // Base name not specified
    wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, "Base name cannot be empty!");
    return false;
  }
  File f = getCreatedFile();
  if (f.exists()) {
    // Existing file
    wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, "Application properties file exists!");
    return false;
  }
  wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, "");
  final FileObject targetFolder = FileUtil.toFileObject(f.getParentFile());
  Templates.setTargetFolder(wizardDescriptor, targetFolder);
  Templates.setTargetName(wizardDescriptor, f.getName());
  return true;
}

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

public void storeSettings(Object settings) { 
  if ( WizardDescriptor.PREVIOUS_OPTION.equals( ((WizardDescriptor)settings).getValue() ) ) {
    return;
  }
  if( isValid() ) {
    if ( bottomPanel != null ) {
      bottomPanel.storeSettings( settings );
    }
    
    FileObject template = Templates.getTemplate( wizard );
    
    String name = gui.getTargetName ();
    if (name.indexOf ('/') > 0) { // NOI18N
      name = name.substring (name.lastIndexOf ('/') + 1);
    }
    
    Templates.setTargetFolder( (WizardDescriptor)settings, getTargetFolderFromGUI () );
    Templates.setTargetName( (WizardDescriptor)settings, name );
  }
  ((WizardDescriptor)settings).putProperty ("NewFileWizard_Title", null); // NOI18N
}

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

@Override
public void storeSettings(WizardDescriptor wizard) {
  Object value = wizard.getValue();
  if (WizardDescriptor.PREVIOUS_OPTION.equals(value) || WizardDescriptor.CANCEL_OPTION.equals(value)
      || WizardDescriptor.CLOSED_OPTION.equals(value)) {
    return;
  }
  if (isValid()) {
    if (bottomPanel != null) {
      bottomPanel.storeSettings(wizard);
    }
    Templates.setTargetFolder(wizard, getTargetFolderFromGUI(wizard));
    Templates.setTargetName(wizard, gui.getTargetName());
  }
  wizard.putProperty("NewFileWizard_Title", null); // NOI18N
  if (WizardDescriptor.FINISH_OPTION.equals(value)) {
    wizard.putProperty(FOLDER_TO_DELETE, null);
  }
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-java-project-ui

@Override
public void storeSettings(WizardDescriptor wizard) { 
  Object value = wizard.getValue();
  if (WizardDescriptor.PREVIOUS_OPTION.equals(value) || WizardDescriptor.CANCEL_OPTION.equals(value) ||
      WizardDescriptor.CLOSED_OPTION.equals(value)) {
    return;
  }
  if( isValid() ) {
    if ( bottomPanel != null ) {
      bottomPanel.storeSettings( wizard );
    }
    Templates.setTargetFolder(wizard, getTargetFolderFromGUI(wizard));
    Templates.setTargetName(wizard, gui.getTargetName());
  }
  wizard.putProperty("NewFileWizard_Title", null); // NOI18N
  
  if (WizardDescriptor.FINISH_OPTION.equals(value)) {
    wizard.putProperty(FOLDER_TO_DELETE, null);
  }
}

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

@Override
public void storeSettings(Object settings) {
  if (settings instanceof TemplateWizard) {
    TemplateWizard wiz = (TemplateWizard) settings;
    if (WizardDescriptor.PREVIOUS_OPTION.equals(wiz.getValue())) {
      return;
    }
    if (!wiz.getValue().equals(WizardDescriptor.CANCEL_OPTION) && isValid()) {
      FileObject template = Templates.getTemplate(wiz);
      String name = component.getTargetName();
      if (name.indexOf('/') > 0) { // NOI18N
        name = name.substring(name.lastIndexOf('/') + 1);
      }
      Templates.setTargetFolder(wiz, getTargetFolderFromGUI());
      Templates.setTargetName(wiz, name);
    }
    wiz.putProperty("NewFileWizard_Title", null); // NOI18N
    wiz.putProperty("selectedPrefix", component.getPrefix()); //NOI18N
  }
}

代码示例来源:origin: AlexFalappa/nb-springboot

Templates.setTargetName(wizard, targetName);
File fExisting = new File(fDir, targetName);
if (fExisting.exists()) {

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

@Override
public void storeSettings(WizardDescriptor settings) {
  if (WizardDescriptor.PREVIOUS_OPTION.equals(settings.getValue())) {
    return;
  }
  if(!settings.getValue().equals(WizardDescriptor.CANCEL_OPTION) && isValid()) {
    if ( bottomPanel != null ) {
      bottomPanel.storeSettings( settings );
    }
    
    String name = gui.getTargetName ();
    if (name.indexOf ('/') > 0) { // NOI18N
      name = name.substring (name.lastIndexOf ('/') + 1);
    }
    
    FileObject fo = getTargetFolderFromGUI();
    try {
      Templates.setTargetFolder(settings, fo);
    } catch (IllegalArgumentException iae) {
      ErrorManager.getDefault().annotate(iae, ErrorManager.EXCEPTION, null, 
          NbBundle.getMessage(NewCndFileChooserPanel.class, "MSG_Cannot_Create_Folder", 
          gui.getTargetFolder()), null, null);
      throw iae;
    }
    Templates.setTargetName(settings, name);
    doStoreSettings(settings);
  }
  settings.putProperty("NewFileWizard_Title", null); // NOI18N
}

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

Templates.setTargetName(settings, gui.getTargetName());

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

Templates.setTargetName(wizard, defaultName);
Templates.setTargetFolder(wizard, targetFolder );

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

Templates.setTargetName(wizard, defaultName);

相关文章