Java Code Examples for java.awt.Component#getName()
The following examples show how to use
java.awt.Component#getName() .
These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: zap-extensions File: PopupDuplicateScript.java License: Apache License 2.0 | 6 votes |
@Override public boolean isEnableForComponent(Component invoker) { if (invoker.getName() != null && invoker.getName().equals(ScriptsListPanel.TREE)) { try { JTree tree = (JTree) invoker; ScriptNode node = (ScriptNode) tree.getLastSelectedPathComponent(); if (node == null || node.isTemplate() || node.getUserObject() == null || !(node.getUserObject() instanceof ScriptWrapper)) { return false; } if (((ScriptWrapper) node.getUserObject()).getEngine() == null) { return false; } return extension.getScriptsPanel().getSelectedScript() != null; } catch (Exception e) { } } return false; }
Example 2
Source Project: visualvm File: hostviewWizardIterator.java License: GNU General Public License v2.0 | 6 votes |
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); } } }
Example 3
Source Project: zap-extensions File: PopupRemoveScript.java License: Apache License 2.0 | 6 votes |
@Override public boolean isEnableForComponent(Component invoker) { if (invoker.getName() != null && invoker.getName().equals(ScriptsListPanel.TREE)) { try { JTree tree = (JTree) invoker; ScriptNode node = (ScriptNode) tree.getLastSelectedPathComponent(); if (node == null || node.isTemplate() || node.getUserObject() == null || !(node.getUserObject() instanceof ScriptWrapper)) { return false; } return extension.getScriptsPanel().getSelectedScript() != null; } catch (Exception e) { } } return false; }
Example 4
Source Project: visualvm File: datasourceWizardIterator.java License: GNU General Public License v2.0 | 6 votes |
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); } } }
Example 5
Source Project: zap-extensions File: PopupInstantiateTemplate.java License: Apache License 2.0 | 6 votes |
@Override public boolean isEnableForComponent(Component invoker) { if (invoker.getName() != null && invoker.getName().equals(ScriptsListPanel.TREE)) { try { JTree tree = (JTree) invoker; ScriptNode node = (ScriptNode) tree.getLastSelectedPathComponent(); if (node == null || !node.isTemplate() || node.getUserObject() == null || !(node.getUserObject() instanceof ScriptWrapper)) { return false; } if (((ScriptWrapper) node.getUserObject()).getEngine() == null) { return false; } return extension.getScriptsPanel().getSelectedScript() != null; } catch (Exception e) { } } return false; }
Example 6
Source Project: cakephp3-netbeans File: CakePHP3NewProjectWizardIterator.java License: Apache License 2.0 | 6 votes |
@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(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i); // Step name (actually the whole list for reference). jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); } } }
Example 7
Source Project: netbeans File: PropertySheetOperator.java License: Apache License 2.0 | 6 votes |
public boolean checkComponent(Component comp) { if (comp == null) { return false; } if(comp instanceof PropertySheet || comp.getClass().getSimpleName().equals("NbSheet")) { if(sheetName == null) { return true; } else { if(comp instanceof TopComponent) { String name = ((TopComponent)comp).getDisplayName(); if(name == null) { name = comp.getName(); } return comparator.equals(name, sheetName); } } } return false; }
Example 8
Source Project: netbeans File: BaseWizardIterator.java License: Apache License 2.0 | 6 votes |
private void updateSteps() { // Make sure list of steps is accurate. String[] steps = new String[panels.length]; String[] basicOnes = new String[]{ getMessage(BaseWizardIterator.class, "LBL_MavenProjectSettings"), getMessage(BaseWizardIterator.class, "LBL_PayaraMicroSettings") }; System.arraycopy(basicOnes, 0, steps, 0, basicOnes.length); for (int i = 0; i < panels.length; i++) { Component c = panels[i].getComponent(); if (i >= basicOnes.length || 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", i); //NOI18N // Step name (actually the whole list for reference). jc.putClientProperty("WizardPanel_contentData", steps); //NOI18N } } }
Example 9
Source Project: netbeans File: PageIterator.java License: Apache License 2.0 | 5 votes |
public void initialize(TemplateWizard wiz) { this.wiz = wiz; index = 0; Project project = Templates.getProject(wiz); panels = createPanels(project); // 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 = Utilities.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)); // Step name (actually the whole list for reference). jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); } } }
Example 10
Source Project: MikuMikuStudio File: AddSkyboxAction.java License: BSD 2-Clause "Simplified" License | 5 votes |
/** * Initialize panels representing individual wizard's steps and sets * various properties for them influencing wizard appearance. */ private WizardDescriptor.Panel[] getPanels() { if (panels == null) { panels = new WizardDescriptor.Panel[]{ new SkyboxWizardPanel1(), new SkyboxWizardPanel2() }; 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 // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*: jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i)); // Sets steps names for a panel jc.putClientProperty("WizardPanel_contentData", steps); // Turn on subtitle creation on each step jc.putClientProperty("WizardPanel_autoWizardStyle", Boolean.TRUE); // Show steps on the left side with the image on the background jc.putClientProperty("WizardPanel_contentDisplayed", Boolean.TRUE); // Turn on numbering of all steps jc.putClientProperty("WizardPanel_contentNumbered", Boolean.TRUE); } } } return panels; }
Example 11
Source Project: netbeans File: CheckoutWizard.java License: Apache License 2.0 | 5 votes |
@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; }
Example 12
Source Project: netbeans File: WebFragmentXmlWizardIterator.java License: Apache License 2.0 | 5 votes |
/** * Initialize panels representing individual wizard's steps and sets * various properties for them influencing wizard appearance. */ private WizardDescriptor.Panel[] getPanels() { if (panels == null) { panels = new WizardDescriptor.Panel[] { new WebFragmentXmlWizardPanel1() }; String[] steps = createSteps(); for (int i = 0; i < panels.length; i++) { Component component = 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] = component.getName(); } if (component instanceof JComponent) { // assume Swing components JComponent jComponent = (JComponent) component; // Sets step number of a component jComponent.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, Integer.valueOf(i)); // Sets steps names for a panel jComponent.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); // Turn on subtitle creation on each step jComponent.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, Boolean.TRUE); // Show steps on the left side with the image on the background jComponent.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, Boolean.TRUE); // Turn on numbering of all steps jComponent.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, Boolean.TRUE); } } } return panels; }
Example 13
Source Project: netbeans File: NewFileIterator.java License: Apache License 2.0 | 5 votes |
@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); } } }
Example 14
Source Project: netbeans File: GrailsProjectWizardIterator.java License: Apache License 2.0 | 5 votes |
@Override public void initialize(WizardDescriptor wizard) { this.wiz = wizard; index = 0; // get project counter from GrailsConfiguration baseCount = GrailsProjectSettings.getDefault().getNewProjectCount() + 1; wizard.putProperty("WizardPanel_GrailsProjectCounter", Integer.valueOf(baseCount)); panels = createPanels(); 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, Integer.valueOf(i)); // NOI18N // Step name (actually the whole list for reference). jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); // NOI18N } } }
Example 15
Source Project: netbeans File: NewJ2SEModularProjectWizardIterator.java License: Apache License 2.0 | 5 votes |
@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 }
Example 16
Source Project: netbeans File: NewTestWizardIterator.java License: Apache License 2.0 | 5 votes |
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 } } }
Example 17
Source Project: nordpos File: JPanelButtons.java License: GNU General Public License v3.0 | 5 votes |
public void setPermissions(AppUser user) { for (Component c : this.getComponents()) { String sKey = c.getName(); if (sKey == null || sKey.equals("")) { c.setEnabled(true); } else { c.setEnabled(user.hasPermission(c.getName())); } } }
Example 18
Source Project: MikuMikuStudio File: CreateProjectWizardIterator.java License: BSD 2-Clause "Simplified" License | 5 votes |
/** * Initialize panels representing individual wizard's steps and sets * various properties for them influencing wizard appearance. */ private WizardDescriptor.Panel[] getPanels() { if (panels == null) { panels = new WizardDescriptor.Panel[]{ new CreateProjectWizardPanel1(), new CreateProjectWizardPanel2() }; 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 // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*: jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i)); // Sets steps names for a panel jc.putClientProperty("WizardPanel_contentData", steps); // Turn on subtitle creation on each step jc.putClientProperty("WizardPanel_autoWizardStyle", Boolean.TRUE); // Show steps on the left side with the image on the background jc.putClientProperty("WizardPanel_contentDisplayed", Boolean.TRUE); // Turn on numbering of all steps jc.putClientProperty("WizardPanel_contentNumbered", Boolean.TRUE); } } } return panels; }
Example 19
Source Project: zap-extensions File: PopupEncoderMenu.java License: Apache License 2.0 | 5 votes |
private boolean isInvokerFromEncodeDecode(Component invoker) { if (invoker.getName() == null) { return false; } return invoker.getName().equals(EncodeDecodeDialog.ENCODE_DECODE_FIELD) || invoker.getName().equals(EncodeDecodeDialog.ENCODE_DECODE_RESULTFIELD); }
Example 20
Source Project: netbeans File: JerseyClientWizardIterator.java License: Apache License 2.0 | 4 votes |
@Override public void initialize(WizardDescriptor wizard) { this.wizard = wizard; Project project = Templates.getProject(wizard); SourceGroup[] sourceGroups = SourceGroups.getJavaSourceGroups(project); bottomPanel = new JerseyClientWizardPanel(); //WizardDescriptor.Panel firstPanel; //special case: use Java Chooser if (sourceGroups.length == 0) { SourceGroup[] genericSourceGroups = ProjectUtils. getSources(project).getSourceGroups(Sources.TYPE_GENERIC); firstPanel = new FinishableProxyWizardPanel(Templates. createSimpleTargetChooser(project, genericSourceGroups, bottomPanel), sourceGroups, false); } else { firstPanel = new FinishableProxyWizardPanel( JavaTemplates.createPackageChooser(project, sourceGroups, bottomPanel, true)); } panels = new WizardDescriptor.Panel[] { firstPanel }; 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; // Sets step number of a component // TODO if using org.openide.dialogs >= 7.8, can use // WizardDescriptor.PROP_*: jc.putClientProperty("WizardPanel_contentSelectedIndex",i); // Sets steps names for a panel jc.putClientProperty("WizardPanel_contentData", steps); // Turn on subtitle creation on each step jc.putClientProperty("WizardPanel_autoWizardStyle", Boolean.TRUE); // Show steps on the left side with the image on the background jc.putClientProperty("WizardPanel_contentDisplayed", Boolean.TRUE); // Turn on numbering of all steps jc.putClientProperty("WizardPanel_contentNumbered", Boolean.TRUE); } } }