|
|
@ -1,6 +1,7 @@ |
|
|
|
package com.fr.design.designer.properties.mobile; |
|
|
|
package com.fr.design.designer.properties.mobile; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.FRContext; |
|
|
|
import com.fr.base.FRContext; |
|
|
|
|
|
|
|
import com.fr.design.designer.beans.events.DesignerEvent; |
|
|
|
import com.fr.design.designer.creator.CRPropertyDescriptor; |
|
|
|
import com.fr.design.designer.creator.CRPropertyDescriptor; |
|
|
|
import com.fr.design.designer.creator.XCreator; |
|
|
|
import com.fr.design.designer.creator.XCreator; |
|
|
|
import com.fr.design.form.util.XCreatorConstants; |
|
|
|
import com.fr.design.form.util.XCreatorConstants; |
|
|
@ -9,11 +10,15 @@ import com.fr.design.gui.itable.PropertyGroup; |
|
|
|
import com.fr.design.gui.xtable.PropertyGroupModel; |
|
|
|
import com.fr.design.gui.xtable.PropertyGroupModel; |
|
|
|
import com.fr.design.mainframe.FormDesigner; |
|
|
|
import com.fr.design.mainframe.FormDesigner; |
|
|
|
import com.fr.design.mainframe.WidgetPropertyPane; |
|
|
|
import com.fr.design.mainframe.WidgetPropertyPane; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.widget.editors.DoubleEditor; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.widget.editors.InChangeBooleanEditor; |
|
|
|
|
|
|
|
import com.fr.form.ui.ElementCaseEditor; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.Inter; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.table.TableModel; |
|
|
|
import javax.swing.table.TableModel; |
|
|
|
import java.beans.IntrospectionException; |
|
|
|
import java.beans.IntrospectionException; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Created by Administrator on 2016/5/16/0016. |
|
|
|
* Created by Administrator on 2016/5/16/0016. |
|
|
@ -27,14 +32,17 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{ |
|
|
|
this.xCreator = xCreator; |
|
|
|
this.xCreator = xCreator; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { |
|
|
|
public void initPropertyGroups(Object source) { |
|
|
|
if (((ElementCaseEditor ) xCreator.toData()).getVerticalAttr().getState() == 2 && !((ElementCaseEditor ) xCreator.toData()).isHeightRestrict()) { |
|
|
|
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); |
|
|
|
((ElementCaseEditor ) xCreator.toData()).setHeightRestrict(true); |
|
|
|
|
|
|
|
return revealHeightLimit(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
CRPropertyDescriptor[] crp = ((ElementCaseEditor) xCreator.toData()).isHeightRestrict() ? revealHeightLimit() : getDefault(); |
|
|
|
|
|
|
|
return crp; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
groups = new ArrayList<PropertyGroup>(); |
|
|
|
protected List<CRPropertyDescriptor> createNonListenerProperties() throws IntrospectionException { |
|
|
|
CRPropertyDescriptor[] propertyTableEditor = null; |
|
|
|
CRPropertyDescriptor[] propertyTableEditor = { |
|
|
|
try { |
|
|
|
|
|
|
|
propertyTableEditor = new CRPropertyDescriptor[]{ |
|
|
|
|
|
|
|
new CRPropertyDescriptor("horziontalAttr", this.xCreator.toData().getClass()).setEditorClass(MobileFitEditor.class) |
|
|
|
new CRPropertyDescriptor("horziontalAttr", this.xCreator.toData().getClass()).setEditorClass(MobileFitEditor.class) |
|
|
|
.setRendererClass(MobileFitRender.class) |
|
|
|
.setRendererClass(MobileFitRender.class) |
|
|
|
.setI18NName(Inter.getLocText("FR-Designer_Mobile-Horizontal")) |
|
|
|
.setI18NName(Inter.getLocText("FR-Designer_Mobile-Horizontal")) |
|
|
@ -42,9 +50,42 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{ |
|
|
|
new CRPropertyDescriptor("verticalAttr", this.xCreator.toData().getClass()).setEditorClass(MobileFitEditor.class) |
|
|
|
new CRPropertyDescriptor("verticalAttr", this.xCreator.toData().getClass()).setEditorClass(MobileFitEditor.class) |
|
|
|
.setRendererClass(MobileFitRender.class) |
|
|
|
.setRendererClass(MobileFitRender.class) |
|
|
|
.setI18NName(Inter.getLocText("FR-Designer_Mobile-Vertical")) |
|
|
|
.setI18NName(Inter.getLocText("FR-Designer_Mobile-Vertical")) |
|
|
|
|
|
|
|
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App")), |
|
|
|
|
|
|
|
new CRPropertyDescriptor("heightRestrict", this.xCreator.toData().getClass()).setEditorClass(InChangeBooleanEditor.class) |
|
|
|
|
|
|
|
.setI18NName(Inter.getLocText("Form-EC_heightrestrict")) |
|
|
|
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App")) |
|
|
|
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App")) |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
List<CRPropertyDescriptor> defaultList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (CRPropertyDescriptor propertyDescriptor: propertyTableEditor) { |
|
|
|
|
|
|
|
defaultList.add(propertyDescriptor); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return defaultList; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected CRPropertyDescriptor[] revealHeightLimit() throws IntrospectionException { |
|
|
|
|
|
|
|
CRPropertyDescriptor heightLimitProperty = new CRPropertyDescriptor("heightPercent", this.xCreator.toData().getClass()) |
|
|
|
|
|
|
|
.setEditorClass(DoubleEditor.class) |
|
|
|
|
|
|
|
.setI18NName(Inter.getLocText("Form-EC_heightpercent")) |
|
|
|
|
|
|
|
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"); |
|
|
|
|
|
|
|
ArrayList<CRPropertyDescriptor> defaultList = (ArrayList<CRPropertyDescriptor>) createNonListenerProperties(); |
|
|
|
|
|
|
|
defaultList.add(heightLimitProperty); |
|
|
|
|
|
|
|
return defaultList.toArray(new CRPropertyDescriptor[defaultList.size()]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected CRPropertyDescriptor[] getDefault() throws IntrospectionException { |
|
|
|
|
|
|
|
ArrayList<CRPropertyDescriptor> defaultList = (ArrayList<CRPropertyDescriptor>) createNonListenerProperties(); |
|
|
|
|
|
|
|
return defaultList.toArray(new CRPropertyDescriptor[defaultList.size()]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void initPropertyGroups(Object source) { |
|
|
|
|
|
|
|
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
groups = new ArrayList<PropertyGroup>(); |
|
|
|
|
|
|
|
CRPropertyDescriptor[] propertyTableEditor = null; |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
propertyTableEditor = supportedDescriptor(); |
|
|
|
} catch (IntrospectionException e) { |
|
|
|
} catch (IntrospectionException e) { |
|
|
|
FRContext.getLogger().error(e.getMessage()); |
|
|
|
FRContext.getLogger().error(e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
@ -59,6 +100,7 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{ |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void firePropertyEdit() { |
|
|
|
public void firePropertyEdit() { |
|
|
|
|
|
|
|
designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_EDITED); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void populate(FormDesigner designer) { |
|
|
|
public void populate(FormDesigner designer) { |
|
|
|