BrightSide Workbench Full Report + Source Code
org.zkoss.zkmax.zul.Dropupload_6_5_2 Class Reference
Inheritance diagram for org.zkoss.zkmax.zul.Dropupload_6_5_2:
Collaboration diagram for org.zkoss.zkmax.zul.Dropupload_6_5_2:

Public Member Functions

 Dropupload_6_5_2 ()
 
void setMaxsize (int value)
 
int getMaxsize ()
 
void setDetection (String value)
 
String getDetection ()
 
void setViewerClass (String value)
 
String getViewerClass ()
 
void setContent (String value)
 
String getContent ()
 
void setNative (boolean value)
 
boolean isNative ()
 
void service (AuRequest request, boolean everError)
 

Protected Member Functions

void renderProperties (ContentRenderer renderer) throws java.io.IOException
 

Detailed Description

A component can handle drag files into it, and upload files to server.

Default getZclass(): z-dropupload.

known supported browser :

Chrome (v.19+) Firefox (v.13+) Safari (5.1+)

known unsupported browser :

IE9 Opera (11.x)

Since
6.5.0

Definition at line 50 of file Dropupload_6_5_2.java.

Constructor & Destructor Documentation

◆ Dropupload_6_5_2()

org.zkoss.zkmax.zul.Dropupload_6_5_2.Dropupload_6_5_2 ( )

Definition at line 63 of file Dropupload_6_5_2.java.

63 {}

Member Function Documentation

◆ getContent()

String org.zkoss.zkmax.zul.Dropupload_6_5_2.getContent ( )
Returns
content of component.

Definition at line 154 of file Dropupload_6_5_2.java.

154  {
155  return _content;
156  }

◆ getDetection()

String org.zkoss.zkmax.zul.Dropupload_6_5_2.getDetection ( )

Return the detection area setting. Refer to setDetection(String) for more details.

Definition at line 113 of file Dropupload_6_5_2.java.

113  {
114  return _detection;
115  }

◆ getMaxsize()

int org.zkoss.zkmax.zul.Dropupload_6_5_2.getMaxsize ( )

Get the max size setting of upload file, unit is "KB". Refer to setMaxsize(int) for more details.

Definition at line 86 of file Dropupload_6_5_2.java.

86  {
87  return _maxsize;
88  }

◆ getViewerClass()

String org.zkoss.zkmax.zul.Dropupload_6_5_2.getViewerClass ( )
Returns
custom upload viewer class name.

Definition at line 135 of file Dropupload_6_5_2.java.

135  {
136  return _viewerClass;
137  }

◆ isNative()

boolean org.zkoss.zkmax.zul.Dropupload_6_5_2.isNative ( )

Definition at line 165 of file Dropupload_6_5_2.java.

165  {
166  return _native;
167  }

◆ renderProperties()

void org.zkoss.zkmax.zul.Dropupload_6_5_2.renderProperties ( ContentRenderer  renderer) throws java.io.IOException
protected

Definition at line 170 of file Dropupload_6_5_2.java.

171  {
172  if (_maxsize == 0) { // not assign maxsize, get the default setting.
173  _maxsize = this.getDesktop().getWebApp().getConfiguration().getMaxUploadSize();
174  }
175 
176  super.renderProperties(renderer);
177  if (!Objects.equals(_detection, DEFAULT_DETECTION)) {
178  render(renderer, "detection", _detection);
179  }
180  render(renderer, "maxsize", _maxsize);
181  render(renderer, "viewerClass", _viewerClass);
182  render(renderer, "content", _content);
183  render(renderer, "native", _native);
184  }

◆ service()

void org.zkoss.zkmax.zul.Dropupload_6_5_2.service ( AuRequest  request,
boolean  everError 
)

Process an AU request. It will handle Events#ON_UPLOAD and post UploadEvent.

See also
org.zkoss.zk.ui.HtmlBasedComponent::service(org.zkoss.zk.au.AuRequest, boolean)

Definition at line 191 of file Dropupload_6_5_2.java.

191  {
192  final String cmd = request.getCommand();
193  if (Events.ON_UPLOAD.equals(cmd)) {
194  Desktop desktop = getDesktop();
195  final List<Media> result = cast((List) desktop.getAttribute(this.getUuid()));
196  desktop.removeAttribute(this.getUuid());
197  Event event = new UploadEvent(
198  Events.ON_UPLOAD,
199  desktop.getComponentByUuid(this.getUuid()), parseResult(result)
200  );
201  Events.postEvent(event);
202  } else {
203  super.service(request, everError);
204  }
205  }

◆ setContent()

void org.zkoss.zkmax.zul.Dropupload_6_5_2.setContent ( String  value)

Set the content of component, it will be shown depend on detection setting.

See also
setDetection(String)
Parameters
valueHTML string.

Definition at line 144 of file Dropupload_6_5_2.java.

144  {
145  if (value != null && !value.equals(_content)) {
146  _content = value;
147  smartUpdate("content", _content);
148  }
149  }

◆ setDetection()

void org.zkoss.zkmax.zul.Dropupload_6_5_2.setDetection ( String  value)

Set drag detection area. When mouse drag over the detection area, it will show content. There are four accept value :

  1. browser : whole browser, default value.
  2. none : disable detection.
  3. self : the Dropupload_6_5_2 itself.
  4. $id : the id value of specified widget. If specified widget is not exist, will use default setting.

Notice : The Dropupload_6_5_2 with detection="browser" setting can't put together with other Dropupload_6_5_2 that detection is not browser. If do so, the user can't drop file on it.

Parameters
value

Definition at line 103 of file Dropupload_6_5_2.java.

103  {
104  if (!_detection.equals(value)) {
105  _detection = value;
106  smartUpdate("detection", _detection);
107  }
108  }

◆ setMaxsize()

void org.zkoss.zkmax.zul.Dropupload_6_5_2.setMaxsize ( int  value)

Set the max size of upload file, unit is "KB". Notice: All the files in one drag-and-drop action must smaller than max size, or nothing will upload.

Parameters
valuenegative value is unlimited, 0 will use Configuration#getMaxUploadSize()

Definition at line 71 of file Dropupload_6_5_2.java.

71  {
72  if (value < 0) {
73  value = -1;
74  }
75 
76  if (_maxsize != value) {
77  _maxsize = value;
78  smartUpdate("maxsize", _maxsize);
79  }
80  }

◆ setNative()

void org.zkoss.zkmax.zul.Dropupload_6_5_2.setNative ( boolean  value)

Definition at line 158 of file Dropupload_6_5_2.java.

158  {
159  if (value != _native) {
160  _native = value;
161  smartUpdate("native", _native);
162  }
163  }

◆ setViewerClass()

void org.zkoss.zkmax.zul.Dropupload_6_5_2.setViewerClass ( String  value)

Set the custom upload viewer class name, if was not specified, will use ZK default upload viewer.

Parameters
valuecustom upload viewer class name.

Definition at line 121 of file Dropupload_6_5_2.java.

121  {
122  if (value != null && value.length() == 0) {
123  value = null;
124  }
125 
126  if (!Objects.equals(_viewerClass, value)) {
127  _viewerClass = value;
128  smartUpdate("viewerClass", _viewerClass);
129  }
130  }

The documentation for this class was generated from the following file: