public class ResourceProperties
extends java.lang.Object
implements java.io.Serializable
Resource
or ResourceList
object.
The properties pane is presented as a set of tabs, each of which can present multiple properties. The tabs are identified by their index, starting at 0, in the order they are added. There is always at least one tab, created by default. The first tab always displays the icon and full name of the object being represented.
Properties are specified using either attribute IDs (for Resource objects), or selection or sort IDs (for ResourceList objects). Each implementation of Resource or ResourceList documents its set of valid attribute, selection, and sort IDs.
This class alone does not present the properties pane. It is
intended for use in conjunction with
ResourceListDetailsPane
or ResourceListPane
.
Here is an example which creates a ResourceProperties object for
a list of jobs:
// Create the resource list. This example creates
// a list of all jobs on the system.
AS400 system = new AS400("MYSYSTEM", "MYUSERID", "MYPASSWORD");
RJobList resourceList = new RJobList(system);
// Create and initialize a ResourceProperties object
// which defines the arrangement of job attributes
// to be presented when the end user views the
// properties for a specific job.
ResourceProperties properties = new ResourceProperties();
// Add the job number, user name, and job type to the first tab.
properties.addProperty(RJob.JOB_NUMBER);
properties.addProperty(RJob.USER_NAME);
properties.addProperty(RJob.JOB_TYPE);
// Add a new "Special" tab which contains the job status and subtype.
int specialTab = properties.addTab("Special");
properties.addProperty(specialTab, RJob.JOB_STATUS);
properties.addProperty(specialTab, RJob.JOB_SUBTYPE);
// Create the ResourceListDetailsPane. In this example,
// there are four columns in the table. The first column
// contains the icons and names for each job. The remaining
// columns contain the status, type, and subtype, respectively,
// for each job. In addition, we specify the ResourceProperties
// object defined earlier.
Object[] columnAttributes = new Object[] { null, RJob.JOB_NUMBER, RJob.USER_NAME, RJob.JOB_STATUS, RJob.JOB_TYPE, RJob.JOB_SUBTYPE };
ResourceListDetailsPane detailsPane = new ResourceListDetailsPane(resourceList, columnAttributes, properties);
// Add the ResourceListDetailsPane to a JFrame and show it.
JFrame frame = new JFrame("My Window");
frame.getContentPane().add(detailsPane);
frame.pack();
frame.show();
// The ResourceListDetailsPane will appear empty until
// we load it. This gives us control of when the list
// of jobs is retrieved from the system.
detailsPane.load();
Constructor and Description |
---|
ResourceProperties()
Deprecated.
Constructs the ResourceProperties object.
|
ResourceProperties(java.lang.Object[] propertyIDs,
java.lang.String firstTabLabel,
boolean editable)
Deprecated.
Constructs the ResourceProperties object.
|
ResourceProperties(java.lang.String firstTabLabel,
boolean editable)
Deprecated.
Constructs the ResourceProperties object.
|
Modifier and Type | Method and Description |
---|---|
void |
addProperties(int tab,
java.lang.Object[] propertyIDs)
Deprecated.
Adds multiple properties to the specified tab.
|
void |
addProperties(java.lang.Object[] propertyIDs)
Deprecated.
Adds multiple properties to the first tab.
|
void |
addProperty(int tab,
java.lang.Object propertyID)
Deprecated.
Adds a property to the specified tab.
|
void |
addProperty(java.lang.Object propertyID)
Deprecated.
Adds a property to the first tab.
|
int |
addTab(java.lang.String label)
Deprecated.
Adds a tab.
|
int |
addTab(java.lang.String label,
java.lang.Object[] propertyIDs)
Deprecated.
Adds a tab.
|
java.lang.String |
getLabel(int tab)
Deprecated.
Returns the label for the specified tab.
|
java.lang.Object[] |
getProperties(int tab)
Deprecated.
Returns the property IDs that have been added to the specified tab.
|
int |
getTabCount()
Deprecated.
Returns the number of tabs.
|
boolean |
isEditable()
Deprecated.
Indicates if the properties are editable.
|
void |
setEditable(boolean editable)
Deprecated.
Sets whether the properties are editable.
|
public ResourceProperties()
public ResourceProperties(java.lang.String firstTabLabel, boolean editable)
firstTabLabel
- The label for the first tab.editable
- true if the properties should be editable,
false otherwise.public ResourceProperties(java.lang.Object[] propertyIDs, java.lang.String firstTabLabel, boolean editable)
propertyIDs
- The property IDs to add to the first tab.firstTabLabel
- The label for the first tab.editable
- true if the properties should be editable,
false otherwise.public void addProperty(java.lang.Object propertyID)
propertyID
- The property ID to add to the first tab.public void addProperty(int tab, java.lang.Object propertyID)
tab
- The tab.
propertyID
- The property ID to add to the specified tab.public void addProperties(java.lang.Object[] propertyIDs)
propertyIDs
- The property IDs to add to the first tab.public void addProperties(int tab, java.lang.Object[] propertyIDs)
tab
- The tab.
propertyIDs
- The property IDs to add to the specified tab.public int addTab(java.lang.String label)
label
- The tab label.public int addTab(java.lang.String label, java.lang.Object[] propertyIDs)
label
- The tab label.propertyIDs
- The property IDs to add to the tab.public java.lang.String getLabel(int tab)
tab
- The tab.
public java.lang.Object[] getProperties(int tab)
tab
- The tab.
public int getTabCount()
public boolean isEditable()
public void setEditable(boolean editable)
editable
- true if the properties should be editable,
false otherwise. The default is false.