Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)

com.lapetus_ltd.api.db.xml.types
Class TLptsDBWorkspaceType

java.lang.Object
  extended by com.lapetus_ltd._2009.xml.types.XLptsDBWorkspaceType
      extended by com.lapetus_ltd.api.db.xml.types.TLptsDBWorkspaceType

public class TLptsDBWorkspaceType
extends XLptsDBWorkspaceType

Class Description : This type holds the data for a workspace screen dimensions and recent project lists.

This is used by the db-JAPI Coder application to store and retrieve the main screen information between uses of the application.

$LastChangedRevision: 1210 $
$LastChangedDate:: 2010-11-29 15:22:58#$


Field Summary
 
Fields inherited from class com.lapetus_ltd._2009.xml.types.XLptsDBWorkspaceType
buttons, dateFormat, hourFormat, id, language, lastOpenedFolder, lookAndFeel, mainScreenDimensions, popupDebug, popupError, popupMessage, popupWarning, recentProjectListItem, recentProjectTempListItem, split1Location, split2Location, split3Location, split4Location, version, visibleDebug, visibleError, visibleMessage, visibleWarning
 
Constructor Summary
TLptsDBWorkspaceType()
           This constructor initiates the Workspace dimensions, project and temp project lists.
TLptsDBWorkspaceType(XLptsDBWorkspaceType workspace)
           This constructor copies the workspace information from another XLptsDBWorkspaceType.
 
Method Summary
 void addRecentProjectListItem(java.lang.String file)
           Adds the project name to the recent project list.
 void addRecentProjectTempListItem(java.lang.String file)
           Adds the project name to the temp recent project list.
 void clearRecentProjectListItem()
           Clears the Recent Project list.
 void clearRecentProjectTempListItem()
           Clears the Temp Recent Project list.
 boolean equals(java.lang.Object obj)
           Check for equal TLptsDBWorkspaceType objects.
 java.util.List<java.lang.String> getRecentProjectListItem()
           Returns a copy of the recent project list.
 int getRecentProjectListItemSize()
           Returns the size of the recent project list.
 java.util.List<java.lang.String> getRecentProjectTempListItem()
           Returns a copy of the temp list.
 int getRecentProjectTempListItemSize()
           Returns the size of the temp list.
 void removeRecentProjectListItem(java.lang.String file)
           Removes the project name from the recent project list.
 void removeRecentProjectTempListItem(java.lang.String file)
           Removes the project from the temp recent project list.
 void setLastOpenedFolder(java.lang.String value)
          This is an override of XLptsDBWorkspaceType.setLastOpenedFolder(java.lang.String).
 
Methods inherited from class com.lapetus_ltd._2009.xml.types.XLptsDBWorkspaceType
getButtons, getHourFormat, getId, getLanguage, getLastOpenedFolder, getLookAndFeel, getMainScreenDimensions, getSplit1Location, getSplit2Location, getSplit3Location, getSplit4Location, getVersion, isDateFormat, isPopupDebug, isPopupError, isPopupMessage, isPopupWarning, isVisibleDebug, isVisibleError, isVisibleMessage, isVisibleWarning, setButtons, setDateFormat, setHourFormat, setId, setLanguage, setLookAndFeel, setMainScreenDimensions, setPopupDebug, setPopupError, setPopupMessage, setPopupWarning, setSplit1Location, setSplit2Location, setSplit3Location, setSplit4Location, setVersion, setVisibleDebug, setVisibleError, setVisibleMessage, setVisibleWarning
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TLptsDBWorkspaceType

public TLptsDBWorkspaceType()

This constructor initiates the Workspace dimensions, project and temp project lists.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes : Everything in the way of dimensions is set to 0. Lists are created but empty.

Example :

 

TLptsDBWorkspaceType workspace = new TLptsDBWorkspaceType();


TLptsDBWorkspaceType

public TLptsDBWorkspaceType(XLptsDBWorkspaceType workspace)

This constructor copies the workspace information from another XLptsDBWorkspaceType.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes : Use this function every time you need to copy an existing XLptsDBWorkspaceType class.

Example :

 

public void example(XLptsDBWorkspaceType workspace) { TLptsDBWorkspaceType workspaceType = new TLptsDBWorkspaceType(workspace); }

Parameters:
workspace - the class object to copy.
Method Detail

addRecentProjectListItem

public void addRecentProjectListItem(java.lang.String file)

Adds the project name to the recent project list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to add to the list. Getting the list with getRecentProjectListItem and
then adding does not have any affect.

Example :

 

TLptsDBWorkspaceType workspace = new TLptsDBWorkspaceType(); String projectTitle = "C:/projects/project_title.db.prj.xml"; workspace.addRecentProjectListItem(projectTitle );

Parameters:
file - the project to add in the list.

addRecentProjectTempListItem

public void addRecentProjectTempListItem(java.lang.String file)

Adds the project name to the temp recent project list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to add to the list. Getting the list with getRecentProjectTempListItem and
then adding does not have any affect.

Example :

 

TLptsDBWorkspaceType workspace = new TLptsDBWorkspaceType(); String tempProjectTitle = "C:/projects/temp.project_title.db.prj.xml"; workspace.addRecentProjectTempListItem(tempProjectTitle );

Parameters:
file - the project to add in the list.

clearRecentProjectListItem

public void clearRecentProjectListItem()

Clears the Recent Project list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to clear the list. Getting the list with getRecentProjectListItem and
then clearing does not have any affect.

Example :

 

TLptsDBWorkspaceType workspace = new TLptsDBWorkspaceType(); if(workspace.getRecentProjectListItemSize() > 0) workspace.clearRecentProjectListItem();


clearRecentProjectTempListItem

public void clearRecentProjectTempListItem()

Clears the Temp Recent Project list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to clear the list. Getting the list with getRecentProjectTempListItem and
then clear does not have any affect.

Example :

 

TLptsDBWorkspaceType workspace = new TLptsDBWorkspaceType(); if(workspace.getRecentProjectTempListItemSize() > 0) workspace.clearRecentProjectTempListItem();


equals

public boolean equals(java.lang.Object obj)

Check for equal TLptsDBWorkspaceType objects.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to compare two TLptsDBWorkspaceType objects by there id's.

Example :

 

TLptsDBWorkspaceType workspace = new TLptsDBWorkspaceType(); TLptsDBWorkspaceType workspace2 = new TLptsDBWorkspaceType(); return workspace.equals(workspace2);

Overrides:
equals in class java.lang.Object
Parameters:
obj - the DB workspace type
Returns:
true if they are equal, else false.

getRecentProjectListItem

public java.util.List<java.lang.String> getRecentProjectListItem()

Returns a copy of the recent project list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never. The result may be an empty list.

Notes : Do not add to this list as there is no result. Use the addRecentProjectListItem function.

Example :

 

TLptsDBWorkspaceType workspace = new TLptsDBWorkspaceType(); String projectTitle = "C:/projects/project_title.db.prj.xml"; for(String project : workspace.getRecentProjectListItem()) if(project.equals(projectTitle)) loadProjectFromFile(project);

Overrides:
getRecentProjectListItem in class XLptsDBWorkspaceType
Returns:
Returns a list of projects of this workspace.

getRecentProjectListItemSize

public int getRecentProjectListItemSize()

Returns the size of the recent project list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never. The result may be an empty list.

Notes : Do not use getRecentProjectListItem().size() because it is less efficient.

Example :

 

TLptsDBWorkspaceType workspace = new TLptsDBWorkspaceType(); if(workspace.getRecentProjectListItemSize() > 0) return true; else return false;

Returns:
Returns the number of connections.

getRecentProjectTempListItem

public java.util.List<java.lang.String> getRecentProjectTempListItem()

Returns a copy of the temp list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never. The result may be an empty list.

Notes : Do not add to this list as there is no result. Use the addRecentProjectTempListItem function.
The temp list is used for projects that are not purposely saved by the user, but saved by the application on
exit (without save). This is like a backup copy or auto backup.

Example :

 

TLptsDBWorkspaceType workspace = new TLptsDBWorkspaceType(); String tempProjectTitle = "C:/projects/temp.project_title.db.prj.xml"; for(String tempProject : workspace.getRecentProjectTempListItem()) if(tempProject.equals(tempProjectTitle)) loadProjectFromFile(tempProject);

Overrides:
getRecentProjectTempListItem in class XLptsDBWorkspaceType
Returns:
Returns a list of projects of this workspace.

getRecentProjectTempListItemSize

public int getRecentProjectTempListItemSize()

Returns the size of the temp list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never. The result may be an empty list.

Notes : Do not use getRecentProjectTempListItem().size() as it is not efficient.

Example :

 

TLptsDBWorkspaceType workspace = new TLptsDBWorkspaceType(); if(workspace.getRecentProjectTempListItemSize() > 0) return true; else return false;

Returns:
Returns the number of connections.

removeRecentProjectListItem

public void removeRecentProjectListItem(java.lang.String file)

Removes the project name from the recent project list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to remove from the list. Getting the list with getRecentProjectListItem and
then removing does not have any affect.

Example :

 

TLptsDBWorkspaceType workspace = new TLptsDBWorkspaceType(); String projectTitle = "C:/projects/project_title.db.prj.xml"; for(String project : workspace.getRecentProjectListItem()) if(project.equals(projectTitle)) { workspace.removeRecentProjectListItem(project); break; }

Parameters:
file - the project to remove from list.

removeRecentProjectTempListItem

public void removeRecentProjectTempListItem(java.lang.String file)

Removes the project from the temp recent project list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to remove from the list. Getting the list with getRecentProjectTempListItem and
then removing does not have any affect.

Example :

 

TLptsDBWorkspaceType workspace = new TLptsDBWorkspaceType(); String tempProjectTitle = "C:/projects/temp.project_title.db.prj.xml"; for(String project : workspace.getRecentProjectTempListItem()) if(project.equals(tempProjectTitle)) { workspace.removeRecentProjectTempListItem(project); break; }

Parameters:
file - the project to remove from list.

setLastOpenedFolder

public void setLastOpenedFolder(java.lang.String value)
This is an override of XLptsDBWorkspaceType.setLastOpenedFolder(java.lang.String).

Overrides:
setLastOpenedFolder in class XLptsDBWorkspaceType
Parameters:
value - The last opened folder path so that we can go back to it in another session. The string supplied here is scanned and all '\' characters are replaced by '/'.


Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)