static boolean isMarker(JComponent component) { return (component instanceof JLabel) && (MARKER_NAME.equals(component.getName())); }
/** * 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")); }
@SuppressWarnings("unchecked") public void register(JComponent component) { editorMap.put(component.getName(), (C) component); }
/** * Infers and sets this dialog's title from the the content. * Does nothing if content is null. * * Here: uses the content's name as title. */ protected void setTitleFromContent() { if (content == null) return; setTitle(content.getName()); }
/** * Infers and sets this dialog's title from the the content. * Does nothing if content is null. * * Here: uses the content's name as title. */ protected void setTitleFromContent() { if (content == null) return; setTitle(content.getName()); }
@Override public String toString() { String s = scope + " - " + (field == null ? message : field.getI18nError(message)); if (editor == null) { return s; } return editor.getName() + " : " + s; } }
/** * Infers and sets this dialog's title from the the content. * Does nothing if content is null. * * Here: uses the content's name as title. */ protected void setTitleFromContent() { if (content == null) return; setTitle(content.getName()); }
/** * Infers and sets this dialog's title from the the content. * Does nothing if content is null. * * Here: uses the content's name as title. */ protected void setTitleFromContent() { if (content == null) return; setTitle(content.getName()); }
/** * Infers and sets this dialog's title from the the content. * Does nothing if content is null. * * Here: uses the content's name as title. */ protected void setTitleFromContent() { if (content == null) return; setTitle(content.getName()); }
@Override public boolean accept(JComponent c) { if (statusLabel == null && c instanceof JLabel && "AutoHideStatusTextLabel".equals(c.getName())) { // ignore Label, parent JPanel and parent JLayeredPane (see org.netbeans.core.windows.view.ui.AutoHideStatusText) statusLabel = (JLabel) c; statusPanel = (JComponent) c.getParent(); statusLayeredPane = (JComponent) statusPanel.getParent(); } // ignore also org.netbeans.core.windows.view.ui.StatusLine and org.netbeans.modules.editor.impl.StatusLineComponent return c != statusLabel && c != statusPanel && c != statusLayeredPane && !c.getClass().getName().contains("StatusLine"); }
@Override public boolean accept(JComponent c) { if (statusLabel == null && c instanceof JLabel && "AutoHideStatusTextLabel".equals(c.getName())) { // ignore Label, parent JPanel and parent JLayeredPane (see org.netbeans.core.windows.view.ui.AutoHideStatusText) statusLabel = (JLabel) c; statusPanel = (JComponent) c.getParent(); statusLayeredPane = (JComponent) statusPanel.getParent(); } // ignore also org.netbeans.core.windows.view.ui.StatusLine and org.netbeans.modules.editor.impl.StatusLineComponent return c != statusLabel && c != statusPanel && c != statusLayeredPane && !c.getClass().getName().contains("StatusLine"); }
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, i); component.getAccessibleContext().setAccessibleDescription(step); resultSteps[i + offset] = step; } }
public void addSnippet(JComponent component) { SnippetPanel snippet = new SnippetPanel(component.getName(), component); snippet.setOpaque(false); snippets.add(snippet); updateSnippets(); }
/** * Declare that 'component' is now the visible component. * @param comp */ private void notify(JComponent comp) { currentComponent = comp; if (currentComponent == null) updateWindowName(null); else updateWindowName(currentComponent.getName()); checkSelectionChange(); }
protected void nameComponent(JComponent component, String suffix) { if (component != null && component.getName() == null) { component.setName(getParameter().getName() + "." + suffix); } } }
@Override public void installUI( JComponent c ) { super.installUI(c); c.addContainerListener(this); boolean isEditorToolbar = "editorToolbar".equals (c.getName()); c.setBackground(UIManager.getColor("NbExplorerView.background")); c.setOpaque(true); installButtonUIs (c, isEditorToolbar); }
@Override public void initialize(WizardDescriptor wizard) { this.wizard = wizard; wizard.putProperty(WIZ_ERROR_HANDLING, 0); Project project = Templates.getProject(wizard); Sources src = ProjectUtils.getSources(project); SourceGroup[] groups = src.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA); panel = JavaTemplates.createPackageChooser(project, groups, new ControllerWizardPanel1(), true); // force creation of visual part JComponent cmp = (JComponent) panel.getComponent(); cmp.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, 0); cmp.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, TemplateUtils.createSteps(wizard, new String[]{cmp.getName()})); }
@Override public void initialize(WizardDescriptor wizard) { this.wizard = wizard; wizard.putProperty(WIZ_CRUD_METHODS, false); wizard.putProperty(WIZ_ERROR_HANDLING, 0); Project project = Templates.getProject(wizard); Sources src = ProjectUtils.getSources(project); SourceGroup[] groups = src.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA); panel = JavaTemplates.createPackageChooser(project, groups, new RestControllerWizardPanel1(), true); // force creation of visual part JComponent cmp = (JComponent) panel.getComponent(); cmp.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, 0); cmp.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, TemplateUtils.createSteps(wizard, new String[]{cmp.getName()})); }
@Override public void initialize(WizardDescriptor wizard) { this.wizard = wizard; wizard.putProperty(WIZ_BASE_INTERF, "CrudRepository"); wizard.putProperty(WIZ_ENTITY_CLASS, "Entity"); wizard.putProperty(WIZ_ID_CLASS, "Id"); Project project = Templates.getProject(wizard); Sources src = ProjectUtils.getSources(project); SourceGroup[] groups = src.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA); panel = JavaTemplates.createPackageChooser(project, groups, new ReactRepoWizardPanel1(), true); // force creation of visual part JComponent cmp = (JComponent) panel.getComponent(); cmp.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, 0); cmp.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, TemplateUtils.createSteps(wizard, new String[]{cmp.getName()})); }
@Override protected JComponent createControl() { JComponent pageComponentControl = getPageComponent().getControl(); if (pageComponentControl.getName() == null) { nameComponent(pageComponentControl, "Control"); } internalFrame = new JInternalFrame(); configureControl(); internalFrame.getContentPane().add(pageComponentControl, BorderLayout.CENTER); internalFrame.addInternalFrameListener(new InternalFrameHandler()); nameComponent(internalFrame, "Pane"); return internalFrame; }