/** * Returns data object interface for specified data object. * DataObject must implement DataObjectInterface. * @param dataObject the data object * @return the data object interface */ public static DataObjectInterface getDataObjectInteface(DataObject dataObject) { if (!(dataObject instanceof DataObjectInterface)) { throw Debug.illegalArgument("DataObject does not implement DataObjectInterface", dataObject); // NOI18N } return (DataObjectInterface) dataObject; }
public static String generateTypeCode (DesignComponent component) { if (component == null) throw Debug.illegalArgument ("CodeReferencePresenter.generateTypeCode: null component"); // NOI18N CodeReferencePresenter presenter = component.getPresenter (CodeReferencePresenter.class); if (presenter == null) throw Debug.illegalArgument ("Missing CodeReferencePresenter for component", component); // NOI18N return presenter.generateTypeCode (); }
/** * This method allows to create all Custom Editor UI element at the moment when it is really need it. * In getCustomEditor method. To make this method work you need to also override * * @param type * @param newComponentAsText * @param noneComponentAsText * @param userCodeLabel * @param databinding */ private PropertyEditorResource(TypeID type, String newComponentAsText, String noneComponentAsText, String userCodeLabel, boolean databinding) { super(userCodeLabel); this.databinding = databinding; if (newComponentAsText == null || noneComponentAsText == null) { throw Debug.illegalArgument("Argument can not be null"); //NOI18N } if (newComponentAsText.equals(noneComponentAsText)) { throw Debug.illegalArgument("Arguments can not be equal"); //NOI18N } this.componentTypeID = type; this.newComponentAsText = newComponentAsText; this.noneComponentAsText = noneComponentAsText; createdComponents = new HashMap<String, DesignComponent>(); }
throw Debug.illegalArgument("Argument can not be null"); //NOI18N throw Debug.illegalArgument("Arguments can not be equal"); //NOI18N
/** * Returns a cloneable editor lookup for specified data object. * The CloneableEditorSupport has to be in data object lookup. * @param dataObject the data object * @return the cloneable editor support */ public static CloneableEditorSupport getCloneableEditorSupport(DataObject dataObject) { CloneableEditorSupport editorSupport = dataObject.getLookup().lookup(CloneableEditorSupport.class); if (editorSupport == null) { throw Debug.illegalArgument("Missing CloneableEditorSupport in DataObject lookup", dataObject); // NOI18N } return editorSupport; }
private PropertyEditorResource(PropertyEditorResourceElement perElement, String newComponentAsText, String noneComponentAsText, String userCodeLabel, boolean databinding) { super(userCodeLabel); this.databinding = databinding; if (newComponentAsText == null || noneComponentAsText == null) { throw Debug.illegalArgument("Argument can not be null"); //NOI18N } if (newComponentAsText.equals(noneComponentAsText)) { throw Debug.illegalArgument("Arguments can not be equal"); //NOI18N } this.componentTypeID = perElement.getTypeID(); this.newComponentAsText = newComponentAsText; this.noneComponentAsText = noneComponentAsText; this.perElement = perElement; perElement.setPropertyEditorMessageAwareness(this); createdComponents = new HashMap<String, DesignComponent>(); }
public static String generateDirectAccessCode (DesignComponent component) { if (component == null) return "null"; // NOI18N CodeReferencePresenter presenter = component.getPresenter (CodeReferencePresenter.class); if (presenter == null) throw Debug.illegalArgument ("Missing CodeReferencePresenter for component", component); // NOI18N return presenter.generateDirectAccessCode (); }
public static String generateAccessCode (DesignComponent component, String newName) { if (component == null) return "null"; // NOI18N CodeReferencePresenter presenter = component.getPresenter (CodeReferencePresenter.class); if (presenter == null) throw Debug.illegalArgument ("Missing CodeReferencePresenter for component", component); // NOI18N return presenter.generateAccessCode ( newName ); }
public static String generateAccessCode (DesignComponent component) { if (component == null) return "null"; // NOI18N CodeReferencePresenter presenter = component.getPresenter (CodeReferencePresenter.class); if (presenter == null) throw Debug.illegalArgument ("Missing CodeReferencePresenter for component", component); // NOI18N return presenter.generateAccessCode (); }