136137138139140141142143144145146
rootNode = (TreeItem) widget; rootNode.setTree(this); tree.setModel(new DefaultTreeModel(rootNode, false)); addChild(rootNode); } else { throw new GUIException("A Tree can only have one root node"); } } else { throw new GUIException("Only TreeItem children are supported"); } }
6061626364656667686970
panel.setBorder(GROUP_BORDER); } public void addChild(Widget widget, Object constraint) throws GUIException { if (constraint != null) throw new GUIException("Constraints not supported inside a group"); addChild(widget); if (widget instanceof Button) buttons.add(widget); else widgets.add(widget);
121122123124125126127128
addChild(widget); } finally { sendEvents = true; } } else { throw new GUIException("Only Item children are allowed inside an IconView"); } }
130131132133134135136137
public void removeChildWidget(Widget widget) throws GUIException { if (listDataModel != null) { listDataModel.removeValue(this, widget); super.removeChildWidget(widget); } else { throw new GUIException("There are no static items to remove"); } }
31323334353637
private WizardPageAdapter adapter = null; public WizardPage(Widget parent, String name) throws GUIException { super(parent, name); if (name == null) throw new GUIException("WizardPage widgets need to have a name"); }
6061626364656667
if (widget instanceof TreeItem) { TreeItem treeItem = (TreeItem) widget; treeItem.setTree(tree); addChild(widget); } else { throw new GUIException("Only TreeItem children are supported"); } }
108109110111112113114115
try { Class lnfClass = Class.forName(clazz); LookAndFeel lnfInstance = (LookAndFeel) lnfClass.newInstance(); return lnfInstance; } catch (Exception e) { throw new GUIException("Error while creating Look And Feel", e); } }
127128129130131132133134
MetalLookAndFeel lnf = (MetalLookAndFeel) super.create(themeClass, licenseCode); try { MetalLookAndFeel.setCurrentTheme((MetalTheme) Class.forName(themeClass).newInstance()); return lnf; } catch (Exception e) { throw new GUIException("Error while setting theme", e); } }
162163164165166167168169
LookAndFeel lnfInstance = (LookAndFeel) constructor.newInstance(new Object[] { Class.forName(themeClass).newInstance()}); return lnfInstance; } catch (Exception e) { throw new GUIException("Error while setting theme", e); } }
135136137138139140141142
File file = DialogUtils.showSaveFileDialog(frame, "properties"); if (file != null) { properties.store(new FileOutputStream(file), "Internationalization file created using the Builder"); } } catch (Exception e) { throw new GUIException("Error while saving file", e); } }