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


Java JComponent.getName方法代码示例

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


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

示例1: show

import javax.swing.JComponent; //导入方法依赖的package包/类
@NbBundle.Messages({
    "MSG_ReceivingImageInfo=Receiving Image Details",
    "LBL_Run=Run {0}"
})
public void show() {
    DockerImageDetail info = BaseProgressUtils.showProgressDialogAndRun(
            new DockerImageInfoRunnable(tag.getImage()), Bundle.MSG_ReceivingImageInfo(), false);

    List<WizardDescriptor.Panel<WizardDescriptor>> panels = new ArrayList<>();
    panels.add(new RunContainerPropertiesPanel(info));
    panels.add(new RunPortBindingsPanel(info));
    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);
    }
    final 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_Run(getImage(tag)));
    if (DialogDisplayer.getDefault().notify(wiz) == WizardDescriptor.FINISH_OPTION) {
        run(tag, wiz);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:31,代码来源:RunTagWizard.java

示例2: setSteps

import javax.swing.JComponent; //导入方法依赖的package包/类
private static void setSteps(WizardDescriptor.Panel[] panels, String[] steps, String[] resultSteps, int offset) {
    int n = steps == null ? 0 : steps.length;
    for (int i = 0; i < panels.length; i++) {
        final JComponent component = (JComponent) panels[i].getComponent();
        String step = i < n ? steps[i] : null;
        if (step == null) {
            step = component.getName();
        }
        component.putClientProperty(WIZARD_PANEL_CONTENT_DATA, resultSteps);
        component.putClientProperty(WIZARD_PANEL_CONTENT_SELECTED_INDEX, Integer.valueOf(i));
        component.getAccessibleContext().setAccessibleDescription(step);
        resultSteps[i + offset] = step;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:Wizards.java

示例3: show

import javax.swing.JComponent; //导入方法依赖的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

示例4: selectLibrary

import javax.swing.JComponent; //导入方法依赖的package包/类
private void selectLibrary (Node[] nodes) {
    int tabCount = this.properties.getTabCount();
    for (int i=0; i<tabCount; i++) {
        this.properties.removeTabAt(0);
    }
    this.libraryName.setEnabled(false);
    this.libraryName.setText("");   //NOI18N
    this.jLabel1.setVisible(false);
    this.libraryName.setVisible(false);
    this.properties.setVisible(false);
    this.deleteButton.setEnabled(false);
    if (nodes.length != 1) {
        return;
    }
    LibraryImplementation impl = nodes[0].getLookup().lookup(LibraryImplementation.class);
    if (impl == null) {
        return;
    }
    this.jLabel1.setVisible(true);
    this.libraryName.setVisible(true);
    this.properties.setVisible(true);
    boolean editable = model.isLibraryEditable (impl);
    this.libraryName.setEnabled(editable && LibrariesSupport.supportsDisplayName(impl));
    this.deleteButton.setEnabled(editable);
    this.libraryName.setText (LibrariesSupport.getLocalizedName(impl));
    LibraryTypeProvider provider = nodes[0].getLookup().lookup(LibraryTypeProvider.class);
    if (provider == null) {
        return;
    }
    LibraryCustomizerContextWrapper customizerContext;
    LibraryStorageArea area = nodes[0].getLookup().lookup(LibraryStorageArea.class);
    if (area != LibraryStorageArea.GLOBAL) {
        customizerContext = new LibraryCustomizerContextWrapper(impl, area);
        File f = Utilities.toFile(URI.create(area.getLocation().toExternalForm()));
        this.libraryLocation.setText(f.getPath());
    } else {
        customizerContext = new LibraryCustomizerContextWrapper(impl, null);
        this.libraryLocation.setText(LABEL_Global_Libraries());
    }

    String[] volumeTypes = provider.getSupportedVolumeTypes();
    for (int i=0; i< volumeTypes.length; i++) {
        Customizer c = provider.getCustomizer (volumeTypes[i]);
        if (c instanceof JComponent) {
            c.setObject (customizerContext);
            JComponent component = (JComponent) c;
            component.setEnabled (editable);
            String tabName = component.getName();
            if (tabName == null) {
                tabName = volumeTypes[i];
            }
            this.properties.addTab(tabName, component);
        }
    }        
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:56,代码来源:LibrariesCustomizer.java

示例5: addSnippet

import javax.swing.JComponent; //导入方法依赖的package包/类
public void addSnippet(JComponent component) {
    SnippetPanel snippet = new SnippetPanel(component.getName(), component);
    snippet.setOpaque(false);
    snippets.add(snippet);
    updateSnippets();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:StatisticsPanel.java

示例6: isDialog

import javax.swing.JComponent; //导入方法依赖的package包/类
/**
 * Returns true if <code>component</code> should be treated as a dialog.
 */
boolean isDialog(JComponent component) {
    // PENDING: tag the content pane to make this easier to check for
    String name = component.getName();
    return (name != null && name.endsWith(".contentPane"));
}
 
开发者ID:fesch,项目名称:Moenagade,代码行数:9,代码来源:LayoutStyle.java


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