public class IlvDiagrammerProject extends Object
IlvDiagrammer
,
IlvDiagrammerDataSource
Modifier and Type | Field and Description |
---|---|
static String |
longDescription
The name of the predefined project property that holds a longer description
of the project.
|
static String |
shortDescription
The name of the predefined project property that holds a short description
of the project.
|
static String |
suffix
The suffix for Diagrammer project files (
".idpr" ). |
Constructor and Description |
---|
IlvDiagrammerProject()
Creates a new Diagrammer project.
|
IlvDiagrammerProject(URL url)
Reads a Diagrammer project from an XML file.
|
Modifier and Type | Method and Description |
---|---|
void |
addStyleSheet(URL styleSheet)
Adds a cascading style sheet to this Diagrammer project.
|
IlvDiagrammerDataSource |
getDataSource()
Returns the data source of this Diagrammer project.
|
URL |
getProjectURL()
Returns the URL of the XML description file that this project was read from
or written to.
|
Object |
getProperty(File dir,
String key)
Returns a specific property of this Diagrammer project in the default
Locale . |
Object |
getProperty(String key)
Returns a property of this Diagrammer project for the current Locale.
|
Object |
getProperty(String key,
Locale locale)
Returns a property of this Diagrammer project, such as its description,
the author's name, the creation date, etc.
|
URL |
getStyleSheet()
Returns the first style sheet of this Diagrammer project.
|
URL[] |
getStyleSheets()
Returns all the cascaded style sheets of this Diagrammer project.
|
void |
read(URL url)
Reads the project description from a URL.
|
void |
removeStyleSheet(URL styleSheet)
Removes a cascading style sheet from this Diagrammer project.
|
void |
setDataSource(IlvDiagrammerDataSource dataSource)
Sets the data source of this Diagrammer project.
|
void |
setStyleSheet(URL styleSheet)
Sets the first style sheet of this Diagrammer project, and removes all
the other style sheets.
|
void |
write(URL url)
Writes the project description to a URL.
|
public static String suffix
".idpr"
).public static final String shortDescription
public static final String longDescription
public IlvDiagrammerProject()
null
.public IlvDiagrammerProject(URL url) throws IlvDiagrammerException
url
- The URL of the file containing the XML description of the project.IlvDiagrammerException
- If an exception occurred while reading the project file.public void setStyleSheet(URL styleSheet)
styleSheet
- The new style sheet.public URL getStyleSheet()
public void addStyleSheet(URL styleSheet)
styleSheet
- The style sheet to add.public void removeStyleSheet(URL styleSheet)
styleSheet
- The style sheet to remove.public URL[] getStyleSheets()
public IlvDiagrammerDataSource getDataSource()
public void setDataSource(IlvDiagrammerDataSource dataSource)
dataSource
- The new data source.public Object getProperty(String key, Locale locale)
Properties are localized, and are retrieved from property files
located "next to" the project file. For example, a project saved in the description
file file:/somewhere/exampleProject.xml
will read its properties
from the property files file:/somewhere/exampleProject[_<locale>].properties
,
where [_<locale>]
is the suffix for the specified Locale, as explained
in java.util.ResourceBundle
. So, with a French locale, the property file
would be file:/somewhere/exampleProject_fr.properties
or
file:/somewhere/exampleProject_fr_FR.properties
. The default property file
would be file:/somewhere/exampleProject.properties
.
key
- The name of the property to retrieve.locale
- The Locale for which the property is to be retrieved.null
if the property
is not defined or if no property file could be found for this project
and the specified Locale.public Object getProperty(String key)
getProperty(key, IlvLocaleUtil.getCurrentLocale())
.key
- The name of the property to retrieve.null
if the property
is not defined or if no property file could be found for this project
and the current Locale.public Object getProperty(File dir, String key)
Locale
. It looks for the bundle in dir
.dir
- The bundle directory.key
- The name of the property to retrieve.null
in the following
cases:
Locale
.public URL getProjectURL()
public void read(URL url) throws IlvDiagrammerException
url
- The project URL.IlvDiagrammerException
- If an error occurred while reading the project description.public void write(URL url) throws IlvDiagrammerException
url
- The project URL.IlvDiagrammerException
- If an error occurred while writing the project description.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.