18 package com.generalrobotix.ui;
20 import java.awt.Dimension;
21 import java.util.Enumeration;
22 import java.util.List;
23 import java.util.Properties;
25 import org.eclipse.swt.SWT;
26 import org.eclipse.swt.custom.ScrolledComposite;
27 import org.eclipse.swt.widgets.Composite;
28 import org.w3c.dom.Element;
29 import org.w3c.dom.Node;
37 @SuppressWarnings(
"serial")
40 private static Dimension defaultButtonSize_ =
new Dimension(27, 27);
41 public boolean isScrollable_ =
true;
58 super(
name, manager_ );
62 scrollComposite_ =
new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
63 composite_ =
new Composite(scrollComposite_, SWT.NONE);
64 composite_.setLayout(parent.getLayout());
65 scrollComposite_.setExpandHorizontal(
true);
66 scrollComposite_.setExpandVertical(
true);
67 scrollComposite_.setContent(composite_);
106 scrollComposite_.setMinSize(composite_.computeSize(
width,
height));
114 return defaultButtonSize_;
116 public boolean cleanup(List<GrxBaseItem> itemList){
return true;}
155 Properties properties = manager_.getViewProperties(getName());
156 if(properties!=
null){
157 for (Enumeration<?> e = properties.propertyNames(); e.hasMoreElements(); ){
158 String key = (String) e.nextElement();
159 String
val = properties.getProperty(key);
160 if (!propertyChanged(key,
val)){
161 setProperty(key,
val);
171 String tag = VIEW_TAG;
172 element_ = doc_.createElement(tag);
174 element_.setAttribute(
"class",getClass().getName());
175 element_.setAttribute(
"name", getName());
176 element_.appendChild(doc_.createTextNode(
"\n"));
178 Enumeration<?> keys = propertyNames();
179 boolean hasProperty=
false;
180 while (keys.hasMoreElements()) {
181 String key = (String)keys.nextElement();
182 String
val = getProperty(key);
183 if (key ==
null ||
val ==
null || key.equals(
"name"))
188 propEl.setAttribute(
"name", key);
189 propEl.setAttribute(
"value",
val);
191 element_.appendChild(doc_.createTextNode(INDENT4+INDENT4+INDENT4));
192 element_.appendChild(propEl);
193 element_.appendChild(doc_.createTextNode(
"\n"));
195 element_.appendChild(doc_.createTextNode(INDENT4+INDENT4));