/** * Create the object. * * @exception IOException if something fails */ public void create() throws IOException { RADMenuItemComponent newSeparatorComp = new RADMenuItemComponent(); newSeparatorComp.initialize(getFormManager()); if ((getMenuItemType() == T_MENU) || (getMenuItemType() == T_POPUPMENU)) { newSeparatorComp.setComponent(org.netbeans.modules.form.Separator.class); } else { newSeparatorComp.setComponent(JSeparator.class); } getFormManager().addNonVisualComponent(newSeparatorComp, RADMenuComponent.this); // XXX(-tdt) addVisualMenu (newSeparatorComp); getFormManager().selectComponent(newSeparatorComp, false); return; }
/** * Create the object. * * @exception IOException if something fails */ public void create() throws IOException { RADMenuItemComponent newMenuComp; if ((RADMenuItemComponent.recognizeType(item) & MASK_CONTAINER) == 0) { newMenuComp = new RADMenuItemComponent(); } else { newMenuComp = new RADMenuComponent(); } newMenuComp.initialize(RADMenuComponent.this.getFormManager()); newMenuComp.setComponent(item); if (newMenuComp instanceof RADMenuComponent) { ((RADMenuComponent) newMenuComp).initSubComponents(new RADComponent[0]); } RADMenuComponent.this .getFormManager() .addNonVisualComponent(newMenuComp, RADMenuComponent.this); // for some components, we initialize their properties with some non-default values // e.g. a label on buttons, checkboxes FormEditor.defaultMenuInit(newMenuComp); addVisualMenu(newMenuComp); RADMenuComponent.this.getFormManager().selectComponent(newMenuComp, false); }