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


Java Component.getName方法代码示例

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


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

示例1: initialize

import java.awt.Component; //导入方法依赖的package包/类
void initialize(ShortcutWizard wiz) {
    this.wiz = wiz;
    index = 0;
    panels = createPanels ();
    // #44409: make sure IntroWizardPanel knows about wiz
    // XXX workaround should no longer be necessary...
    ((IntroPanel.IntroWizardPanel) panels.get(0)).initialize(wiz);
    // Make sure list of steps is accurate.
    String[] steps = createSteps ();
    for (int i = 0; i < panels.size(); i++) {
        Component c = panels.get(i).getComponent();
        if (steps[i] == null) {
            // Default step name to component name of panel.
            // Mainly useful for getting the name of the target
            // chooser to appear in the list of steps.
            steps[i] = c.getName ();
        }
        if (c instanceof JComponent) { // assume Swing components
            JComponent jc = (JComponent) c;
            // Step #.
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i); // NOI18N
            // Step name (actually the whole list for reference).
            jc.putClientProperty (WizardDescriptor.PROP_CONTENT_DATA, steps); // NOI18N
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:ShortcutIterator.java

示例2: initialize

import java.awt.Component; //导入方法依赖的package包/类
public void initialize(WizardDescriptor wiz) {
    this.wiz = wiz;
    index = 0;
    panels = createPanels();
    // Make sure list of steps is accurate.
    String[] steps = createSteps();
    for (int i = 0; i < panels.length; i++) {
        Component c = panels[i].getComponent();
        if (steps[i] == null) {
            // Default step name to component name of panel.
            // Mainly useful for getting the name of the target
            // chooser to appear in the list of steps.
            steps[i] = c.getName();
        }
        if (c instanceof JComponent) { // assume Swing components
            JComponent jc = (JComponent) c;
            // Step #.
            // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
            jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
            // Step name (actually the whole list for reference).
            jc.putClientProperty("WizardPanel_contentData", steps);
        }
    }
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:25,代码来源:ExampleBotProjectWizardIterator.java

示例3: initialize

import java.awt.Component; //导入方法依赖的package包/类
@Override
public void initialize(WizardDescriptor wiz) {
    this.wiz = wiz;

    index = 0;
    panels = createPanels();
    // Make sure list of steps is accurate.
    String[] steps = createSteps();
    for (int i = 0; i < panels.length; i++) {
        Component c = panels[i].getComponent();
        if (steps[i] == null) {
            // Default step name to component name of panel.
            // Mainly useful for getting the name of the target
            // chooser to appear in the list of steps.
            steps[i] = c.getName();
        }
        if (c instanceof JComponent) { // assume Swing components
            JComponent jc = (JComponent) c;
            // Step #.
            jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
            // Step name (actually the whole list for reference).
            jc.putClientProperty("WizardPanel_contentData", steps);
        }
    }
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:26,代码来源:TemplateBotProjectWizardIterator.java

示例4: initialize

import java.awt.Component; //导入方法依赖的package包/类
@Override
public void initialize(WizardDescriptor wiz) {
    this.wiz = wiz;
    index = 0;
    panels = createPanels();
    // Make sure list of steps is accurate.
    String[] steps = createSteps();
    for (int i = 0; i < panels.length; i++) {
        Component c = panels[i].getComponent();
        if (steps[i] == null) {
            // Default step name to component name of panel.
            // Mainly useful for getting the name of the target
            // chooser to appear in the list of steps.
            steps[i] = c.getName();
        }
        if (c instanceof JComponent) { // assume Swing components
            JComponent jc = (JComponent) c;
            // Step #.
            // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
            jc.putClientProperty("WizardPanel_contentSelectedIndex", i);
            // Step name (actually the whole list for reference).
            jc.putClientProperty("WizardPanel_contentData", steps);
        }
    }
}
 
开发者ID:onekosha,项目名称:nb-clojure,代码行数:26,代码来源:ClojureTemplateWizardIterator.java

示例5: initialize

import java.awt.Component; //导入方法依赖的package包/类
@Override
public void initialize(WizardDescriptor wiz) {
    this.wiz = wiz;
    index = 0;
    panels = createPanels();
    // Make sure list of steps is accurate.
    String[] steps = createSteps();
    for (int i = 0; i < panels.length; i++) {
        Component c = panels[i].getComponent();
        if (steps[i] == null) {
            // Default step name to component name of panel.
            // Mainly useful for getting the name of the target
            // chooser to appear in the list of steps.
            steps[i] = c.getName();
        }
        if (c instanceof JComponent) { // assume Swing components
            JComponent jc = (JComponent) c;
            // Step #.
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i);
            // Step name (actually the whole list for reference).
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);
        }
    }
    //set the default values of the sourceRoot and the testRoot properties
    this.wiz.putProperty("sourceRoot", new File[0]); // NOI18N
    this.wiz.putProperty("testRoot", new File[0]); // NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:JavaFXProjectWizardIterator.java

示例6: initialize

import java.awt.Component; //导入方法依赖的package包/类
/**
 * Initialization of the wizard iterator.
 */
public void initialize(TemplateWizard wizard) {
    index = 0;
    Project project = Templates.getProject( wizard );
    panels = createPanels (project, wizard);
    
    // Creating steps.
    Object prop = wizard.getProperty (WizardDescriptor.PROP_CONTENT_DATA); // NOI18N
    String[] beforeSteps = null;
    if (prop instanceof String[]) {
        beforeSteps = (String[])prop;
    }
    String[] steps = createSteps (beforeSteps, panels);
    
    for (int i = 0; i < panels.length; i++) {
        Component c = panels[i].getComponent ();
        if (steps[i] == null) {
            // Default step name to component name of panel.
            // Mainly useful for getting the name of the target
            // chooser to appear in the list of steps.
            steps[i] = c.getName ();
        }
        if (c instanceof JComponent) { // assume Swing components
            JComponent jc = (JComponent) c;
            // Step #.
            jc.putClientProperty (WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, Integer.valueOf(i)); // NOI18N
            // Step name (actually the whole list for reference).
            jc.putClientProperty (WizardDescriptor.PROP_CONTENT_DATA, steps); // NOI18N
        }
    }        
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:34,代码来源:DTDWizardIterator.java

示例7: getSubComponents

import java.awt.Component; //导入方法依赖的package包/类
@Override
public SubComponent[] getSubComponents() {
    ArrayList<Component> terminalList = new ArrayList<Component>();
    
    terminalList.addAll(tc.getAllTabs());

    if (terminalList.size() <= 1) {
        return super.getSubComponents();
    }

    SubComponent[] subs = new SubComponent[terminalList.size()];

    for (int i = 0; i < terminalList.size(); i++) {
        final Component terminal = terminalList.get(i);
        String title = terminal.getName();

        subs[i] = new SubComponent(
                title,
                new ActionListener() {

                    @Override
                    public void actionPerformed(ActionEvent e) {
                        if (terminal instanceof JComponent) {
                            tc.ioContainer().select((JComponent) terminal);
                            requestActive();
                        }
                    }

                },
                terminal == tc.ioContainer().getSelected());
    }

    return subs;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:35,代码来源:TerminalContainerTopComponent.java

示例8: initialize

import java.awt.Component; //导入方法依赖的package包/类
@Override
public void initialize(WizardDescriptor wizard) {
    this.wizard = wizard;
    index = 0;
    panels = createPanels(wizard);
    loadSettings(wizard);
    // Make sure list of steps is accurate.
    String[] beforeSteps = null;
    Object prop = wizard.getProperty(WizardDescriptor.PROP_CONTENT_DATA); // NOI18N
    if (prop != null && prop instanceof String[]) {
        beforeSteps = (String[]) prop;
    }
    String[] steps = createSteps(beforeSteps, panels);
    for (int i = 0; i < panels.length; i++) {
        Component c = panels[i].getComponent();
        if (steps[i] == null) {
            // Default step name to component name of panel.
            // Mainly useful for getting the name of the target
            // chooser to appear in the list of steps.
            steps[i] = c.getName();
        }
        if (c instanceof JComponent) { // assume Swing components
            JComponent jc = (JComponent) c;
            // Step #.
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i);
            // Step name (actually the whole list for reference).
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:31,代码来源:TestSuiteWizardIterator.java

示例9: initialize

import java.awt.Component; //导入方法依赖的package包/类
public void initialize(WizardDescriptor wiz) {
    this.wiz = wiz;
    index = 0;
    panels = createPanels(wiz);
    loadSettings(wiz);
    // Make sure list of steps is accurate.
    String[] beforeSteps = null;
    Object prop = wiz.getProperty("WizardPanel_contentData"); // NOI18N
    if (prop != null && prop instanceof String[]) {
        beforeSteps = (String[]) prop;
    }
    String[] steps = createSteps(beforeSteps, panels);
    for (int i = 0; i < panels.length; i++) {
        Component c = panels[i].getComponent();
        if (steps[i] == null) {
            // Default step name to component name of panel.
            // Mainly useful for getting the name of the target
            // chooser to appear in the list of steps.
            steps[i] = c.getName();
        }
        if (c instanceof JComponent) { // assume Swing components
            JComponent jc = (JComponent) c;
            // Step #.
            jc.putClientProperty("WizardPanel_contentSelectedIndex", Integer.valueOf(i)); // NOI18N
            // Step name (actually the whole list for reference).
            jc.putClientProperty("WizardPanel_contentData", steps); // NOI18N
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:NewTestWizardIterator.java

示例10: initialize

import java.awt.Component; //导入方法依赖的package包/类
@Override
public void initialize(WizardDescriptor wiz) {
    panel = getPanel(wiz);
    this.wiz = wiz;
    
    // Make sure list of steps is accurate.
    String[] beforeSteps = null;
    Object prop = wiz.getProperty (WizardDescriptor.PROP_CONTENT_DATA);
    if (prop != null && prop instanceof String[]) {
        beforeSteps = (String[])prop;
    }
    String[] steps = createSteps (beforeSteps);
    for (int i = 0; i < 1; i++) { // XXX what was this loop for, exactly? panels.length was always 1
        Component c = panel.getComponent();
        if (steps[i] == null) {
            // Default step name to component name of panel.
            // Mainly useful for getting the name of the target
            // chooser to appear in the list of steps.
            steps[i] = c.getName();
        }
        if (c instanceof JComponent) { // assume Swing components
            JComponent jc = (JComponent)c;
            // Step #.
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, new Integer(i));
            // Step name (actually the whole list for reference).
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:NewFileIterator.java

示例11: initialize

import java.awt.Component; //导入方法依赖的package包/类
@Override
public void initialize (WizardDescriptor wiz) {
    this.wiz = (TemplateWizard) wiz;
    index = 0;
    Project project = Templates.getProject( wiz );
    panels = createPanels (project,this.wiz);
    
    // Creating steps.
    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);
    
    for (int i = 0; i < panels.size(); i++) {
        Component c = panels.get(i).getComponent ();
        if (steps[i] == null) {
            // Default step name to component name of panel.
            // Mainly useful for getting the name of the target
            // chooser to appear in the list of steps.
            steps[i] = c.getName ();
        }
        if (c instanceof JComponent) { // assume Swing components
            JComponent jc = (JComponent) c;
            // Step #.
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, Integer.valueOf(i));
            // Step name (actually the whole list for reference).
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:ActivatorIterator.java

示例12: initializePanels

import java.awt.Component; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
protected Panel<WizardDescriptor>[] initializePanels () {
    repositoryStep = new RepositoryStep(CloneWizard.this, pa, forPath);
    repositoryStep.addChangeListener(CloneWizard.this);
    fetchBranchesStep = new FetchBranchesStep();
    fetchBranchesStep.addChangeListener(CloneWizard.this);
    cloneDestinationStep = new CloneDestinationStep();
    cloneDestinationStep.addChangeListener(CloneWizard.this);
    
    Panel[] panels = new Panel[] { repositoryStep, fetchBranchesStep, cloneDestinationStep };

    String[] steps = new String[panels.length];
    for (int i = 0; i < panels.length; i++) {
        Component c = panels[i].getComponent();
        // Default step name to component name of panel. Mainly useful
        // for getting the name of the target chooser to appear in the
        // list of steps.
        steps[i] = c.getName();
        if (c instanceof JComponent) { // assume Swing components
            JComponent jc = (JComponent) c;
            // Sets step number of a component
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, new Integer(i)); // NOI18N
            // Sets steps names for a panel
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); // NOI18N
            // Turn on subtitle creation on each step
            jc.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, Boolean.TRUE); // NOI18N
            // Show steps on the left side with the image on the background
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, Boolean.TRUE); // NOI18N
            // Turn on numbering of all steps
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, Boolean.TRUE); // NOI18N
        }
    }
    return panels;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:36,代码来源:CloneWizard.java

示例13: initialize

import java.awt.Component; //导入方法依赖的package包/类
public void initialize(WizardDescriptor wiz) {
    this.wiz = wiz;
    index = 0;
    panels = createPanels(wiz);
    // Make sure list of steps is accurate.
    String[] beforeSteps = null;
    Object prop = wiz.getProperty("WizardPanel_contentData"); // NOI18N
    if (prop != null && prop instanceof String[]) {
        beforeSteps = (String[]) prop;
    }
    String[] steps = createSteps(beforeSteps, panels);
    for (int i = 0; i < panels.length; i++) {
        Component c = panels[i].getComponent();
        if (steps[i] == null) {
            // Default step name to component name of panel.
            // Mainly useful for getting the name of the target
            // chooser to appear in the list of steps.
            steps[i] = c.getName();
        }
        if (c instanceof JComponent) { // assume Swing components
            JComponent jc = (JComponent) c;
            // Step #.
            jc.putClientProperty("WizardPanel_contentSelectedIndex", Integer.valueOf(i)); // NOI18N
            // Step name (actually the whole list for reference).
            jc.putClientProperty("WizardPanel_contentData", steps); // NOI18N
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:NewTestSuiteWizardIterator.java

示例14: initializePanels

import java.awt.Component; //导入方法依赖的package包/类
@Override
protected WizardDescriptor.Panel[] initializePanels() {
    WizardDescriptor.Panel[] panels = new WizardDescriptor.Panel[3];
    repositoryStep = new RepositoryStep(Repository.FLAG_ACCEPT_REVISION, RepositoryStep.CHECKOUT_HELP_ID);
    repositoryStep.addChangeListener(CheckoutWizard.this);
    checkoutStep = new CheckoutStep();            
    checkoutStep.addChangeListener(CheckoutWizard.this);
    
    panels = new  WizardDescriptor.Panel[] {repositoryStep, checkoutStep};

    String[] steps = new String[panels.length];
    for (int i = 0; i < panels.length; i++) {
        Component c = panels[i].getComponent();
        // Default step name to component name of panel. Mainly useful
        // for getting the name of the target chooser to appear in the
        // list of steps.
        steps[i] = c.getName();
        if (c instanceof JComponent) { // assume Swing components
            JComponent jc = (JComponent) c;
            // Sets step number of a component
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, new Integer(i)); // NOI18N
            // Sets steps names for a panel
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); // NOI18N
            // Turn on subtitle creation on each step
            jc.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, Boolean.TRUE); // NOI18N
            // Show steps on the left side with the image on the background
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, Boolean.TRUE); // NOI18N
            // Turn on numbering of all steps
            jc.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, Boolean.TRUE); // NOI18N
        }
    }
    return panels;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:34,代码来源:CheckoutWizard.java

示例15: getPanels

import java.awt.Component; //导入方法依赖的package包/类
private List<WizardDescriptor.Panel<WizardDescriptor>> getPanels() {
    if (panels == null) {

        Project project = Templates.getProject(wizard);
        Sources sources = ProjectUtils.getSources(project);
        SourceGroup[] groups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);

        panels = new ArrayList<WizardDescriptor.Panel<WizardDescriptor>>();
        panels.add(JavaTemplates.createPackageChooser(project, groups));
        String[] steps = createSteps();

        for (int i = 0; i < panels.size(); i++) {
            Component c = panels.get(i).getComponent();
            if (steps[i] == null) {
                // Default step name to component name of panel. Mainly
                // useful for getting the name of the target chooser to
                // appear in the list of steps.
                steps[i] = c.getName();
            }
            if (c instanceof JComponent) { // assume Swing components
                JComponent jc = (JComponent) c;
                jc.putClientProperty(WizardDescriptor.PROP_TITLE, "New primitive");
                // Sets highlighted step
                jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i);
                // Set steps names shown on the left side of the wizard
                jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);
                // Turn on subtitle creation on each step
                jc.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, true);
                // Show steps on the left side with the image on the background
                jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, true);
                // Turn on numbering of all steps
                jc.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, true);
            }
        }
    }
    return panels;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:38,代码来源:NewPrimitiveWizardIterator.java


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