|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.objectweb.jac.aspects.gui.swing.AbstractView
org.objectweb.jac.aspects.gui.swing.AbstractCollection
Base class to implement ListView and TableView
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
protected CollectionItemView |
itemView
|
Fields inherited from class org.objectweb.jac.aspects.gui.swing.AbstractView |
closed, height, width |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
AbstractCollection(ViewFactory factory,
DisplayContext context,
CollectionItem collection,
Object substance,
CollectionModel model,
CollectionItemView itemView)
|
Method Summary | |
void |
actionPerformed(ActionEvent event)
Handles the actions on this view. |
void |
close(boolean validate)
Close this view. |
protected JButton |
createButton(String icon,
String tooltip,
String action)
|
CollectionModel |
getCollectionModel()
Gets the associated collection model. |
protected abstract CollectionUpdate |
getCollectionUpdate()
|
FieldItem |
getField()
|
protected abstract JComponent |
getInnerComponent(Model model)
|
protected Object[] |
getSelected()
Returns an array of the selected objects. |
protected abstract int[] |
getSelectedIndices()
Returns the indices of selected objects. |
protected abstract ListSelectionModel |
getSelectionModel()
|
Object |
getSubstance()
Gets the substance object holding the field |
boolean |
isEditor()
Tells wether the view allows to edit the collection (i.e it has add/remove buttons) |
void |
keyPressed(KeyEvent event)
|
void |
keyReleased(KeyEvent event)
|
void |
keyTyped(KeyEvent event)
|
void |
mouseClicked(MouseEvent me)
|
void |
mouseEntered(MouseEvent me)
|
void |
mouseExited(MouseEvent me)
|
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(MouseEvent e)
|
protected abstract void |
onRemove()
|
void |
setAutoUpdate(boolean autoUpdate)
Sets the auto-update property of the view. |
void |
setEditor(boolean isEditor)
Set the "editability" of the view. |
void |
setField(FieldItem field)
Sets the field being displayed |
protected void |
setNoRefresh(boolean norefresh)
|
void |
setSubstance(Object substance)
Sets the substance object holding the field |
void |
setValue(Object value)
Sets the value to display |
void |
updateModel(Object substance)
Updates the collection model |
void |
valueChanged(ListSelectionEvent event)
Defines what happens when the selection changes. |
Methods inherited from class org.objectweb.jac.aspects.gui.swing.AbstractView |
equalsView, equalsView, getContext, getDescription, getFactory, getLabel, getMessage, getParameters, getParentView, getRootView, getStyle, getType, getViewBorder, invokeInContext, isClosed, isDescendantOf, setContext, setDescription, setFactory, setFocus, setLabel, setMessage, setParameters, setParentView, setSize, setStyle, setType, setViewBorder, toString |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.objectweb.jac.aspects.gui.CollectionView |
setSelected |
Methods inherited from interface org.objectweb.jac.aspects.gui.View |
getContext, getDescription, getFactory, getLabel, getMessage, getParentView, getRootView, getStyle, getViewBorder, isClosed, isDescendantOf, setContext, setDescription, setFactory, setFocus, setLabel, setMessage, setParentView, setSize, setStyle, setViewBorder |
Methods inherited from interface org.objectweb.jac.aspects.gui.ViewIdentity |
equalsView, equalsView, getParameters, getType, setParameters, setType |
Field Detail |
protected CollectionItemView itemView
Constructor Detail |
public AbstractCollection(ViewFactory factory, DisplayContext context, CollectionItem collection, Object substance, CollectionModel model, CollectionItemView itemView)
Method Detail |
public CollectionModel getCollectionModel()
CollectionView
getCollectionModel
in interface CollectionView
protected JButton createButton(String icon, String tooltip, String action)
protected abstract JComponent getInnerComponent(Model model)
public boolean isEditor()
CollectionView
isEditor
in interface CollectionView
CollectionView.setEditor(boolean)
public void setEditor(boolean isEditor)
CollectionView
setEditor
in interface CollectionView
CollectionView.isEditor()
public void setAutoUpdate(boolean autoUpdate)
FieldView
setAutoUpdate
in interface FieldView
public void close(boolean validate)
View
close
in interface View
close
in class AbstractView
public void valueChanged(ListSelectionEvent event)
valueChanged
in interface ListSelectionListener
public void keyTyped(KeyEvent event)
keyTyped
in interface KeyListener
public void keyPressed(KeyEvent event)
keyPressed
in interface KeyListener
public void keyReleased(KeyEvent event)
keyReleased
in interface KeyListener
public void actionPerformed(ActionEvent event)
On a collection view, the three default possible actions are to open a new view on the selected item, to add a new item to the collection, and to remove the selected item from the collection.
actionPerformed
in interface ActionListener
event
- the user eventprotected abstract void onRemove()
protected abstract CollectionUpdate getCollectionUpdate()
protected Object[] getSelected()
protected abstract int[] getSelectedIndices()
protected abstract ListSelectionModel getSelectionModel()
protected void setNoRefresh(boolean norefresh)
public void mouseClicked(MouseEvent me)
mouseClicked
in interface MouseListener
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseExited(MouseEvent me)
mouseExited
in interface MouseListener
public void mouseEntered(MouseEvent me)
mouseEntered
in interface MouseListener
public void setField(FieldItem field)
FieldView
setField
in interface FieldView
field
- the fieldpublic void setSubstance(Object substance)
FieldView
setSubstance
in interface FieldView
substance
- the substanceFieldView.getSubstance()
public Object getSubstance()
FieldView
getSubstance
in interface FieldView
FieldView.setSubstance(Object)
public FieldItem getField()
getField
in interface FieldView
public void setValue(Object value)
FieldView
setValue
in interface FieldView
value
- the valuepublic void updateModel(Object substance)
CollectionView
updateModel
in interface CollectionView
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |