public int compare(Object o1, Object o2) { String s1 = (String) o1; String s2 = (String) o2; if (s1 == s2) return 0; String bn = basicPropsTabName(); if (bn.equals(s1)) return -1; if (bn.equals(s2)) return 1; return s1.compareTo(s2); } }
/** Get the basic color for controls in the look and feel, or a reasonable * default if the look and feel does not supply a value from * UIManager.getColor("control") */ static Color getControlColor() { if (controlColor == null) { deriveColorsAndMargin(); } return controlColor; }
protected void prepareComponent (InplaceEditor inplace) { InplaceEditor innermost = PropUtils.findInnermostInplaceEditor(inplace); JComponent comp = innermost.getComponent(); if (!isTableUI() && inplace.supportsTextEntry()) { comp.setBackground(PropUtils.getTextFieldBackground()); comp.setForeground(PropUtils.getTextFieldForeground()); } else { comp.setBackground(getBackground()); if (!isEnabled() || !prop.canWrite()) { comp.setForeground(UIManager.getColor("textInactiveText")); } else { comp.setForeground(getForeground()); } } comp.setEnabled(isEnabled() && PropUtils.checkEnabled(this, inplace.getPropertyEditor(), getPropertyEnv())); }
public boolean isTitleDisplayed() { if (!useLabels) { return false; } JComponent jc = getRenderer(this); if (jc instanceof InplaceEditor) { InplaceEditor innermost = PropUtils.findInnermostInplaceEditor((InplaceEditor) jc); return innermost instanceof CheckboxInplaceEditor || innermost instanceof RadioInplaceEditor; } return false; }
static void logFocusOwner(Class clazz, String where) { if (isLoggable(clazz)) { StringBuffer sb = new StringBuffer(where); sb.append(" focus owner: "); //NOI18N Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); compToString(owner, sb); } }
public void paint (Graphics g) { if (editor != null) { setEnabled(PropUtils.checkEnabled (this, editor, env)); setForeground(PropUtils.getErrorColor());
public void paintComponent(Graphics g) { setEnabled(PropUtils.checkEnabled(this, editor, env)); super.paintComponent(g); clear(); }
red = adjustColorComponent(controlColor.getRed(), -25, -25); green = adjustColorComponent(controlColor.getGreen(), -25, -25); blue = adjustColorComponent(controlColor.getBlue(), -25, -25); setRendererColor = new Color(red, green, blue); red = adjustColorComponent(col.getRed(), -25, -25); green = adjustColorComponent(col.getGreen(), -25, -25); blue = adjustColorComponent(col.getBlue(), -25, -25); selectedSetRendererColor = new Color(red, green, blue); Icon collapsedIcon = getCollapsedIcon();
@Override public void connect(PropertyEditor p, PropertyEnv env) { setActionCommand(COMMAND_SUCCESS); this.env = env; if(PropUtils.supportsValueIncrement( env ) ) { PropUtils.wrapUpDownArrowActions( this, this ); } if (editor == p) { return; } editor = p; boolean editable = PropUtils.checkEnabled(this, p, env); setEnabled(editable); //Undocumented, but in NB 3.5 and earlier, getAsText() returning null for //paintable editors was yet another way to disable a property editor if ((p.getTags() == null) && (p.getAsText() == null) && p.isPaintable()) { editable = false; } setEditable(editable); reset(); added = false; }
/** Overridden to use CleanComboUI on Metal L&F to avoid extra borders */ @Override public void updateUI() { LookAndFeel lf = UIManager.getLookAndFeel(); String id = lf.getID(); boolean useClean = tableUI && (lf instanceof MetalLookAndFeel || "GTK".equals(id) //NOI18N || ("Aqua".equals(id) && "10.5".compareTo(System.getProperty("os.version")) <= 0) //NOI18N || PropUtils.isWindowsVistaLaF() //#217957 || "Kunststoff".equals(id)); //NOI18N if (useClean) { super.setUI(PropUtils.createComboUI(this, tableUI)); } else { super.updateUI(); } if (tableUI & getEditor().getEditorComponent() instanceof JComponent) { ((JComponent) getEditor().getEditorComponent()).setBorder(null); } }
static void focusEventToString (FocusEvent fe, final StringBuffer sb) { Component target = (Component) fe.getSource(); Component opposite = (Component) fe.getOppositeComponent(); sb.append (" focus "); //NOI18N sb.append (fe.getID() == FocusEvent.FOCUS_GAINED ? " gained by " : " lost by "); //NOI18N compToString (target, sb); sb.append (fe.getID() == FocusEvent.FOCUS_GAINED ? " from " : " to "); //NOI18N compToString (opposite, sb); sb.append (" isTemporary: "); //NOI18N sb.append (fe.isTemporary()); }
private JSplitPane createSplitPane (Component lower) { JSplitPane pane = new JSplitPane(); if (firstSplit == null) { firstSplit = Boolean.TRUE; } else { firstSplit = Boolean.FALSE; } pane.setRightComponent(lower); pane.setOrientation (JSplitPane.VERTICAL_SPLIT); pane.setContinuousLayout(true); pane.setResizeWeight(1); pane.setDividerLocation(0.80f); pane.setBorder (BorderFactory.createEmptyBorder()); pane.setUI (PropUtils.createSplitPaneUI()); return pane; }
/** Overridden to supply different tooltips depending on mouse position (name, * value, custom editor button). Will HTML-ize long tooltips*/ @Override public String getToolTipText(MouseEvent e) { if (customEditorIsOpen) { return null; } String result; Point pt = e.getPoint(); int row = rowAtPoint(pt); int col = columnAtPoint(pt); if ((col == 1) && onCustomEditorButton(e)) { result = NbBundle.getMessage(SheetTable.class, "CTL_EDBUTTON_TIP"); // NOI18N } else { result = getSheetModel().getDescriptionFor(row, col); if ((col == 1) && (result != null) && (result.length() > 100)) { //e.g. Jesse's new file list property gives massive //tooltips; break them up result = PropUtils.createHtmlTooltip( getPropertySetModel().getFeatureDescriptor(row).getDisplayName(), result ); } } if ((result != null) && "".equals(result.trim())) { result = null; // prevents 2x2 dot as a tooltip } return result; }
/** Overridden to use CleanComboUI on Metal L&F to avoid extra borders */ public void updateUI() { LookAndFeel lf = UIManager.getLookAndFeel(); String id = lf.getID(); boolean useClean = tableUI && (lf instanceof MetalLookAndFeel || "GTK".equals(id) || "Kunststoff".equals(id)); //NOI18N if (useClean) { super.setUI (PropUtils.createComboUI(this, tableUI)); } else { super.updateUI(); } if (tableUI & getEditor().getEditorComponent() instanceof JComponent) { ((JComponent) getEditor().getEditorComponent()).setBorder(null); } }
red = adjustColorComponent (controlColor.getRed(), -25, -25); green = adjustColorComponent (controlColor.getGreen(), -25, -25); blue = adjustColorComponent (controlColor.getBlue(), -25, -25); setRendererColor = new Color (red, green, blue); : UIManager.getColor ("activeCaptionBorder"); //NOI18N if (col == null) col = Color.BLUE; red = adjustColorComponent (col.getRed(), -25, -25); green = adjustColorComponent (col.getGreen(), -25, -25); blue = adjustColorComponent (col.getBlue(), -25, -25); selectedSetRendererColor = new Color (red, green, blue);
protected void prepareComponent (InplaceEditor inplace) { InplaceEditor innermost = PropUtils.findInnermostInplaceEditor(inplace); JComponent comp = innermost.getComponent(); if (!isTableUI() && inplace.supportsTextEntry()) { comp.setBackground(PropUtils.getTextFieldBackground()); comp.setForeground(PropUtils.getTextFieldForeground()); } else { comp.setBackground(getBackground()); if (!isEnabled() || !prop.canWrite()) { comp.setForeground(UIManager.getColor("textInactiveText")); } else { comp.setForeground(getForeground()); } } comp.setEnabled(isEnabled() && PropUtils.checkEnabled(this, inplace.getPropertyEditor(), getPropertyEnv())); }
static JComponent findInnermostRenderer(JComponent comp) { if (comp instanceof InplaceEditor) { InplaceEditor ine = (InplaceEditor) comp; return PropUtils.findInnermostInplaceEditor(ine).getComponent(); } else { return comp; } }
static void logFocusOwner(Class clazz, String where) { if (isLoggable (clazz)) { StringBuffer sb = new StringBuffer (where); sb.append (" focus owner: "); //NOI18N Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); compToString (owner, sb); } }
public void paint (Graphics g) { if (editor != null) { setEnabled(PropUtils.checkEnabled (this, editor, env)); setForeground(PropUtils.getErrorColor());