Search in sources :

Example 1 with UIAppGuard

use of com.twinsoft.convertigo.beans.ngx.components.UIAppGuard in project convertigo by convertigo.

the class NgxUIComponentTreeObject method setPropertyValue.

@Override
public void setPropertyValue(Object id, Object value) {
    DatabaseObject dbo = getObject();
    if (dbo instanceof UIDynamicElement) {
        IonBean ionBean = ((UIDynamicElement) dbo).getIonBean();
        if (ionBean != null) {
            if (ionBean.hasProperty((String) id)) {
                if (value != null) {
                    if (value instanceof String) {
                        value = new MobileSmartSourceType((String) value);
                    }
                    Object oldValue = ionBean.getPropertyValue((String) id);
                    if (!value.equals(oldValue)) {
                        ionBean.setPropertyValue((String) id, value);
                        TreeViewer viewer = (TreeViewer) getAdapter(TreeViewer.class);
                        hasBeenModified(true);
                        viewer.update(this, null);
                        TreeObjectEvent treeObjectEvent = new TreeObjectEvent(this, (String) id, oldValue, value);
                        ConvertigoPlugin.projectManager.getProjectExplorerView().fireTreeObjectPropertyChanged(treeObjectEvent);
                        return;
                    }
                }
            }
        }
    }
    if (dbo instanceof UIAppGuard) {
        UIAppGuard dboGuard = (UIAppGuard) dbo;
        if ("guardType".equals(id)) {
            String guardType = (String) value;
            if (!guardType.equals(dboGuard.getGuardType().name())) {
                if (dboGuard.getApplication().hasGuard(AppGuardType.valueOf(guardType))) {
                    return;
                }
            }
        }
    }
    super.setPropertyValue(id, value);
}
Also used : UIAppGuard(com.twinsoft.convertigo.beans.ngx.components.UIAppGuard) IonBean(com.twinsoft.convertigo.beans.ngx.components.dynamic.IonBean) MobileSmartSourceType(com.twinsoft.convertigo.beans.ngx.components.MobileSmartSourceType) TreeViewer(org.eclipse.jface.viewers.TreeViewer) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) UIDynamicElement(com.twinsoft.convertigo.beans.ngx.components.UIDynamicElement) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) TreeObjectEvent(com.twinsoft.convertigo.eclipse.views.projectexplorer.TreeObjectEvent)

Aggregations

DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)1 MobileSmartSourceType (com.twinsoft.convertigo.beans.ngx.components.MobileSmartSourceType)1 UIAppGuard (com.twinsoft.convertigo.beans.ngx.components.UIAppGuard)1 UIDynamicElement (com.twinsoft.convertigo.beans.ngx.components.UIDynamicElement)1 IonBean (com.twinsoft.convertigo.beans.ngx.components.dynamic.IonBean)1 TreeObjectEvent (com.twinsoft.convertigo.eclipse.views.projectexplorer.TreeObjectEvent)1 TreeViewer (org.eclipse.jface.viewers.TreeViewer)1