public void setForeground(Color c) { super.setForeground(c); if (inner != null) { if ((inplace != null) && inplace.supportsTextEntry()) { inner.setForeground(PropUtils.getTextFieldForeground()); } else { inner.setForeground(c); } } }
public void setForeground(Color c) { super.setForeground(c); if (inner != null) { if (inplace != null && inplace.supportsTextEntry()) { inner.setForeground(PropUtils.getTextFieldForeground()); } else { inner.setForeground(c); } } }
public void setForeground(Color c) { super.setForeground(c); if (inner != null) { if (inplace != null && inplace.supportsTextEntry()) { inner.setForeground(PropUtils.getTextFieldForeground()); } else { inner.setForeground(c); } } }
/** Overridden to set the colors apropriately - we always want the editor * to appear selected */ public Component prepareEditor(TableCellEditor editor, int row, int col) { if (editor == null) { return null; } Component result = super.prepareEditor(editor, row, col); if (result == null) { return null; } //Usually result == ine, but custom impls may not be InplaceEditor ine = getEditor().getInplaceEditor(); if (ine.supportsTextEntry()) { result.setBackground(PropUtils.getTextFieldBackground()); result.setForeground(PropUtils.getTextFieldForeground()); } if (result instanceof JComponent) { //unlikely that it won't be ((JComponent)result).setBorder(BorderFactory.createEmptyBorder( 0, PropUtils.getTextMargin(), 0, 0)); } return result; }
/** Overridden to set the colors apropriately - we always want the editor * to appear selected */ public Component prepareEditor(TableCellEditor editor, int row, int col) { if (editor == null) { return null; } Component result = super.prepareEditor(editor, row, col); if (result == null) { return null; } //Usually result == ine, but custom impls may not be InplaceEditor ine = getEditor().getInplaceEditor(); if (ine.supportsTextEntry()) { result.setBackground(PropUtils.getTextFieldBackground()); result.setForeground(PropUtils.getTextFieldForeground()); } if (result instanceof JComponent) { //unlikely that it won't be ((JComponent)result).setBorder(BorderFactory.createEmptyBorder( 0, PropUtils.getTextMargin(), 0, 0)); } return result; }
/** Overridden to set the colors apropriately - we always want the editor * to appear selected */ @Override public Component prepareEditor(TableCellEditor editor, int row, int col) { if (editor == null) { return null; } Component result = super.prepareEditor(editor, row, col); if (result == null) { return null; } if( 1 == col ) { //Usually result == ine, but custom impls may not be InplaceEditor ine = getEditor().getInplaceEditor(); if (ine.supportsTextEntry()) { result.setBackground(PropUtils.getTextFieldBackground()); result.setForeground(PropUtils.getTextFieldForeground()); } } if (result instanceof JComponent) { //unlikely that it won't be ((JComponent) result).setBorder(BorderFactory.createEmptyBorder(0, PropUtils.getTextMargin(), 0, 0)); } return result; }
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())); }
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())); }
protected void prepareRenderer(JComponent comp) { comp.setBackground(getBackground()); comp.setForeground(getForeground()); comp.setBounds(0,0,getWidth(),getHeight()); JComponent innermost; if ((innermost = findInnermostRenderer(comp)) instanceof JComboBox) { if (comp.getLayout() != null) { comp.getLayout().layoutContainer(comp); } } if (!isTableUI() && ((InplaceEditor) comp).supportsTextEntry()) { innermost.setBackground(PropUtils.getTextFieldBackground()); innermost.setForeground(PropUtils.getTextFieldForeground()); } }
protected void prepareRenderer(JComponent comp) { comp.setBackground(getBackground()); comp.setForeground(getForeground()); comp.setBounds(0,0,getWidth(),getHeight()); JComponent innermost; if ((innermost = findInnermostRenderer(comp)) instanceof JComboBox) { if (comp.getLayout() != null) { comp.getLayout().layoutContainer(comp); } } if (!isTableUI() && ((InplaceEditor) comp).supportsTextEntry()) { innermost.setBackground(PropUtils.getTextFieldBackground()); innermost.setForeground(PropUtils.getTextFieldForeground()); } }
protected void prepareRenderer(JComponent comp) { comp.setBackground(getBackground()); comp.setForeground(getForeground()); comp.setBounds(0, 0, getWidth(), getHeight()); JComponent innermost; if ((innermost = findInnermostRenderer(comp)) instanceof JComboBox) { if (comp.getLayout() != null) { comp.getLayout().layoutContainer(comp); } } if (!isTableUI() && ((InplaceEditor) comp).supportsTextEntry()) { innermost.setBackground(PropUtils.getTextFieldBackground()); innermost.setForeground(PropUtils.getTextFieldForeground()); } }
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()); } } if( comp instanceof ComboInplaceEditor ) comp.setEnabled( isEnabled() && getPropertyEnv().isEditable() ); else comp.setEnabled(isEnabled() && PropUtils.checkEnabled(this, inplace.getPropertyEditor(), getPropertyEnv())); }