--- /dev/null
+package com.itmill.toolkit.tests.tickets;\r
+\r
+import com.itmill.toolkit.Application;\r
+import com.itmill.toolkit.ui.CustomLayout;\r
+import com.itmill.toolkit.ui.Window;\r
+\r
+public class Ticket2022 extends Application {\r
+\r
+ public void init() {\r
+ Window w = new Window(getClass().getSimpleName());\r
+ setMainWindow(w);\r
+ setTheme("tests-tickets");\r
+ CustomLayout l;\r
+\r
+ // WebApplicationContext wac = ((WebApplicationContext) getContext());\r
+ // File f = new File(wac.getBaseDirectory().getAbsoluteFile()\r
+ // + "/ITMILL/themes/" + getTheme() + "/layouts/Ticket2022.html");\r
+\r
+ l = new CustomLayout("Ticket2022");\r
+ // try {\r
+ // l = new CustomLayout(new FileInputStream(f));\r
+ w.setLayout(l);\r
+ // } catch (FileNotFoundException e) {\r
+ // // TODO Auto-generated catch block\r
+ // e.printStackTrace();\r
+ // } catch (IOException e) {\r
+ // // TODO Auto-generated catch block\r
+ // e.printStackTrace();\r
+ // }\r
+ }\r
+}\r
* Constructs a custom layout with the template given in the stream.
*
* @param templateStream
- * Stream containing template data. Must be using UTF-8
- * encoding. To use a String as a template use for instance
- * new ByteArrayInputStream("<template>".getBytes()).
+ * Stream containing template data. Must be using UTF-8 encoding.
+ * To use a String as a template use for instance new
+ * ByteArrayInputStream("<template>".getBytes()).
* @param streamLength
- * Length of the templateStream
+ * Length of the templateStream
* @throws IOException
*/
public CustomLayout(InputStream templateStream) throws IOException {
- InputStreamReader reader = new InputStreamReader(templateStream);
+ InputStreamReader reader = new InputStreamReader(templateStream,
+ "UTF-8");
StringBuffer b = new StringBuffer(BUFFER_SIZE);
char[] cbuf = new char[BUFFER_SIZE];
* is already populated, the old component is removed.
*
* @param c
- * the component to be added.
+ * the component to be added.
* @param location
- * the location of the component.
+ * the location of the component.
*/
public void addComponent(Component c, String location) {
final Component old = (Component) slots.get(location);
* components into that location overwrites the old components.
*
* @param c
- * the component to be added.
+ * the component to be added.
*/
public void addComponent(Component c) {
this.addComponent(c, "");
* Removes the component from this container.
*
* @param c
- * the component to be removed.
+ * the component to be removed.
*/
public void removeComponent(Component c) {
if (c == null) {
* Removes the component from this container from given location.
*
* @param location
- * the Location identifier of the component.
+ * the Location identifier of the component.
*/
public void removeComponent(String location) {
this.removeComponent((Component) slots.get(location));
* Gets the child-component by its location.
*
* @param location
- * the name of the location where the requested component
- * resides.
+ * the name of the location where the requested component
+ * resides.
* @return the Component in the given location or null if not found.
*/
public Component getComponent(String location) {
*
* @param target
* @throws PaintException
- * if the paint operation failed.
+ * if the paint operation failed.
*/
public void paintContent(PaintTarget target) throws PaintException {
super.paintContent(target);
* setStyle. Overriding to improve backwards compatibility.
*
* @param name
- * template name
+ * template name
*/
public void setStyle(String name) {
setTemplateName(name);