Skip navigation links
oracle.jdevimpl.audit.profile
Class ProfileModel
java.lang.Object
javax.swing.AbstractListModel
oracle.jdevimpl.audit.profile.ProfileModel
- All Implemented Interfaces:
- java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.swing.ComboBoxModel, javax.swing.event.ChangeListener, javax.swing.ListModel
-
public class ProfileModel
- extends javax.swing.AbstractListModel
- implements javax.swing.ComboBoxModel, javax.swing.event.ChangeListener, java.beans.PropertyChangeListener
An editable model of profiles in an Audit profile repository.
- See Also:
- Serialized Form
Fields inherited from class javax.swing.AbstractListModel |
listenerList |
Method Summary |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
apply()
|
void |
cancel()
|
boolean |
contains(java.lang.String name)
|
void |
exportAs(java.net.URL url, java.lang.String name)
Exports the selected profile to a URL. |
void |
fireContentsChanged(int index)
|
void |
fireContentsChanged(Profile profile)
|
void |
fireSelectionChanged()
|
ExtensionBean |
getBean(java.lang.String id)
|
java.util.Collection<ExtensionBean> |
getBeans()
|
Profile |
getElementAt(int index)
|
Profile |
getProfile(java.lang.String name)
|
Profile |
getProfile(java.lang.String name, java.lang.String key)
|
Profile |
getSelectedItem()
|
int |
getSize()
|
void |
importAs(java.net.URL url, java.lang.String newName, Profile overwrittenProfile)
Imports a profile under a new name. |
boolean |
isModified(Profile profile)
|
boolean |
isModified(java.lang.String id)
|
boolean |
isNew(Profile profile)
|
boolean |
nameMatches(Profile name1, Profile name2)
|
boolean |
nameMatches(Profile name1, java.lang.String name2)
|
boolean |
nameMatches(java.lang.String name1, Profile name2)
|
boolean |
nameMatches(java.lang.String name1, java.lang.String name2)
|
void |
propertyChange(java.beans.PropertyChangeEvent event)
|
void |
remove()
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
restoreDefaults()
|
void |
saveAs(java.lang.String newName, Profile overwrittenProfile)
Saves the selected profile, including changes, under a new name. |
void |
setSelectedItem(java.lang.Object item)
|
void |
stateChanged(javax.swing.event.ChangeEvent event)
|
java.lang.String |
toString()
|
Methods inherited from class javax.swing.AbstractListModel |
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.swing.ListModel |
addListDataListener, removeListDataListener |
ProfileModel
public ProfileModel(ProfileRepository repository)
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
getSize
public int getSize()
-
- Specified by:
getSize
in interface javax.swing.ListModel
getElementAt
public Profile getElementAt(int index)
-
- Specified by:
getElementAt
in interface javax.swing.ListModel
getProfile
public Profile getProfile(java.lang.String name)
getProfile
public Profile getProfile(java.lang.String name,
java.lang.String key)
remove
public void remove()
setSelectedItem
public void setSelectedItem(java.lang.Object item)
-
- Specified by:
setSelectedItem
in interface javax.swing.ComboBoxModel
getSelectedItem
public Profile getSelectedItem()
-
- Specified by:
getSelectedItem
in interface javax.swing.ComboBoxModel
contains
public boolean contains(java.lang.String name)
getBeans
public java.util.Collection<ExtensionBean> getBeans()
getBean
public ExtensionBean getBean(java.lang.String id)
isModified
public boolean isModified(java.lang.String id)
nameMatches
public boolean nameMatches(java.lang.String name1,
Profile name2)
nameMatches
public boolean nameMatches(Profile name1,
java.lang.String name2)
nameMatches
public boolean nameMatches(java.lang.String name1,
java.lang.String name2)
nameMatches
public boolean nameMatches(Profile name1,
Profile name2)
saveAs
public void saveAs(java.lang.String newName,
Profile overwrittenProfile)
throws java.io.IOException
- Saves the selected profile, including changes, under a new name. There are three cases:
- the name does not actually change: changes are applied to the selected profile;
- the name changes and no existing profile has the same name: a new profile is created incorporating the changes, the changes to the selected profile are reverted, and the new profile is selected;
- the name changes and an existing profile has the same name: the existing profile is reset from the selected profile, including changes, the changes to the selected profile are reverted; and the overwritten profile is selected.
-
- Parameters:
newName
- The new name of the profile.
overwrittenProfile
- The profile that will be overwritten, or null if none.
- Throws:
java.io.IOException
importAs
public void importAs(java.net.URL url,
java.lang.String newName,
Profile overwrittenProfile)
throws java.io.IOException
- Imports a profile under a new name. There are three cases:
- the name does not actually change: changes are applied to the selected profile;
- the name changes and no existing profile has the same name: a new profile is created incorporating the changes, the changes to the selected profile are reverted, and the new profile is selected;
- the name changes and an existing profile has the same name: the existing profile is reset from the selected profile, including changes, the changes to the selected profile are reverted; and the overwritten profile is selected.
-
- Parameters:
newName
- The new name of the profile.
overwrittenProfile
- The profile that will be overwritten, or null if none.
- Throws:
java.io.IOException
exportAs
public void exportAs(java.net.URL url,
java.lang.String name)
throws java.io.IOException
- Exports the selected profile to a URL. The selected profile is not changed.
-
- Parameters:
url
- The URL to which to write the profile.
name
- The new name of the exported profile.
- Throws:
java.io.IOException
restoreDefaults
public void restoreDefaults()
isModified
public boolean isModified(Profile profile)
isNew
public boolean isNew(Profile profile)
apply
public void apply()
throws java.io.IOException
-
- Throws:
java.io.IOException
cancel
public void cancel()
stateChanged
public void stateChanged(javax.swing.event.ChangeEvent event)
-
- Specified by:
stateChanged
in interface javax.swing.event.ChangeListener
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent event)
-
- Specified by:
propertyChange
in interface java.beans.PropertyChangeListener
fireSelectionChanged
public void fireSelectionChanged()
fireContentsChanged
public void fireContentsChanged(Profile profile)
fireContentsChanged
public void fireContentsChanged(int index)
toString
public java.lang.String toString()
-
- Overrides:
toString
in class java.lang.Object
Skip navigation links
Copyright © 1997, 2011, Oracle. All rights reserved.