Context Menu"
m |
m |
||
Line 15: | Line 15: | ||
[[File:ZKSsEss_Spreadsheet_Toolbar_rowContextMenu.png]] | [[File:ZKSsEss_Spreadsheet_Toolbar_rowContextMenu.png]] | ||
− | Row context menu | + | Row context menu use [http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials/Working_with_ZK_Spreadsheet/Configure_and_Control_ZK_Spreadsheet/Toolbar#Action_Handler ActionHandler] for each button/menuitem. Note the default ActionHandler does nothing when user click '''Paste Special''', '''Format Cell''' and '''Row Height''' |
=====Paste Special===== | =====Paste Special===== | ||
Line 58: | Line 58: | ||
[[File:ZKSsEss_Spreadsheet_Toolbar_columnContextMenu.png]] | [[File:ZKSsEss_Spreadsheet_Toolbar_columnContextMenu.png]] | ||
+ | |||
+ | Column context menu use [http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials/Working_with_ZK_Spreadsheet/Configure_and_Control_ZK_Spreadsheet/Toolbar#Action_Handler ActionHandler] for each button/menuitem. Note the default ActionHandler does nothing when user click '''Paste Special''', '''Format Cell''' and '''Column Width''' | ||
=====Paste Special===== | =====Paste Special===== | ||
Refer to [http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials/Working_with_ZK_Spreadsheet/Configure_and_Control_ZK_Spreadsheet/Toolbar#Paste_Special here] | Refer to [http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials/Working_with_ZK_Spreadsheet/Configure_and_Control_ZK_Spreadsheet/Toolbar#Paste_Special here] | ||
=====Format Cell===== | =====Format Cell===== | ||
− | Refer to [http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials/Working_with_ZK_Spreadsheet/Configure_and_Control_ZK_Spreadsheet/Context_Menu#Format_Cell | + | Refer to [http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials/Working_with_ZK_Spreadsheet/Configure_and_Control_ZK_Spreadsheet/Context_Menu#Format_Cell here] |
=====Column Width===== | =====Column Width===== | ||
Line 84: | Line 86: | ||
[[File:ZKSsEss_Spreadsheet_Toolbar_cellContextMenu.png]] | [[File:ZKSsEss_Spreadsheet_Toolbar_cellContextMenu.png]] | ||
+ | |||
+ | Cell context menu use [http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials/Working_with_ZK_Spreadsheet/Configure_and_Control_ZK_Spreadsheet/Toolbar#Action_Handler ActionHandler] for each button/menuitem. Note the default ActionHandler does nothing when user click '''Paste Special''', '''Format Cell''' and '''Hyperlink''' | ||
+ | |||
=====Paste Special===== | =====Paste Special===== | ||
+ | Refer to [http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials/Working_with_ZK_Spreadsheet/Configure_and_Control_ZK_Spreadsheet/Toolbar#Paste_Special here] | ||
=====Format Cell===== | =====Format Cell===== | ||
+ | Refer to [http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials/Working_with_ZK_Spreadsheet/Configure_and_Control_ZK_Spreadsheet/Context_Menu#Format_Cell here] | ||
=====Hyperlink===== | =====Hyperlink===== | ||
+ | Refer to [http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials/Working_with_ZK_Spreadsheet/Configure_and_Control_ZK_Spreadsheet/Toolbar#Hyperlink here] | ||
===ZUML=== | ===ZUML=== |
Revision as of 01:43, 5 April 2012
Purpose
ZK Spreadsheet supports various context menu for user to perform actions.
Show Context Menu
Use Spreadsheet.setShowContextMenu to show context menu.
Row
Row context menu use ActionHandler for each button/menuitem. Note the default ActionHandler does nothing when user click Paste Special, Format Cell and Row Height
Paste Special
Refer to here
Format Cell
File:ZKSsEss Spreadsheet Toolbar rowContextMenu formatCell.png
The default ActionHandler does nothing when user click the button, developer could override ActionHandler.doFormatCell
@Override
public void doFormatCell(Rect selection) {
Spreadsheet spreadsheet = getSpreadsheet();
if (spreadsheet.getBook() != null && validSelection(selection)) {
FormatDialog dialog = new FormatDialog(selection);
//omit
}
}
Refer to sample code formatDialog.zul and CustomizedActionHandler.java
Row Height
File:ZKSsEss Spreadsheet Toolbar rowContextMenu rowHeight.png
The default ActionHandler does nothing when user click the button, developer could override ActionHandler.doRowHeight
@Override
public void doRowHeight(Rect selection) {
Spreadsheet spreadsheet = getSpreadsheet();
if (spreadsheet.getBook() != null && validSelection(selection)) {
HeaderSizeDialog dialog = new HeaderSizeDialog("row", selection);
//omit
}
}
Refer to sample code headerSizeDialog.zul and CustomizedActionHandler.java
Column
Column context menu use ActionHandler for each button/menuitem. Note the default ActionHandler does nothing when user click Paste Special, Format Cell and Column Width
Paste Special
Refer to here
Format Cell
Refer to here
Column Width
File:ZKSsEss Spreadsheet Toolbar rowContextMenu columnWidth.png
The default ActionHandler does nothing when user click the button, developer could override ActionHandler.doColumnWidth
@Override
public void doColumnWidth(Rect selection) {
Spreadsheet spreadsheet = getSpreadsheet();
if (spreadsheet.getBook() != null && validSelection(selection)) {
HeaderSizeDialog dialog = new HeaderSizeDialog("column", selection);
//omit
}
}
Refer to sample code headerSizeDialog.zul and CustomizedActionHandler.java
Cell
Cell context menu use ActionHandler for each button/menuitem. Note the default ActionHandler does nothing when user click Paste Special, Format Cell and Hyperlink
Paste Special
Refer to here
Format Cell
Refer to here
Hyperlink
Refer to here
ZUML
Here is a sample example ZUL file
<zk>
<window vflex="1" width="100%" apply="org.zkoss.zssessentials.config.ContextMenuComposer">
<button id="toggleContextMenu" label="Toggle Context Menu"/>
<spreadsheet showContextMenu="true"
id="ss" vflex="true" width="100%"
src="/WEB-INF/excel/config/ZSS-demo_sample.xlsx" maxcolumns="40" maxrows="200"
></spreadsheet>
</window>
</zk>
Version History
Version | Date | Content |
---|---|---|
2.3.0 | April, 2012 | Context Menu |
All source code listed in this book is at Github.