Delete Picture"

From Documentation
(1st Draft)
 
m (correct highlight (via JWB))
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
{{ZKSpreadsheetEssentialsPageHeader}}
 
{{ZKSpreadsheetEssentialsPageHeader}}
 +
 +
{{Deprecated|url=http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials}}
 +
 +
 
{{ZSS EE}}
 
{{ZSS EE}}
  
Line 8: Line 12:
  
 
===ZUML===
 
===ZUML===
<source lang="xml" high="6">
+
<source lang="xml" highlight="6">
 
<window vflex="1" width="100%"  
 
<window vflex="1" width="100%"  
 
apply="org.zkoss.zssessentials.config.DeletePictureComposer">
 
apply="org.zkoss.zssessentials.config.DeletePictureComposer">
Line 20: Line 24:
 
===Composer===
 
===Composer===
 
ZK Spreadsheet use <javadoc directory="zss" method="getPictures()">org.zkoss.zss.model.Worksheet</javadoc> to retrieve all pictures in the sheet.
 
ZK Spreadsheet use <javadoc directory="zss" method="getPictures()">org.zkoss.zss.model.Worksheet</javadoc> to retrieve all pictures in the sheet.
<source lang="java" high="7">
+
<source lang="java" highlight="7">
 
private Spreadsheet myss;
 
private Spreadsheet myss;
 
 

Latest revision as of 12:55, 19 January 2022


Stop.png This article is out of date, please refer to http://books.zkoss.org/wiki/ZK_Spreadsheet_Essentials for more up to date information.


Available in ZK Spreadsheet EE only

Purpose

ZK Spreadsheet uses Range.deletePicture (Picture) to delete a picture from the sheet.

ZUML

<window vflex="1" width="100%" 
	apply="org.zkoss.zssessentials.config.DeletePictureComposer">
    <spreadsheet id="myss" src="/WEB-INF/excel/config/DeletePicture.xlsx" maxrows="200"
        maxcolumns="40" vflex="1" width="100%">
    </spreadsheet>
    <button id="delete" label="Delete All Pictures"/>
</window>

Composer

ZK Spreadsheet use Worksheet.getPictures() to retrieve all pictures in the sheet.

	private Spreadsheet myss;
	
	public void onClick$delete(MouseEvent evt) throws Exception {
		//delete all picture
		Worksheet sheet = myss.getSelectedSheet();
		Range rng = Ranges.range(sheet);
		for(Picture pic : sheet.getPictures()) {
			rng.deletePicture(pic);
		}
	}

ZKSsEss Spreadsheet DeletePicture.png

View the complete source of ZUML deletePicture.zul

View the complete source of composer DeletePictureComposer.java

Version History

Last Update : 2022/01/19


Version Date Content
2.2.0 Nov. 10, 2011 API to delete a picture
     


All source code listed in this book is at Github.


Last Update : 2022/01/19

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.