| Methods from java.awt.Component: |
|---|
|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFocusable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFocusable, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate |
| Method from org.jfree.report.modules.gui.config.ConfigDescriptionEditor Detail: |
protected void attempExit() {
System.exit(0);
}
Handles the attemp to quit the program. This method shuts down the VM. |
protected JPanel createStatusBar() {
final JPanel statusPane = new JPanel();
statusPane.setLayout(new BorderLayout());
statusPane.setBorder(BorderFactory.createLineBorder(UIManager.getDefaults().getColor("controlShadow"))); //$NON-NLS-1$
statusHolder = new JLabel(" "); //$NON-NLS-1$
statusPane.setMinimumSize(statusHolder.getPreferredSize());
statusPane.add(statusHolder, BorderLayout.WEST);
return statusPane;
}
Creates the statusbar for this frame. Use setStatus() to display text on the status bar. |
protected JList getEntryList() {
return entryList;
}
Returns the JList component containing all configuration entries. |
protected int getEntryType() {
return type;
}
Returns the current entry type. |
protected JTextField getEnumEntryEditField() {
return enumEntryEditField;
}
Returns the text field containing the currently edited enumeration entry. |
protected JList getEnumEntryList() {
return enumEntryList;
}
Returns the JList component containing all entries of the enumeration detail editor. |
protected DefaultListModel getEnumEntryListModel() {
return enumEntryListModel;
}
Returns the List Model containing all entries of the current enumeration entry editor. |
protected ConfigDescriptionModel getModel() {
return model;
}
Returns the config description model containing all metainformation about the configuration. |
protected ResourceBundleSupport getResources() {
return resources;
}
Returns the resource bundle of this editor for translating strings. |
protected ConfigDescriptionEntry getSelectedEntry() {
return selectedEntry;
}
Returns the currently select entry from the entry list model. |
protected String getStatusText() {
return statusHolder.getText();
}
Returns the currently visible status text of this dialog. |
protected void load() {
fileChooser.setVisible(true);
final int option = fileChooser.showOpenDialog(this);
if (option == JFileChooser.APPROVE_OPTION)
{
InputStream in = null;
try
{
final FileInputStream fileIn = new FileInputStream(fileChooser.getSelectedFile());
in = new BufferedInputStream(fileIn);
model.load(in);
model.sort();
setStatusText(resources.getString("config-description-editor.load-complete")); //$NON-NLS-1$
}
catch (Exception ioe)
{
ConfigDescriptionEditor.logger.debug("Load Failed", ioe); //$NON-NLS-1$
final String message = MessageFormat.format
(resources.getString("config-description-editor.load-failed"), //$NON-NLS-1$
new Object[]{ioe.getMessage()});
setStatusText(message);
}
finally
{
if (in != null)
{
try
{
in.close();
}
catch (IOException e)
{
// ignored .. at least we tried it ..
}
}
}
}
}
Loads the config description model from a xml file. |
public static void main(String[] args) {
JFreeReportBoot.getInstance().start();
final ConfigDescriptionEditor ed = new ConfigDescriptionEditor();
ed.pack();
ed.setVisible(true);
}
The main entry point to start the detail editor. |
protected void save() {
fileChooser.setVisible(true);
final int option = fileChooser.showSaveDialog(this);
if (option == JFileChooser.APPROVE_OPTION)
{
OutputStream out = null;
try
{
out = new BufferedOutputStream (new FileOutputStream(fileChooser.getSelectedFile()));
model.save(out, "ISO-8859-1"); //$NON-NLS-1$
out.close();
setStatusText(resources.getString("config-description-editor.save-complete")); //$NON-NLS-1$
}
catch (Exception ioe)
{
ConfigDescriptionEditor.logger.debug("Failed", ioe); //$NON-NLS-1$
final String message = MessageFormat.format
(resources.getString("config-description-editor.save-failed"), //$NON-NLS-1$
new Object[]{ioe.getMessage()});
setStatusText(message);
}
finally
{
if (out != null)
{
try
{
out.close();
}
catch (IOException e)
{
// ignored .. at least we tried it ..
}
}
}
}
}
Saves the config description model in a xml file. |
protected void setEntryType(int type) {
this.type = type;
if (type == ConfigDescriptionEditor.TYPE_CLASS)
{
detailManager.show(detailManagerPanel, ConfigDescriptionEditor.CLASS_DETAIL_EDITOR_NAME);
rbClass.setSelected(true);
}
else if (type == ConfigDescriptionEditor.TYPE_ENUM)
{
detailManager.show(detailManagerPanel, ConfigDescriptionEditor.ENUM_DETAIL_EDITOR_NAME);
rbEnum.setSelected(true);
}
else
{
detailManager.show(detailManagerPanel, ConfigDescriptionEditor.TEXT_DETAIL_EDITOR_NAME);
rbText.setSelected(true);
}
invalidate();
}
Sets the entry type for the current config description entry. This also selects and activates the correct detail
editor for this type. |
protected void setSelectedEntry(ConfigDescriptionEntry selectedEntry) {
this.selectedEntry = selectedEntry;
enumEntryEditField.setText(""); //$NON-NLS-1$
enumEntryListModel.clear();
baseClassField.setText(""); //$NON-NLS-1$
if (this.selectedEntry == null)
{
deepEnable(detailEditorPane, false);
}
else
{
deepEnable(detailEditorPane, true);
keyNameField.setText(selectedEntry.getKeyName());
globalField.setSelected(selectedEntry.isGlobal());
hiddenField.setSelected(selectedEntry.isHidden());
descriptionField.setText(selectedEntry.getDescription());
if (selectedEntry instanceof ClassConfigDescriptionEntry)
{
final ClassConfigDescriptionEntry ce = (ClassConfigDescriptionEntry) selectedEntry;
setEntryType(ConfigDescriptionEditor.TYPE_CLASS);
if (ce.getBaseClass() != null)
{
baseClassField.setText(ce.getBaseClass().getName());
}
}
else if (selectedEntry instanceof EnumConfigDescriptionEntry)
{
final EnumConfigDescriptionEntry en = (EnumConfigDescriptionEntry) selectedEntry;
final String[] enums = en.getOptions();
for (int i = 0; i < enums.length; i++)
{
enumEntryListModel.addElement(enums[i]);
}
setEntryType(ConfigDescriptionEditor.TYPE_ENUM);
}
else
{
setEntryType(ConfigDescriptionEditor.TYPE_TEXT);
}
}
}
Defines the currently selected entry from the entry list model and updates the detail editor to reflect the data
from the entry. |
protected void setStatusText(String text) {
statusHolder.setText(text);
}
Defines the status text for this dialog. |
protected void writeSelectedEntry() {
final ConfigDescriptionEntry entry;
switch (getEntryType())
{
case ConfigDescriptionEditor.TYPE_CLASS:
{
final ClassConfigDescriptionEntry ce = new ClassConfigDescriptionEntry(keyNameField.getText());
ce.setDescription(descriptionField.getText());
ce.setGlobal(globalField.isSelected());
ce.setHidden(hiddenField.isSelected());
try
{
final Class c = ObjectUtilities.getClassLoader(getClass()).loadClass(baseClassField.getText());
ce.setBaseClass(c);
}
catch (Exception e)
{
// invalid
ConfigDescriptionEditor.logger.debug("Class is invalid; defaulting to Object.class"); //$NON-NLS-1$
ce.setBaseClass(Object.class);
}
entry = ce;
break;
}
case ConfigDescriptionEditor.TYPE_ENUM:
{
final EnumConfigDescriptionEntry ece = new EnumConfigDescriptionEntry(keyNameField.getText());
ece.setDescription(descriptionField.getText());
ece.setGlobal(globalField.isSelected());
ece.setHidden(hiddenField.isSelected());
final String[] enumEntries = new String[enumEntryListModel.getSize()];
for (int i = 0; i < enumEntryListModel.getSize(); i++)
{
enumEntries[i] = String.valueOf(enumEntryListModel.get(i));
}
ece.setOptions(enumEntries);
entry = ece;
break;
}
default:
{
final TextConfigDescriptionEntry te = new TextConfigDescriptionEntry(keyNameField.getText());
te.setDescription(descriptionField.getText());
te.setGlobal(globalField.isSelected());
te.setHidden(hiddenField.isSelected());
entry = te;
break;
}
}
final ConfigDescriptionEntry selectedEntry = getSelectedEntry();
if (selectedEntry == null)
{
model.add(entry);
return;
}
if (ObjectUtilities.equal(selectedEntry.getKeyName(), entry.getKeyName()) == false)
{
model.remove(selectedEntry);
}
model.add(entry);
}
Updates the currently selected entry from the values found in the detail editor. |