|
JDIC API V0.9 Release 4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.jdic.filetypes.Association
public class Association
This class represents a file type association.
A file type association contains a description, the MIME type, file extensions,
icon file, actions which are represented by Action
objects, and
stored MIME file name for Gnome/UNIX platforms.
An association could be registered into or unregistered from the system using
certain methods of AssociationService
. An association for a particular
file type could be returned by certain methods of AssociationService
.
Action
,
AssociationService
Constructor Summary | |
---|---|
Association()
|
Method Summary | |
---|---|
boolean |
addAction(Action action)
Adds a given action to the action list of this Association . |
boolean |
addFileExtension(java.lang.String fileExt)
Adds one file extension to the file extension list of this Association . |
boolean |
equals(java.lang.Object other)
Overrides the same method of java.lang.Object . |
Action |
getActionByVerb(java.lang.String verb)
Returns the action, whose verb field is the same with the specified verb. |
java.util.List |
getActionList()
Returns the action list of this Association . |
java.lang.String |
getDescription()
Returns the description string of this Association . |
java.util.List |
getFileExtList()
Returns the file extension list of this Association . |
java.lang.String |
getIconFileName()
Returns the icon file name representing this Association . |
java.lang.String |
getMimeType()
Returns the MIME type of this Association . |
java.lang.String |
getName()
Returns the name of the MIME files the association is stored in for Gnome/Unix platforms. |
int |
hashCode()
Overrides the same method of java.lang.Object . |
boolean |
removeAction(Action action)
Removes a given action from the action list of this Association . |
boolean |
removeFileExtension(java.lang.String fileExt)
Removes the given file extension from the file extension list of this Association . |
void |
setDescription(java.lang.String description)
Sets the description string of this Association . |
void |
setIconFileName(java.lang.String fileName)
Sets the icon file name representing this Association . |
void |
setMimeType(java.lang.String mimeType)
Sets the MIME type of this Association . |
void |
setName(java.lang.String name)
Returns the name of the MIME files the association is stored in for Gnome/Unix platforms. |
java.lang.String |
toString()
Overrides the same method of java.lang.Object . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Association()
Method Detail |
---|
public java.lang.String getName()
For Gnome/Unix platforms, the association is stored in plain text files:
name
.mime, name
.keys and name
.applications.
While registering or unregistering an association using certain methods
of AssociationService
, the MIME files with the given name
are created or removed.
For Microsoft Windows platforms, the association is stored in the registry, this name is not used.
public void setName(java.lang.String name)
name
- a given name value.public java.lang.String getDescription()
Association
.
public void setDescription(java.lang.String description)
Association
.
description
- a given description value.public java.lang.String getMimeType()
Association
.
public void setMimeType(java.lang.String mimeType)
Association
.
mimeType
- a given MIME type.public boolean addFileExtension(java.lang.String fileExt)
Association
.
If the given file extension already exists in the file extension
list, no changes are made to the file extension list.
The specified file extension could have a leading '.' character or not.
For Microsoft Windows platforms, only the first file extension is used during registeration.
fileExt
- a given file extension.
true
if the given file extension is added successfully
to the file extension list; false
otherwise.public boolean removeFileExtension(java.lang.String fileExt)
Association
. If the file extension is not contained in the file
extension list, no changes are made to the file extension list.
The specified file extension may have a leading '.' character or not.
fileExt
- a given file extension.
true
if the given file extension is removed successfully
from the file extension list; false
otherwise.public java.util.List getFileExtList()
Association
.
public java.lang.String getIconFileName()
Association
.
public void setIconFileName(java.lang.String fileName)
Association
.
For Microsoft Windows platforms, the given icon file will be registered only if the given file extension list is not empty.
fileName
- a given icon file name.public boolean addAction(Action action)
Association
.
If the given action already exists in the action list, no changes are
made to the action list.
A valid action should not have null verb or command field.
For Microsoft Windows platforms, an association with non-empty action list would be valid for registration when the file extension list is not empty.
action
- a given action.
true
if the given action is added successfully
to the action list; false
otherwise.public boolean removeAction(Action action)
Association
.
If the action is not contained in the action list, no changes are made to
the action list.
A valid action should not have null verb or command field.
action
- a given action.
true
if the given action is removed successfully
from the action list; false
otherwise.public java.util.List getActionList()
Association
.
public Action getActionByVerb(java.lang.String verb)
verb
- the specified verb.
null
if no
approprate action is found.public boolean equals(java.lang.Object other)
java.lang.Object
.
Determines whether or not two associations are equal. Two instances
of Association
are equal if the values of all the fields
are the same.
equals
in class java.lang.Object
other
- an object to be compared with this Association
.
true
if the object to be compared is an instance of
Association
and has the same values;
false
otherwise.public int hashCode()
java.lang.Object
.
Returns the hashcode for this Association
.
hashCode
in class java.lang.Object
Association.
public java.lang.String toString()
java.lang.Object
.
Returns a String
that represents the value of this
Association
.
The output of this object as a string would be like: MIME File Name: Description: MIME Type: Icon File: File Extension: Action List: Description: Verb: Command:
toString
in class java.lang.Object
Association
.
|
JDIC API V0.9 Release 4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, working code examples, license terms and bug report information.
Copyright (c) 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.