com.pepper.platform.program
Class Section

java.lang.Object
  extended by com.pepper.platform.program.Section
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JavaSection, WebSection

public class Section
extends Object
implements Serializable

This class represents a Section object for a given program. The Section object contains a list of Pages.

See Also:
Serialized Form

Constructor Summary
Section(Section parentSection, com.pepper.platform.program.PageMgr pageMgr)
          Creates a new Section instance.
 
Method Summary
 void addPage(Page page)
          Add a page to the section.
 boolean arePagesLoaded()
          Returns true if pages have been loaded.
 boolean deleteOnClose()
          return true if the section should be deleted when closing the package
 String getDescription()
          Returns the section description.
 String getIconName()
          Returns the section icon name.
 String getId()
          Returns the Id for the Section.
 boolean getIsContentSection()
          Describe getContentSection method here.
 String getName()
          Returns the display name for the section.
 Page getPage(int index)
          Returns the page specified by the given index.
 PageList getPages()
          Returns the PageList of this section.
 Section getParentSection()
          Returns the parent of this section if it exists, or null.
 SectionPage getSectionPage()
          Return the SectionPage (if any) for the current Section.
 boolean getShowDeleteButton()
          get state of whether or not to show the delete button on the tab representing this section
 boolean getSync()
          Returns true if the section should be synced when a sync occurs
 int getTabIndex()
          Returns the section tab index.
 String getViewId()
          Get the browser view id associated with this section
 int insertPage(int index, Page page)
          Insert the page in the list and return position actually inserted
 boolean isVisible()
          Returns true if the section has a UI.
 boolean isWebSection()
          Returns false because it's not a WebSection
 boolean saveTombstones()
          return true if tombstones are enabled for this section
 void setDeleteOnClose(boolean state)
          set to true to have section be deleted when package is closed
 void setDescription(String desc)
          Sets the section description.
 void setIconName(String iconName)
          Sets the section icon name.
 void setId(String id)
          Sets the unique ID for the Section.
 void setIsContentSection(boolean state)
          Describe setContentSection method here.
 void setName(String name)
          Sets the display name for the section.
 void setPageMgr(com.pepper.platform.program.PageMgr pageMgr)
          Set the process id that this section belongs to
 void setPagesLoaded(boolean pagesLoaded)
          Sets the the section attribute indicating whether or not pages have been loaded.
 void setSaveTombstones(boolean state)
          set to true to have tombstones saved when moving/deleting the section
 void setShowDeleteButton(boolean state)
          set whether or not to show the delete button on the tab representing this section
 void setSync(boolean state)
          Sets whether the section should be synced when a sync occurs
 void setTabIndex(int index)
          Sets the section tab index.
 void setViewId(String viewId)
          Set the browser view id associated with
 void setVisible(boolean visible)
          Set to true if the section has a UI, otherwise false.
 String toString()
          Debug method to dump contents of Section to a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Section

public Section(Section parentSection,
               com.pepper.platform.program.PageMgr pageMgr)
Creates a new Section instance.

Parameters:
parentSection - Parent of this section. May be null.
pageMgr - PageMgr for the program. Must not be null.
Method Detail

arePagesLoaded

public boolean arePagesLoaded()
Returns true if pages have been loaded.

Returns:
a boolean indicating whether or not pages have been loaded.

setPagesLoaded

public void setPagesLoaded(boolean pagesLoaded)
Sets the the section attribute indicating whether or not pages have been loaded.

Parameters:
pagesLoaded - a boolean value.

isVisible

public boolean isVisible()
Returns true if the section has a UI.

Returns:
a boolean indicating whether or not the section has a UI.

setVisible

public void setVisible(boolean visible)
Set to true if the section has a UI, otherwise false.

Parameters:
visible - a boolean value.

setPageMgr

public void setPageMgr(com.pepper.platform.program.PageMgr pageMgr)
Set the process id that this section belongs to

Parameters:
pageMgr - an Integer value

setIsContentSection

public void setIsContentSection(boolean state)
Describe setContentSection method here.

Parameters:
state - a boolean value

getIsContentSection

public boolean getIsContentSection()
Describe getContentSection method here.

Returns:
a boolean value

getParentSection

public Section getParentSection()
Returns the parent of this section if it exists, or null.

Returns:
A Section instance, or null.

getPages

public PageList getPages()
Returns the PageList of this section. Note - Any operations on the PageList should be externally synchronized on using the instance lock. See PageList for more information.

Returns:
A PageList instance.

getPage

public Page getPage(int index)
Returns the page specified by the given index.

Parameters:
index - an int value specifying the page index.
Returns:
The specified Page instance if it exists, else null.

addPage

public void addPage(Page page)
Add a page to the section.

Parameters:
page - the Page instance to be added.

insertPage

public int insertPage(int index,
                      Page page)
Insert the page in the list and return position actually inserted

Parameters:
index - an int value
page - a Page value
Returns:
an int value

getSectionPage

public SectionPage getSectionPage()
Return the SectionPage (if any) for the current Section. This corresponds to the Section Table of Contents Page

Returns:
A SectionPage value.

getId

public String getId()
Returns the Id for the Section.

Returns:
A String value containing the section Id.

setId

public void setId(String id)
Sets the unique ID for the Section.

Parameters:
id - a String value specifying the section Id.

getViewId

public String getViewId()
Get the browser view id associated with this section

Returns:
a String value

setViewId

public void setViewId(String viewId)
Set the browser view id associated with

Parameters:
viewId - a String value

getName

public String getName()
Returns the display name for the section.

Returns:
A String value containing the display name.

isWebSection

public boolean isWebSection()
Returns false because it's not a WebSection

Returns:
a boolean value

deleteOnClose

public boolean deleteOnClose()
return true if the section should be deleted when closing the package

Since:
3.2

setDeleteOnClose

public void setDeleteOnClose(boolean state)
set to true to have section be deleted when package is closed

Since:
3.2

setSaveTombstones

public void setSaveTombstones(boolean state)
set to true to have tombstones saved when moving/deleting the section

Since:
3.2

saveTombstones

public boolean saveTombstones()
return true if tombstones are enabled for this section

Since:
3.2

setShowDeleteButton

public void setShowDeleteButton(boolean state)
set whether or not to show the delete button on the tab representing this section

Since:
3.2

getShowDeleteButton

public boolean getShowDeleteButton()
get state of whether or not to show the delete button on the tab representing this section

Since:
3.2

getSync

public boolean getSync()
Returns true if the section should be synced when a sync occurs

Since:
3.2

setSync

public void setSync(boolean state)
Sets whether the section should be synced when a sync occurs

Since:
3.2

setName

public void setName(String name)
Sets the display name for the section.

Parameters:
name - a String value containing the display name.

getTabIndex

public int getTabIndex()
Returns the section tab index.

Returns:
the section tab index.

setTabIndex

public void setTabIndex(int index)
Sets the section tab index.

Parameters:
index - the section tab index.

setDescription

public void setDescription(String desc)
Sets the section description.

Parameters:
desc - a String value containing the description.

getDescription

public String getDescription()
Returns the section description.

Returns:
A String value containing the description.

setIconName

public void setIconName(String iconName)
Sets the section icon name.

Parameters:
iconName - a String value specifing the icon name.

getIconName

public String getIconName()
Returns the section icon name.

Returns:
A String value containing the icon name.

toString

public String toString()
Debug method to dump contents of Section to a String.

Overrides:
toString in class Object


Copyright © 2006-2007 Pepper Computer, Inc. All Rights Reserved.