当前位置: 首页>>代码示例>>Java>>正文


Java WizardDescriptor.getProperty方法代码示例

本文整理汇总了Java中org.openide.WizardDescriptor.getProperty方法的典型用法代码示例。如果您正苦于以下问题:Java WizardDescriptor.getProperty方法的具体用法?Java WizardDescriptor.getProperty怎么用?Java WizardDescriptor.getProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openide.WizardDescriptor的用法示例。


在下文中一共展示了WizardDescriptor.getProperty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import org.openide.WizardDescriptor; //导入方法依赖的package包/类
public void initialize(WizardDescriptor wiz) {
    this.wizardDescriptor = wiz;
    
    Object prop = wiz.getProperty(WizardDescriptor.PROP_CONTENT_DATA); //NOI18N
    String[] beforeSteps = null;
    if (prop != null && prop instanceof String[]) {
        beforeSteps = (String[]) prop;
    }
    String[] steps = createSteps(beforeSteps, panels);
    
    // Make sure list of steps is accurate.
    for (int i = 0; i < panels.length; i++) {
        Component c = panels[i].getComponent();
        if (c instanceof JComponent) { // assume Swing components
            JComponent jc = (JComponent) c;
            // Step #.
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, //NOI18N
                                                new Integer(i)); 
            // Step name (actually the whole list for reference).
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); //NOI18N
        }
    }        
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:JAXBWizardIterator.java

示例2: populateXjcOptions

import org.openide.WizardDescriptor; //导入方法依赖的package包/类
private static XjcOptions populateXjcOptions(WizardDescriptor wiz) {
    XjcOptions xjcOpts = new XjcOptions();
    Map<String, Boolean> options = (Map<String, Boolean>) wiz.getProperty(
            JAXBWizModuleConstants.XJC_OPTIONS);
    if (options != null) {
        Set<String> keys = options.keySet();
        Iterator<String> itr = keys.iterator();
        String key = null;
        Boolean value;
        XjcOption xjcOption = null;

        while (itr.hasNext()) {
            key = itr.next();
            value = options.get(key);
            xjcOption = new XjcOption();
            xjcOption.setName(key);
            xjcOption.setValue(value.toString());
            xjcOpts.addXjcOption(xjcOption);
        }
    }
    return xjcOpts;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:ProjectHelper.java

示例3: readSettings

import org.openide.WizardDescriptor; //导入方法依赖的package包/类
@Override
public void readSettings(WizardDescriptor wiz) {
    if (wizard == null) {
        wizard = wiz;
    }

    component.setContainerName((String) wiz.getProperty(RunTagWizard.NAME_PROPERTY));
    component.setCommand((String) wiz.getProperty(RunTagWizard.COMMAND_PROPERTY));
    component.setUser((String) wiz.getProperty(RunTagWizard.USER_PROPERTY));
    Boolean interactive = (Boolean) wiz.getProperty(RunTagWizard.INTERACTIVE_PROPERTY);
    component.setInteractive(interactive != null ? interactive : false);
    Boolean tty = (Boolean) wiz.getProperty(RunTagWizard.TTY_PROPERTY);
    component.setTty(tty != null ? tty : false);
    Boolean privileged = (Boolean) wiz.getProperty(RunTagWizard.PRIVILEGED_PROPERTY);
    component.setPrivileged(privileged != null ? privileged : false);
    Boolean mountVolumes = (Boolean) wiz.getProperty(RunTagWizard.VOLUMES_PROPERTY);
    component.setMountVolumesSelected(mountVolumes != null ? mountVolumes : false);
    // XXX revalidate; is this bug?
    changeSupport.fireChange();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:RunContainerPropertiesPanel.java

示例4: instantiateBasicProjectInfoWizardPanel

import org.openide.WizardDescriptor; //导入方法依赖的package包/类
/**
 * Instantiate project according to information gathered in 
 * Basic Project Info panel. The method must to be called
 * under ProjectManager.writeMutex.
 */
public static final AntProjectHelper instantiateBasicProjectInfoWizardPanel(WizardDescriptor wiz) throws IOException {
    // XXX assert ProjectManager.mutex().isWriteAccess()
    File antScript = (File)wiz.getProperty(PROP_ANT_SCRIPT);
    String projName = (String)wiz.getProperty(PROP_PROJECT_NAME);
    File projLocation = (File)wiz.getProperty(PROP_PROJECT_LOCATION);
    File projectFolder = (File)wiz.getProperty(PROP_PROJECT_FOLDER);
    if (antScript.getParentFile().equals(projectFolder) && antScript.getName().equals("build.xml")) { // NOI18N
        // default location of build file
        antScript = null;
    }
    return FreeformProjectGenerator.createProject(projLocation, projectFolder, projName, antScript);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:NewFreeformProjectSupport.java

示例5: valid

import org.openide.WizardDescriptor; //导入方法依赖的package包/类
@Override
boolean valid(WizardDescriptor settings) {
    File projectLocation = (File) settings.getProperty("projdir"); // NOI18N
    File[] sourceRoots = ((FolderList) this.sourcePanel).getFiles();
    File[] testRoots = ((FolderList) this.testsPanel).getFiles();
    String result = checkValidity(projectLocation, sourceRoots, testRoots);
    if (result == null) {
        wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, ""); // NOI18N
        return true;
    } else {
        wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, result);
        return false;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:PanelSourceFolders.java

示例6: getTargetName

import org.openide.WizardDescriptor; //导入方法依赖的package包/类
/** Method to communicate current choice of target name to a custom 
 * {@link org.openide.WizardDescriptor.InstantiatingIterator} associated with particular template.
 * @param wizardDescriptor a file wizard
 * @return the selected target name (could be null?)
 * @see org.openide.loaders.TemplateWizard#getTargetName
 * @see ProjectChooserFactory#WIZARD_KEY_TARGET_NAME
 */
public static String getTargetName( WizardDescriptor wizardDescriptor ) {
    if ( wizardDescriptor instanceof TemplateWizard ) {
        return ((TemplateWizard)wizardDescriptor).getTargetName();
    }
    else {
        return (String) wizardDescriptor.getProperty( ProjectChooserFactory.WIZARD_KEY_TARGET_NAME );
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:Templates.java

示例7: readSettings

import org.openide.WizardDescriptor; //导入方法依赖的package包/类
void readSettings(WizardDescriptor wiz) {
    String loc = (String) wiz.getProperty(SharableLibrariesUtils.PROP_LOCATION);
    helper = (AntProjectHelper) wiz.getProperty(SharableLibrariesUtils.PROP_HELPER);
    refhelper = (ReferenceHelper) wiz.getProperty(SharableLibrariesUtils.PROP_REFERENCE_HELPER);
    List<String> libraries = NbCollections.checkedListByCopy((List) wiz.getProperty(SharableLibrariesUtils.PROP_LIBRARIES), String.class, true);
    List<String> jars = NbCollections.checkedListByCopy((List) wiz.getProperty(SharableLibrariesUtils.PROP_JAR_REFS), String.class, true);
    if (!loc.equals(location)) {
        location = loc;
        populateTable(helper, libraries, jars);
        populateDescriptionField();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:MakeSharableVisualPanel2.java

示例8: readSettings

import org.openide.WizardDescriptor; //导入方法依赖的package包/类
public void readSettings(Object settings) {
    wizardDescriptor = (WizardDescriptor) settings;
    ProjectModel pm = (ProjectModel) wizardDescriptor.getProperty(NewJ2SEFreeformProjectWizardIterator.PROP_PROJECT_MODEL);
    getComponent();
    component.setModel(pm);
    wizardDescriptor.putProperty("NewProjectWizard_Title", 
            component.getClientProperty("NewProjectWizard_Title")); // NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:OutputWizardPanel.java

示例9: instantiate

import org.openide.WizardDescriptor; //导入方法依赖的package包/类
@Override
public Set<FileObject> instantiate (ProgressHandle handle) throws IOException {
    final WizardDescriptor myWiz = this.wiz;
    if (myWiz == null) {
        LOG.warning("The uninitialize called before instantiate."); //NOI18N
        return Collections.emptySet();
    }
    handle.start (3);
    Set<FileObject> resultSet = new HashSet<>();
    File dirF = (File)myWiz.getProperty("projdir"); //NOI18N
    if (dirF == null) {
        throw new NullPointerException ("projdir == null, props:" + myWiz.getProperties()); //NOI18N
    }
    dirF = FileUtil.normalizeFile(dirF);
    String name = (String)myWiz.getProperty("name"); //NOI18N
    JavaPlatform platform = (JavaPlatform)myWiz.getProperty("javaPlatform"); //NOI18N
    handle.progress (NbBundle.getMessage (NewJ2SEModularProjectWizardIterator.class, "LBL_NewJ2SEModuleProjectWizardIterator_WizardProgress_CreatingProject"), 1);
    J2SEModularProjectGenerator.createProject(dirF, name, platform);
    handle.progress (2);
    FileObject dir = FileUtil.toFileObject(dirF);

    // Returning FileObject of project diretory.
    // Project will be open and set as main
    final Integer ind = (Integer) myWiz.getProperty(PROP_NAME_INDEX);
    if (ind != null) {
        WizardSettings.setNewProjectCount(ind);
    }
    resultSet.add (dir);
    handle.progress (NbBundle.getMessage (NewJ2SEModularProjectWizardIterator.class, "LBL_NewJ2SEModuleProjectWizardIterator_WizardProgress_PreparingToOpen"), 3);
    dirF = (dirF != null) ? dirF.getParentFile() : null;
    if (dirF != null && dirF.exists()) {
        ProjectChooser.setProjectsFolder (dirF);
    }

    SharableLibrariesUtils.setLastProjectSharable(false);
    return resultSet;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:38,代码来源:NewJ2SEModularProjectWizardIterator.java

示例10: getTemplate

import org.openide.WizardDescriptor; //导入方法依赖的package包/类
/**
 * Find the template with which a custom template wizard iterator is associated.
 * <p class="nonnormative">
 * If the user selects File | New File, this will be the template chosen in the first panel.
 * If the user selects New from {@link org.netbeans.spi.project.ui.support.CommonProjectActions#newFileAction}, this will
 * be the template selected from the context submenu.
 * </p>
 * @param wizardDescriptor a file or project wizard
 * @return the corresponding template marker file (or null if not set)
 */
public static FileObject getTemplate( WizardDescriptor wizardDescriptor ) {
    if (wizardDescriptor == null) {
        throw new IllegalArgumentException("Cannot pass a null wizardDescriptor"); // NOI18N
    }
    if ( wizardDescriptor instanceof TemplateWizard ) {
        DataObject template = ((TemplateWizard)wizardDescriptor).getTemplate();
        if (template != null) {
            return template.getPrimaryFile();            
        }
    }
    return (FileObject) wizardDescriptor.getProperty( ProjectChooserFactory.WIZARD_KEY_TEMPLATE );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:Templates.java

示例11: read

import org.openide.WizardDescriptor; //导入方法依赖的package包/类
void read (WizardDescriptor settings) {
    File projectLocation = (File) settings.getProperty ("projdir");  //NOI18N
    if (projectLocation == null || projectLocation.getParentFile() == null ||
        (projectLocation.getParentFile().exists() && !projectLocation.getParentFile().isDirectory ())) {
        projectLocation = ProjectChooser.getProjectsFolder();
    }
    else {
        projectLocation = projectLocation.getParentFile();
    }
    this.projectLocationTextField.setText (projectLocation.getAbsolutePath());
    
    String projectName = (String) settings.getProperty ("name"); //NOI18N
    if (projectName == null) {
        switch (type) {
        case APP:
            int baseCount = WizardSettings.getNewApplicationCount() + 1;
            String formatter = NbBundle.getMessage(PanelSourceFolders.class,"TXT_JavaApplication");
            while ((projectName=validFreeProjectName(projectLocation, formatter, baseCount))==null)
                baseCount++;                
            settings.putProperty (NewJ2SEProjectWizardIterator.PROP_NAME_INDEX, new Integer(baseCount));
            break;
        default:
            baseCount = WizardSettings.getNewLibraryCount() + 1;
            formatter = NbBundle.getMessage(PanelSourceFolders.class,"TXT_JavaLibrary");
            while ((projectName=validFreeProjectName(projectLocation, formatter, baseCount))==null)
                baseCount++;                
            settings.putProperty (NewJ2SEProjectWizardIterator.PROP_NAME_INDEX, new Integer(baseCount));
        }            
    }
    this.projectNameTextField.setText (projectName);                
    this.projectNameTextField.selectAll();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:PanelProjectLocationVisual.java

示例12: getProjectFolder

import org.openide.WizardDescriptor; //导入方法依赖的package包/类
static File getProjectFolder( WizardDescriptor settings) {
    if (settings != null) {
        Object value = settings.getProperty(PROJECT_FOLDER);
        if (value != null && value instanceof File) {
            return (File) value;
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:TypeChooserPanelImpl.java

示例13: read

import org.openide.WizardDescriptor; //导入方法依赖的package包/类
void read(WizardDescriptor d) {
    synchronized (HANDLE_LOCK) {
        if (handle != null) {
            handle.finish();
            handle = null;
        }
    }        
    
    Boolean b = (Boolean) d.getProperty(NbmWizardIterator.OSGIDEPENDENCIES);
    if (b != null) {
        cbOsgiDeps.setSelected(b.booleanValue());
    }
    if (isApp) {
        String artifId = (String) d.getProperty("artifactId");
        String val = (String) d.getProperty(NbmWizardIterator.NBM_ARTIFACTID);
        cbAddModule.setSelected(val != null);
        if (val == null) {
            val = artifId + "-sample";
        }
        txtAddModule.setText(val);

    }
    String version = (String) d.getProperty(NbmWizardIterator.NB_VERSION);
    if (version != null) {
        versionCombo.setSelectedItem(version);
    }
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            panel.getValidationGroup().addItem(vg, true);
            panel.getEnabledStateValidationGroup().addItem(vgEnabled, true);
            vgEnabled.performValidation();
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:36,代码来源:NbmWizardPanelVisual.java

示例14: read

import org.openide.WizardDescriptor; //导入方法依赖的package包/类
@Override
void read(WizardDescriptor settings) {
    File projectLocation = (File) settings.getProperty("projdir");  //NOI18N
    if (projectLocation == null || projectLocation.getParentFile() == null || !projectLocation.getParentFile().isDirectory()) {
        projectLocation = ProjectChooser.getProjectsFolder();
    } else {
        projectLocation = projectLocation.getParentFile();
    }
    this.projectLocationTextField.setText(projectLocation.getAbsolutePath());

    String projectName = (String) settings.getProperty("name"); //NOI18N
    if (projectName == null) {
        switch (type) {
            case APPLICATION:
            case FXML:
                int baseCount = WizardSettings.getNewApplicationCount() + 1;
                String formatter = NbBundle.getMessage(PanelSourceFolders.class, "TXT_JavaFXApplication"); // NOI18N
                while ((projectName = validFreeProjectName(projectLocation, formatter, baseCount)) == null) {
                    baseCount++;
                }
                settings.putProperty(JavaFXProjectWizardIterator.PROP_NAME_INDEX, new Integer(baseCount));
                break;
            case PRELOADER:
                baseCount = WizardSettings.getNewPreloaderCount() + 1;
                formatter = NbBundle.getMessage(PanelSourceFolders.class, "TXT_JavaFXPreloaderApplication"); // NOI18N
                while ((projectName = validFreeProjectName(projectLocation, formatter, baseCount)) == null) {
                    baseCount++;
                }
                settings.putProperty(JavaFXProjectWizardIterator.PROP_NAME_INDEX, new Integer(baseCount));
                break;
            case SWING:
                baseCount = WizardSettings.getNewFxSwingCount() + 1;
                formatter = NbBundle.getMessage(PanelSourceFolders.class, "TXT_JavaFXSwingApplication"); // NOI18N
                while ((projectName = validFreeProjectName(projectLocation, formatter, baseCount)) == null) {
                    baseCount++;
                }
                settings.putProperty(JavaFXProjectWizardIterator.PROP_NAME_INDEX, new Integer(baseCount));
                break;
            default:
                baseCount = WizardSettings.getNewLibraryCount() + 1;
                formatter = NbBundle.getMessage(PanelSourceFolders.class, "TXT_JavaLibrary"); // NOI18N
                while ((projectName = validFreeProjectName(projectLocation, formatter, baseCount)) == null) {
                    baseCount++;
                }
                settings.putProperty(JavaFXProjectWizardIterator.PROP_NAME_INDEX, new Integer(baseCount));
        }
    }
    this.projectNameTextField.setText(projectName);
    this.projectNameTextField.selectAll();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:51,代码来源:PanelProjectLocationVisual.java

示例15: show

import org.openide.WizardDescriptor; //导入方法依赖的package包/类
@NbBundle.Messages("LBL_BuildImage=Build Image")
public void show() {
    List<WizardDescriptor.Panel<WizardDescriptor>> panels = new ArrayList<>();
    if (instance == null) {
        panels.add(new BuildInstancePanel());
    }
    panels.add(new BuildContextPanel(fileSystem));
    panels.add(new BuildOptionsPanel());
    String[] steps = new String[panels.size()];
    for (int i = 0; i < panels.size(); i++) {
        JComponent c = (JComponent) panels.get(i).getComponent();
        // Default step name to component name of panel.
        steps[i] = c.getName();
        c.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i);
        c.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);
        c.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, true);
        c.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, true);
        c.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, true);
    }

    WizardDescriptor wiz = new WizardDescriptor(new WizardDescriptor.ArrayIterator<>(panels));
    // {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
    wiz.setTitleFormat(new MessageFormat("{0}"));
    wiz.setTitle(Bundle.LBL_BuildImage());

    if (instance != null) {
        wiz.putProperty(INSTANCE_PROPERTY, instance);
    }
    if (dockerfile != null && dockerfile.isData()) {
        wiz.putProperty(BUILD_CONTEXT_PROPERTY, dockerfile.getParent().getPath());
        wiz.putProperty(DOCKERFILE_PROPERTY, dockerfile.getName());
    }
    wiz.putProperty(FILESYSTEM_PROPERTY, fileSystem);

    if (DialogDisplayer.getDefault().notify(wiz) == WizardDescriptor.FINISH_OPTION) {
        Boolean pull = (Boolean) wiz.getProperty(PULL_PROPERTY);
        Boolean noCache = (Boolean) wiz.getProperty(NO_CACHE_PROPERTY);
        build((DockerInstance) wiz.getProperty(INSTANCE_PROPERTY),
                (String) wiz.getProperty(BUILD_CONTEXT_PROPERTY),
                (String) wiz.getProperty(DOCKERFILE_PROPERTY),
                (Map<String, String>) wiz.getProperty(BUILD_ARGUMENTS_PROPERTY),
                (String) wiz.getProperty(REPOSITORY_PROPERTY),
                (String) wiz.getProperty(TAG_PROPERTY),
                pull != null ? pull : PULL_DEFAULT,
                noCache != null ? noCache : NO_CACHE_DEFAULT);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:48,代码来源:BuildImageWizard.java


注:本文中的org.openide.WizardDescriptor.getProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。