public class Presenter extends Object
Presenter
class acts as the Controller in the MVP patternConstructor and Description |
---|
Presenter(TemplateModel model) |
Modifier and Type | Method and Description |
---|---|
void |
addAttributArea(int width,
int height,
String name,
String[] values,
boolean useCheckBox,
boolean displayBlock) |
TemplateComponent |
addCommentArea(int width,
int height,
boolean isGrouped)
insert a new comment area in the UI and in the UI and model
|
com.google.gwt.user.client.ui.Widget |
addFakeTextArea(int y,
boolean doubleInsterted) |
com.google.gwt.user.client.ui.Widget |
addGroupingStart(int y) |
TemplateComponent |
addInstructionArea(int width,
int height,
boolean isGrouped)
insert a new instruction area in the UI and in the UI and model
|
void |
addNewPage()
called when nextPage Button is Clicked
|
TemplateComponent |
addPageBreak()
called when add page break command is Clicked
|
void |
addTextToolBar()
add the text format toolbar on the top
|
void |
changeTemplateName(String newName)
changes the template name
|
TemplateComponent |
checkIfDoubleColLayout(com.google.gwt.user.client.ui.Widget toRemove) |
void |
cleanAll()
remove the user-added components from the workspace, and from the model
|
void |
cleanWorkspace()
remove the user-added components from the workspace (in the current page) but not from the model
|
TemplateComponent |
createAttributArea(int width,
int height,
String name,
String[] values,
boolean useCheckBox,
boolean displayBlock,
boolean hideControls)
insert a new attribute area in the UI and in the UI and model
|
TemplateComponent |
createDroppingArea(org.gcube.portlets.d4sreporting.common.shared.ComponentType type,
int width,
int height,
boolean hideControls)
Create the DroppingImage object
|
TemplateComponent |
createStaticTextArea(org.gcube.portlets.d4sreporting.common.shared.ComponentType type,
int width,
int height,
boolean hideControls)
insert a new static area in the UI and in the model
|
TemplateComponent |
createTable(org.gcube.portlets.d4sreporting.common.shared.ComponentType type,
int rows,
int cols,
boolean hideControls) |
void |
discardCurrentSection()
to remove the current displayed section
|
void |
enableTextToolBar(com.google.gwt.user.client.ui.RichTextArea d4sArea)
enable the format text toolbar for the given Rich Textarea passed as argument
|
String |
getCurrentScope() |
org.gcube.portlets.d4sreporting.common.client.uicomponents.richtext.RichTextToolbar |
getCurrentSelected() |
com.google.gwt.user.client.ui.RichTextArea |
getCurrentSelectedTextArea() |
String |
getCurrentUser() |
TemplateComponent |
getGroupInnerArea() |
HeaderBar |
getHeader() |
Coords |
getInsertionPoint() |
TemplateModel |
getModel() |
org.gcube.portlets.d4sreporting.common.client.uicomponents.ReportUIComponent |
getSelectedComponent() |
int |
getSelectedIndex() |
TitleBar |
getTitleBar() |
WorkspacePanel |
getWorkSpacePanel() |
WorkspacePanel |
getWp() |
void |
importSection(org.gcube.portlets.d4sreporting.common.shared.Model toLoad,
int sectionNoToimport,
int beforeSection,
boolean asLastSection)
Import a Section in the View and in the Model
|
void |
insertDoubleColumnItems(org.gcube.portlets.d4sreporting.common.client.uicomponents.ReportUIComponent leftItem,
org.gcube.portlets.d4sreporting.common.client.uicomponents.ReportUIComponent rightItem) |
void |
insertDroppingArea(org.gcube.portlets.d4sreporting.common.shared.ComponentType type,
int width,
int height) |
void |
insertGroup(org.gcube.portlets.d4sreporting.common.shared.ComponentType... types)
insert a repeatable sequence in the view and in the model
|
void |
insertPlaceHolder(org.gcube.portlets.d4sreporting.common.shared.ComponentType type,
int width,
int height) |
void |
insertStaticImage(Coords start,
int width,
int height,
ImageArea imgToPlace,
boolean isDoubleColLayout) |
void |
insertStaticTextArea(org.gcube.portlets.d4sreporting.common.shared.ComponentType type,
int width,
int height) |
void |
insertTable(org.gcube.portlets.d4sreporting.common.shared.ComponentType type,
int rows,
int cols) |
void |
lockComponent(com.google.gwt.user.client.ui.Widget toLock,
boolean locked) |
void |
moveWidget(com.google.gwt.user.client.ui.Widget toMove,
int left,
int top) |
void |
nextPageButtonClicked()
called when nextPage Button is Clicked
|
void |
openAttributeDialog(int width,
int height,
boolean useCheckBox) |
void |
openGroupingDialog()
allow to repeat a sequence of compoenents in the report
|
void |
openTemplate(String templateToOpen,
String TemplateObjectID)
load the template to edit in the MODEL and in the VIEW
|
void |
placeTemplatePageElements(int pageNo)
It places back the user added widgets (TemplateComponents) in the page
|
void |
prevPageButtonClicked()
called when prevPage Button is Clicked
|
boolean |
removeTemplateComponent(com.google.gwt.user.client.ui.Widget toRemove)
remove the user-added components both from UI and Model
|
void |
repositionModelComponents(com.google.gwt.user.client.ui.Widget toRepos,
int newX,
int newY) |
void |
resizeTemplateComponent(com.google.gwt.user.client.ui.Widget toResize,
int newWidth,
int newHeight)
Resize the template componet in the model and in the UI
|
void |
resizeTemplateComponentInModel(com.google.gwt.user.client.ui.Widget toResize,
int newWidth,
int newHeight)
Resize the template componet just the model
|
void |
resizeTemplateComponentInView(com.google.gwt.user.client.ui.Widget toResize,
int newWidth,
int newHeight)
Resize the template componet in the model and in the UI
|
void |
saveTemplate(String basketidToSaveIn)
Save the current Template
|
void |
seekLastPage()
in case someone inser a new section when not in the last page
|
void |
seekSection(int sect2Seek)
in case someone imported a new section
|
void |
setCurrCursorPos(int index) |
void |
setEditedOnBy(Date date,
String username) |
void |
setHeader(HeaderBar header) |
void |
setModel(TemplateModel templateModel) |
void |
setSelectedComponent(org.gcube.portlets.d4sreporting.common.client.uicomponents.ReportUIComponent selectedComponent)
set the selected compoenent
|
void |
setTitleBar(TitleBar titleBar) |
void |
setWp(WorkspacePanel wp) |
void |
showTablePopup(org.gcube.portlets.d4sreporting.common.shared.ComponentType type,
int width,
int height) |
void |
showToolbox() |
void |
storeChangeInSession(com.google.gwt.user.client.ui.Widget toChange) |
void |
updateWidgetIndicesInModel(com.google.gwt.user.client.ui.FlowPanel widgetContainer) |
public Presenter(TemplateModel model)
singleton
- . the singletonpublic void showToolbox()
public void addNewPage()
public void seekLastPage()
public void seekSection(int sect2Seek)
sect2Seek
- .public void addTextToolBar()
public void changeTemplateName(String newName)
newName
- .public TitleBar getTitleBar()
public void setTitleBar(TitleBar titleBar)
public void cleanAll()
public void cleanWorkspace()
public void discardCurrentSection()
public void enableTextToolBar(com.google.gwt.user.client.ui.RichTextArea d4sArea)
d4sArea
- the enabled text areapublic void importSection(org.gcube.portlets.d4sreporting.common.shared.Model toLoad, int sectionNoToimport, int beforeSection, boolean asLastSection)
toLoad
- the SerializableModel instance where toget the sectionsectionNoToimport
- section to import 0 -> n-1beforeSection
- say where to import this section (before)asLastSection
- say to import this section as last section in the curren template / reportpublic HeaderBar getHeader()
public TemplateModel getModel()
public WorkspacePanel getWp()
public void openGroupingDialog()
public void insertGroup(org.gcube.portlets.d4sreporting.common.shared.ComponentType... types)
types
- the sequence that was chosenpublic TemplateComponent getGroupInnerArea()
public TemplateComponent createDroppingArea(org.gcube.portlets.d4sreporting.common.shared.ComponentType type, int width, int height, boolean hideControls)
public void insertDroppingArea(org.gcube.portlets.d4sreporting.common.shared.ComponentType type, int width, int height)
type
- width
- height
- public TemplateComponent addPageBreak()
public TemplateComponent createStaticTextArea(org.gcube.portlets.d4sreporting.common.shared.ComponentType type, int width, int height, boolean hideControls)
start
- .x
- .y
- .public void insertStaticTextArea(org.gcube.portlets.d4sreporting.common.shared.ComponentType type, int width, int height)
public TemplateComponent createTable(org.gcube.portlets.d4sreporting.common.shared.ComponentType type, int rows, int cols, boolean hideControls)
type
- rows
- cols
- public void insertTable(org.gcube.portlets.d4sreporting.common.shared.ComponentType type, int rows, int cols)
start
- the coordinates x,y where to place the widgetwidth
- .height
- .imgToPlace
- .public TemplateComponent addCommentArea(int width, int height, boolean isGrouped)
width
- .height
- .public TemplateComponent addInstructionArea(int width, int height, boolean isGrouped)
width
- .height
- .public TemplateComponent createAttributArea(int width, int height, String name, String[] values, boolean useCheckBox, boolean displayBlock, boolean hideControls)
width
- .height
- .useCheckBox
- public void addAttributArea(int width, int height, String name, String[] values, boolean useCheckBox, boolean displayBlock)
width
- height
- name
- the attr namevalues
- the valuesuseCheckBox
- if true it will be a multi selection (checkbox), false a single selection (radiobox)displayBlock
- if true the items will be displayed as block, if false inlinepublic void openAttributeDialog(int width, int height, boolean useCheckBox)
useCheckBox
- public void updateWidgetIndicesInModel(com.google.gwt.user.client.ui.FlowPanel widgetContainer)
widgetContainer
- .public void insertStaticImage(Coords start, int width, int height, ImageArea imgToPlace, boolean isDoubleColLayout)
start
- the coordinates x,y where to place the widgetwidth
- .height
- .imgToPlace
- .public void insertPlaceHolder(org.gcube.portlets.d4sreporting.common.shared.ComponentType type, int width, int height)
start
- the coordinates x,y where to place the widgetwidth
- .height
- .imgToPlace
- .public void showTablePopup(org.gcube.portlets.d4sreporting.common.shared.ComponentType type, int width, int height)
type
- width
- height
- public int getSelectedIndex()
public void setCurrCursorPos(int index)
public Coords getInsertionPoint()
public com.google.gwt.user.client.ui.Widget addFakeTextArea(int y, boolean doubleInsterted)
public com.google.gwt.user.client.ui.Widget addGroupingStart(int y)
public void insertDoubleColumnItems(org.gcube.portlets.d4sreporting.common.client.uicomponents.ReportUIComponent leftItem, org.gcube.portlets.d4sreporting.common.client.uicomponents.ReportUIComponent rightItem)
leftItem
- rightItem
- public void moveWidget(com.google.gwt.user.client.ui.Widget toMove, int left, int top)
toMove
- .left
- .top
- .public void nextPageButtonClicked()
public void openTemplate(String templateToOpen, String TemplateObjectID)
templateToOpen
- the name of the template to open without extension nor pathpublic void placeTemplatePageElements(int pageNo)
pageNo
- . the page number of the wanted TemplateComponent(s)public void prevPageButtonClicked()
public boolean removeTemplateComponent(com.google.gwt.user.client.ui.Widget toRemove)
toRemove
- the widget to removepublic TemplateComponent checkIfDoubleColLayout(com.google.gwt.user.client.ui.Widget toRemove)
tc
- public void storeChangeInSession(com.google.gwt.user.client.ui.Widget toChange)
toChange
- .public void repositionModelComponents(com.google.gwt.user.client.ui.Widget toRepos, int newX, int newY)
toRepos
- .newX
- .newY
- .public void resizeTemplateComponent(com.google.gwt.user.client.ui.Widget toResize, int newWidth, int newHeight)
toResize
- .newWidth
- .newHeight
- .public void resizeTemplateComponentInView(com.google.gwt.user.client.ui.Widget toResize, int newWidth, int newHeight)
toResize
- .newWidth
- .newHeight
- .public void lockComponent(com.google.gwt.user.client.ui.Widget toLock, boolean locked)
toLock
- .locked
- .public void resizeTemplateComponentInModel(com.google.gwt.user.client.ui.Widget toResize, int newWidth, int newHeight)
toResize
- .newWidth
- .newHeight
- .public void saveTemplate(String basketidToSaveIn)
public void setHeader(HeaderBar header)
header
- .public void setModel(TemplateModel templateModel)
templateModel
- .public void setWp(WorkspacePanel wp)
wp
- .public String getCurrentScope()
public String getCurrentUser()
public WorkspacePanel getWorkSpacePanel()
public org.gcube.portlets.d4sreporting.common.client.uicomponents.richtext.RichTextToolbar getCurrentSelected()
public com.google.gwt.user.client.ui.RichTextArea getCurrentSelectedTextArea()
public org.gcube.portlets.d4sreporting.common.client.uicomponents.ReportUIComponent getSelectedComponent()
public void setSelectedComponent(org.gcube.portlets.d4sreporting.common.client.uicomponents.ReportUIComponent selectedComponent)
selectedComponent
- .Copyright © 2016. All Rights Reserved.