Initial commit from SVN.
19
Foundation Widget Test Application/.classpath
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Foundation Builder"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Common"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Foundation"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Foundation SWT"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Foundation TCV"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Foundation TCV Client"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Foundation TCV Server"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Foundation TCV SWT"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Foundation TCV SWT Client"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Foundation TCV SWT Server"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Class File Services"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Orb"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/SWT"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
33
Foundation Widget Test Application/.project
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Foundation Widget Test Application</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.declarativeengineering.jetson.vmlBuilderId</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.declarativeengineering.jetson.resourceBuilderId</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.declarativeengineering.jetson.htmlBuilderId</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>com.declarativeengineering.jetson.jefNatureId</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
17
Foundation Widget Test Application/Package Test App.launch
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
|
||||
<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.ant.uiSET_INPUTHANDLER" value="false"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/Foundation Widget Test Application/package.xml"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Foundation Widget Test Application"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/Foundation Widget Test Application/package.xml}"/>
|
||||
<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
|
||||
</launchConfiguration>
|
||||
BIN
Foundation Widget Test Application/bold.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
Foundation Widget Test Application/eclipse.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
Foundation Widget Test Application/empty.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
Foundation Widget Test Application/icons/Accept.png
Normal file
|
After Width: | Height: | Size: 448 B |
270
Foundation Widget Test Application/icons/Accept.svg
Normal file
@@ -0,0 +1,270 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://web.resource.org/cc/"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="744.09448819"
|
||||
height="1052.3622047"
|
||||
id="svg1468"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.43"
|
||||
sodipodi:docbase="C:\Data\workspace\Widget Test Application\icons"
|
||||
sodipodi:docname="Accept.svg">
|
||||
<defs
|
||||
id="defs1470">
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5060"
|
||||
id="radialGradient6719"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-2.774389,0,0,1.969706,112.7623,-872.8854)"
|
||||
cx="605.71429"
|
||||
cy="486.64789"
|
||||
fx="605.71429"
|
||||
fy="486.64789"
|
||||
r="117.14286" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient5060">
|
||||
<stop
|
||||
style="stop-color:black;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5062" />
|
||||
<stop
|
||||
style="stop-color:black;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop5064" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5060"
|
||||
id="radialGradient6717"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(2.774389,0,0,1.969706,-1891.633,-872.8854)"
|
||||
cx="605.71429"
|
||||
cy="486.64789"
|
||||
fx="605.71429"
|
||||
fy="486.64789"
|
||||
r="117.14286" />
|
||||
<linearGradient
|
||||
id="linearGradient5048">
|
||||
<stop
|
||||
style="stop-color:black;stop-opacity:0;"
|
||||
offset="0"
|
||||
id="stop5050" />
|
||||
<stop
|
||||
id="stop5056"
|
||||
offset="0.5"
|
||||
style="stop-color:black;stop-opacity:1;" />
|
||||
<stop
|
||||
style="stop-color:black;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop5052" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5048"
|
||||
id="linearGradient6715"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(2.774389,0,0,1.969706,-1892.179,-872.8854)"
|
||||
x1="302.85715"
|
||||
y1="366.64789"
|
||||
x2="302.85715"
|
||||
y2="609.50507" />
|
||||
<linearGradient
|
||||
style="stroke-dasharray:none;stroke-miterlimit:4.0000000;stroke-width:1.2166667"
|
||||
y2="36.0328"
|
||||
x2="31.0813"
|
||||
y1="3.7319"
|
||||
x1="12.4873"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="aigrd1">
|
||||
<stop
|
||||
id="stop16177"
|
||||
style="stop-color:#D2D2D2;stroke-dasharray:none;stroke-miterlimit:4.0000000;stroke-width:1.2166667"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop16179"
|
||||
style="stop-color:#EDEDED;stroke-dasharray:none;stroke-miterlimit:4.0000000;stroke-width:1.2166667"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#aigrd1"
|
||||
id="linearGradient16280"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="12.4873"
|
||||
y1="3.7319"
|
||||
x2="31.0813"
|
||||
y2="36.0328"
|
||||
gradientTransform="matrix(1.22507,0,0,1.216394,312.8178,503.0902)" />
|
||||
<linearGradient
|
||||
id="linearGradient3563">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3565" />
|
||||
<stop
|
||||
style="stop-color:#939393;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3567" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3563"
|
||||
id="linearGradient3569"
|
||||
x1="28.107494"
|
||||
y1="34.868584"
|
||||
x2="22.169001"
|
||||
y2="9.8661737"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1.004226,0,0,0.9999,315.0749,504.131)" />
|
||||
<linearGradient
|
||||
id="linearGradient3555">
|
||||
<stop
|
||||
style="stop-color:#f2f2f2;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3557" />
|
||||
<stop
|
||||
style="stop-color:#d0d0d0;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3559" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3555"
|
||||
id="radialGradient3561"
|
||||
cx="26.728037"
|
||||
cy="38.34853"
|
||||
fx="26.728037"
|
||||
fy="38.34853"
|
||||
r="17.926361"
|
||||
gradientTransform="matrix(1.856313,-1.546947e-23,1.233115e-24,1.288949,293.6856,489.5668)"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="0"
|
||||
inkscape:zoom="8"
|
||||
inkscape:cx="350"
|
||||
inkscape:cy="525.10263"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
inkscape:window-width="1098"
|
||||
inkscape:window-height="745"
|
||||
inkscape:window-x="636"
|
||||
inkscape:window-y="139" />
|
||||
<metadata
|
||||
id="metadata1473">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<g
|
||||
style="display:inline"
|
||||
transform="matrix(2.367169e-2,0,0,2.086758e-2,360.3044,543.1408)"
|
||||
id="g6707"
|
||||
inkscape:export-filename="C:\Data\workspace\Widget Test Application\icons\Accept.png"
|
||||
inkscape:export-xdpi="89.880508"
|
||||
inkscape:export-ydpi="89.880508">
|
||||
<rect
|
||||
style="opacity:0.40206185;color:#000000;fill:url(#linearGradient6715);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||
id="rect6709"
|
||||
width="1339.6335"
|
||||
height="478.35718"
|
||||
x="-1559.2523"
|
||||
y="-150.69685" />
|
||||
<path
|
||||
style="opacity:0.40206185;color:#000000;fill:url(#radialGradient6717);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||
d="M -219.61876,-150.68038 C -219.61876,-150.68038 -219.61876,327.65041 -219.61876,327.65041 C -76.744594,328.55086 125.78146,220.48075 125.78138,88.454235 C 125.78138,-43.572302 -33.655436,-150.68036 -219.61876,-150.68038 z "
|
||||
id="path6711"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
<path
|
||||
sodipodi:nodetypes="cccc"
|
||||
id="path6713"
|
||||
d="M -1559.2523,-150.68038 C -1559.2523,-150.68038 -1559.2523,327.65041 -1559.2523,327.65041 C -1702.1265,328.55086 -1904.6525,220.48075 -1904.6525,88.454235 C -1904.6525,-43.572302 -1745.2157,-150.68036 -1559.2523,-150.68038 z "
|
||||
style="opacity:0.40206185;color:#000000;fill:url(#radialGradient6719);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" />
|
||||
</g>
|
||||
<path
|
||||
id="path16181"
|
||||
d="M 360.7181,542.96857 C 360.7181,544.91481 359.12551,546.49612 357.1654,546.49612 L 321.27081,546.49612 C 319.31069,546.49612 317.7181,544.91481 317.7181,542.96857 L 317.7181,510.02365 C 317.7181,508.07742 319.31069,506.4961 321.27081,506.4961 L 357.1654,506.4961 C 359.12551,506.4961 360.7181,508.07742 360.7181,510.02365 L 360.7181,542.96857 L 360.7181,542.96857 z "
|
||||
style="fill:url(#linearGradient16280);fill-rule:nonzero;stroke:#646464;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true"
|
||||
inkscape:export-filename="C:\Data\workspace\Widget Test Application\icons\Accept.png"
|
||||
inkscape:export-xdpi="89.880508"
|
||||
inkscape:export-ydpi="89.880508" />
|
||||
<path
|
||||
style="fill:url(#radialGradient3561);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient3569);stroke-width:0.99999946;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.61658032"
|
||||
d="M 356.71811,538.4961 L 321.7181,538.4961 L 321.7181,514.49609 L 356.71811,514.49609 L 356.71811,538.4961 L 356.71811,538.4961 z "
|
||||
id="path12125"
|
||||
sodipodi:nodetypes="cccccc"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true"
|
||||
inkscape:export-filename="C:\Data\workspace\Widget Test Application\icons\Accept.png"
|
||||
inkscape:export-xdpi="89.880508"
|
||||
inkscape:export-ydpi="89.880508" />
|
||||
<path
|
||||
style="fill:none;fill-rule:nonzero;stroke:#ffffff;stroke-width:1.00000036;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.86010359"
|
||||
d="M 359.71812,542.47471 C 359.71812,544.33705 358.73263,545.4961 356.86369,545.4961 L 321.66138,545.4961 C 319.79243,545.4961 318.7181,544.42557 318.7181,542.56323 L 318.7181,510.69454 C 318.7181,508.8322 320.23662,507.4961 322.10557,507.4961 L 356.41949,507.4961 C 358.28844,507.4961 359.71812,508.8322 359.71812,510.69454 L 359.71812,542.12061 L 359.71812,542.47471 z "
|
||||
id="path11975"
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true"
|
||||
inkscape:export-filename="C:\Data\workspace\Widget Test Application\icons\Accept.png"
|
||||
inkscape:export-xdpi="89.880508"
|
||||
inkscape:export-ydpi="89.880508" />
|
||||
<g
|
||||
id="g1344"
|
||||
inkscape:export-filename="C:\Data\workspace\Widget Test Application\icons\Accept.png"
|
||||
inkscape:export-xdpi="89.880508"
|
||||
inkscape:export-ydpi="89.880508">
|
||||
<path
|
||||
d="M 391.57558,520.64126 C 388.04721,525.2233 385.39414,530.28265 383.24731,535.50351 L 382.11899,534.33152 C 384.50958,529.15077 387.25855,524.13597 390.25534,519.22085 L 391.57558,520.64126 z "
|
||||
id="path1338"
|
||||
style="color:#000000;fill:#00cc04;fill-opacity:1;fill-rule:nonzero;stroke:#00cc04;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true" />
|
||||
<path
|
||||
sodipodi:nodetypes="csccccssccscc"
|
||||
id="path1340"
|
||||
d="M 377.62005,528.39051 C 377.2702,528.41881 376.95893,528.62355 376.79441,528.9336 C 376.6299,529.24365 376.63485,529.61619 376.80755,529.92176 C 380.17487,532.79866 380.26287,532.77319 381.99505,536.07801 L 382.24505,536.32801 L 382.2763,536.29676 C 382.32405,536.33112 382.35346,536.38752 382.4013,536.42176 C 382.83669,536.70211 383.41261,536.61505 383.74568,536.21854 C 384.07875,535.82203 384.0651,535.23972 383.7138,534.85926 C 383.7138,534.85926 383.3505,534.63297 383.3388,534.61551 C 383.3388,534.61551 383.92199,536.15645 383.2138,534.35926 C 381.45278,529.89028 381.32486,530.03614 378.2138,528.54676 C 378.03641,528.43544 377.82926,528.38093 377.62005,528.39051 z "
|
||||
style="color:#000000;fill:#00cc04;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.05685425;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" />
|
||||
</g>
|
||||
<g
|
||||
id="g1348"
|
||||
transform="translate(-44.87501,-0.791029)">
|
||||
<path
|
||||
d="M 391.57558,520.64126 C 388.04721,525.2233 385.39414,530.28265 383.24731,535.50351 L 382.11899,534.33152 C 384.50958,529.15077 387.25855,524.13597 390.25534,519.22085 L 391.57558,520.64126 z "
|
||||
id="path1350"
|
||||
style="color:#000000;fill:#00cc04;fill-opacity:1;fill-rule:nonzero;stroke:#00cc04;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true" />
|
||||
<path
|
||||
sodipodi:nodetypes="csccccssccscc"
|
||||
id="path1352"
|
||||
d="M 377.62005,528.39051 C 377.2702,528.41881 376.95893,528.62355 376.79441,528.9336 C 376.6299,529.24365 376.63485,529.61619 376.80755,529.92176 C 380.17487,532.79866 380.26287,532.77319 381.99505,536.07801 L 382.24505,536.32801 L 382.2763,536.29676 C 382.32405,536.33112 382.35346,536.38752 382.4013,536.42176 C 382.83669,536.70211 383.41261,536.61505 383.74568,536.21854 C 384.07875,535.82203 384.0651,535.23972 383.7138,534.85926 C 383.7138,534.85926 383.3505,534.63297 383.3388,534.61551 C 383.3388,534.61551 383.92199,536.15645 383.2138,534.35926 C 381.45278,529.89028 381.32486,530.03614 378.2138,528.54676 C 378.03641,528.43544 377.82926,528.38093 377.62005,528.39051 z "
|
||||
style="color:#000000;fill:#00cc04;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.05685425;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 14 KiB |
BIN
Foundation Widget Test Application/icons/Reject.png
Normal file
|
After Width: | Height: | Size: 544 B |
339
Foundation Widget Test Application/icons/Reject.svg
Normal file
@@ -0,0 +1,339 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://web.resource.org/cc/"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
inkscape:export-ydpi="90.000000"
|
||||
inkscape:export-xdpi="90.000000"
|
||||
inkscape:export-filename="/home/jimmac/Desktop/wi-fi.png"
|
||||
width="48px"
|
||||
height="48px"
|
||||
id="svg11300"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.43"
|
||||
sodipodi:docbase="C:\Data\workspace\Widget Test Application\icons"
|
||||
sodipodi:docname="Reject.svg">
|
||||
<defs
|
||||
id="defs3">
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5060"
|
||||
id="radialGradient6719"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-2.774389,0,0,1.969706,112.7623,-872.8854)"
|
||||
cx="605.71429"
|
||||
cy="486.64789"
|
||||
fx="605.71429"
|
||||
fy="486.64789"
|
||||
r="117.14286" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient5060">
|
||||
<stop
|
||||
style="stop-color:black;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5062" />
|
||||
<stop
|
||||
style="stop-color:black;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop5064" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5060"
|
||||
id="radialGradient6717"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(2.774389,0,0,1.969706,-1891.633,-872.8854)"
|
||||
cx="605.71429"
|
||||
cy="486.64789"
|
||||
fx="605.71429"
|
||||
fy="486.64789"
|
||||
r="117.14286" />
|
||||
<linearGradient
|
||||
id="linearGradient5048">
|
||||
<stop
|
||||
style="stop-color:black;stop-opacity:0;"
|
||||
offset="0"
|
||||
id="stop5050" />
|
||||
<stop
|
||||
id="stop5056"
|
||||
offset="0.5"
|
||||
style="stop-color:black;stop-opacity:1;" />
|
||||
<stop
|
||||
style="stop-color:black;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop5052" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5048"
|
||||
id="linearGradient6715"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(2.774389,0,0,1.969706,-1892.179,-872.8854)"
|
||||
x1="302.85715"
|
||||
y1="366.64789"
|
||||
x2="302.85715"
|
||||
y2="609.50507" />
|
||||
<linearGradient
|
||||
id="linearGradient3563">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3565" />
|
||||
<stop
|
||||
style="stop-color:#939393;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3567" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3555">
|
||||
<stop
|
||||
style="stop-color:#f2f2f2;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3557" />
|
||||
<stop
|
||||
style="stop-color:#d0d0d0;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3559" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
style="stroke-dasharray:none;stroke-miterlimit:4.0000000;stroke-width:1.2166667"
|
||||
y2="36.0328"
|
||||
x2="31.0813"
|
||||
y1="3.7319"
|
||||
x1="12.4873"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="aigrd1">
|
||||
<stop
|
||||
id="stop16177"
|
||||
style="stop-color:#D2D2D2;stroke-dasharray:none;stroke-miterlimit:4.0000000;stroke-width:1.2166667"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop16179"
|
||||
style="stop-color:#EDEDED;stroke-dasharray:none;stroke-miterlimit:4.0000000;stroke-width:1.2166667"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#aigrd1"
|
||||
id="linearGradient16280"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="12.4873"
|
||||
y1="3.7319"
|
||||
x2="31.0813"
|
||||
y2="36.0328"
|
||||
gradientTransform="matrix(1.211383,0,0,1.211383,-2.021433,0.189894)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient12129">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop12131" />
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop12133" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient12129"
|
||||
id="radialGradient12135"
|
||||
cx="24.218407"
|
||||
cy="41.636040"
|
||||
fx="24.218407"
|
||||
fy="41.636040"
|
||||
r="22.097088"
|
||||
gradientTransform="matrix(1.000000,0.000000,0.000000,0.184000,0.000000,33.97501)"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3555"
|
||||
id="radialGradient3561"
|
||||
cx="26.728037"
|
||||
cy="38.34853"
|
||||
fx="26.728037"
|
||||
fy="38.34853"
|
||||
r="17.926361"
|
||||
gradientTransform="matrix(1.848501,-1.547102e-23,1.227926e-24,1.289078,-21.29931,-13.68176)"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3563"
|
||||
id="linearGradient3569"
|
||||
x1="28.107494"
|
||||
y1="34.868584"
|
||||
x2="22.169001"
|
||||
y2="9.8661737"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-1.056826e-16,0.883885)" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
stroke="#cc0000"
|
||||
fill="#cc0000"
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="0.25490196"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="8"
|
||||
inkscape:cx="31.584262"
|
||||
inkscape:cy="29.741983"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:grid-bbox="true"
|
||||
inkscape:document-units="px"
|
||||
inkscape:showpageshadow="false"
|
||||
inkscape:window-width="756"
|
||||
inkscape:window-height="584"
|
||||
inkscape:window-x="105"
|
||||
inkscape:window-y="177"
|
||||
gridempspacing="4" />
|
||||
<metadata
|
||||
id="metadata4">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>Jakub Steiner</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<dc:source>http://jimmac.musichall.cz</dc:source>
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/by-sa/2.0/" />
|
||||
<dc:title>Broken Image</dc:title>
|
||||
<dc:subject>
|
||||
<rdf:Bag>
|
||||
<rdf:li>image</rdf:li>
|
||||
<rdf:li>picture</rdf:li>
|
||||
<rdf:li>photo</rdf:li>
|
||||
<rdf:li>missing</rdf:li>
|
||||
<rdf:li>broken</rdf:li>
|
||||
<rdf:li>404</rdf:li>
|
||||
</rdf:Bag>
|
||||
</dc:subject>
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
<dc:title>Garrett LeSage</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:contributor>
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/by-sa/2.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/Notice" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/Attribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/ShareAlike" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer">
|
||||
<g
|
||||
style="display:inline"
|
||||
transform="matrix(2.367169e-2,0,0,2.086758e-2,45.08634,40.14468)"
|
||||
id="g6707">
|
||||
<rect
|
||||
style="opacity:0.40206185;color:black;fill:url(#linearGradient6715);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||
id="rect6709"
|
||||
width="1339.6335"
|
||||
height="478.35718"
|
||||
x="-1559.2523"
|
||||
y="-150.69685" />
|
||||
<path
|
||||
style="opacity:0.40206185;color:black;fill:url(#radialGradient6717);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||
d="M -219.61876,-150.68038 C -219.61876,-150.68038 -219.61876,327.65041 -219.61876,327.65041 C -76.744594,328.55086 125.78146,220.48075 125.78138,88.454235 C 125.78138,-43.572302 -33.655436,-150.68036 -219.61876,-150.68038 z "
|
||||
id="path6711"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
<path
|
||||
sodipodi:nodetypes="cccc"
|
||||
id="path6713"
|
||||
d="M -1559.2523,-150.68038 C -1559.2523,-150.68038 -1559.2523,327.65041 -1559.2523,327.65041 C -1702.1265,328.55086 -1904.6525,220.48075 -1904.6525,88.454235 C -1904.6525,-43.572302 -1745.2157,-150.68036 -1559.2523,-150.68038 z "
|
||||
style="opacity:0.40206185;color:black;fill:url(#radialGradient6719);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" />
|
||||
</g>
|
||||
<path
|
||||
id="path16181"
|
||||
d="M 45.343675,39.903974 C 45.343675,41.842189 43.768877,43.416987 41.830663,43.416987 L 6.3371177,43.416987 C 4.3989037,43.416987 2.8241047,41.842189 2.8241047,39.903974 L 2.8241047,7.0947821 C 2.8241047,5.1565681 4.3989037,3.581769 6.3371177,3.581769 L 41.830663,3.581769 C 43.768877,3.581769 45.343675,5.1565681 45.343675,7.0947821 L 45.343675,39.903974 L 45.343675,39.903974 z "
|
||||
style="fill:url(#linearGradient16280);fill-rule:nonzero;stroke:#646464;stroke-width:0.99234736;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
transform="matrix(1.011299,0,0,1.004137,-0.356015,-9.658587e-2)"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true" />
|
||||
<path
|
||||
style="fill:url(#radialGradient3561);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient3569);stroke-width:0.99794304;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.61658032"
|
||||
d="M 41.467991,35.25247 L 6.6152692,35.25247 L 6.6152692,11.250058 L 41.467991,11.250058 L 41.467991,35.25247 L 41.467991,35.25247 z "
|
||||
id="path12125"
|
||||
sodipodi:nodetypes="cccccc"
|
||||
transform="matrix(1.004226,0,0,0.9999,-0.143226,0.251056)"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true" />
|
||||
<path
|
||||
style="fill:none;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.99670035;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.86010359"
|
||||
d="M 44.480104,39.32848 C 44.480104,41.187964 43.499604,42.345241 41.640121,42.345241 L 6.6160507,42.345241 C 4.7565677,42.345241 3.6876787,41.276353 3.6876787,39.416869 L 3.6876787,7.5970548 C 3.6876787,5.737571 5.1985087,4.403517 7.0579927,4.403517 L 41.198179,4.403517 C 43.057662,4.403517 44.480104,5.737571 44.480104,7.5970548 L 44.480104,38.974927 L 44.480104,39.32848 z "
|
||||
id="path11975"
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
transform="matrix(1.005089,0,0,1.001536,-0.206445,8.971654e-2)"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true" />
|
||||
<g
|
||||
id="g3551"
|
||||
transform="matrix(0.751031,0,0,0.764054,10.06196,10.18347)"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true">
|
||||
<path
|
||||
d="M 11.318692,9.2240568 C 16.641997,14.693047 22.769247,19.123651 29.210664,22.931105 L 27.441568,24.159843 C 21.101863,20.04489 15.052508,15.498993 9.1840818,10.652117 L 11.318692,9.2240568 z "
|
||||
id="path2565"
|
||||
style="opacity:1;color:#000000;fill:#cc0000;fill-opacity:1;fill-rule:nonzero;stroke:#cc0000;stroke-width:2.64021659;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true" />
|
||||
<path
|
||||
d="M 26.73892,8.9210568 C 21.867631,15.95255 15.247359,21.081199 7.9065151,25.28163 L 10.087564,23.520856 C 8.7241111,24.379297 25.574485,11.804168 23.852075,10.207903 L 26.73892,8.9210568 z "
|
||||
id="path2575"
|
||||
style="opacity:1;color:#000000;fill:#cc0000;fill-opacity:1;fill-rule:nonzero;stroke:#cc0000;stroke-width:2.64021564;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true" />
|
||||
</g>
|
||||
<g
|
||||
id="g1340"
|
||||
transform="matrix(0.751031,0,0,0.764054,47.68692,8.43365)"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true"
|
||||
inkscape:export-xdpi="99.999557"
|
||||
inkscape:export-ydpi="99.999557"
|
||||
inkscape:export-filename="C:\Data\workspace\Widget Test Application\icons\Reject.png">
|
||||
<path
|
||||
d="M 11.318692,9.2240568 C 16.641997,14.693047 22.769247,19.123651 29.210664,22.931105 L 27.441568,24.159843 C 21.101863,20.04489 15.052508,15.498993 9.1840818,10.652117 L 11.318692,9.2240568 z "
|
||||
id="path1342"
|
||||
style="opacity:1;color:#000000;fill:#cc0000;fill-opacity:1;fill-rule:nonzero;stroke:#cc0000;stroke-width:2.64021659;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true" />
|
||||
<path
|
||||
d="M 26.73892,8.9210568 C 21.867631,15.95255 15.247359,21.081199 7.9065151,25.28163 L 10.087564,23.520856 C 8.7241111,24.379297 25.574485,11.804168 23.852075,10.207903 L 26.73892,8.9210568 z "
|
||||
id="path1344"
|
||||
style="opacity:1;color:#000000;fill:#cc0000;fill-opacity:1;fill-rule:nonzero;stroke:#cc0000;stroke-width:2.64021564;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 15 KiB |
318
Foundation Widget Test Application/icons/image-missing.svg
Normal file
@@ -0,0 +1,318 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://web.resource.org/cc/"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
inkscape:export-ydpi="90.000000"
|
||||
inkscape:export-xdpi="90.000000"
|
||||
inkscape:export-filename="/home/jimmac/Desktop/wi-fi.png"
|
||||
width="48px"
|
||||
height="48px"
|
||||
id="svg11300"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.43+devel"
|
||||
sodipodi:docbase="/home/jimmac/src/cvs/tango-icon-theme/scalable/status"
|
||||
sodipodi:docname="image-missing.svg">
|
||||
<defs
|
||||
id="defs3">
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5060"
|
||||
id="radialGradient6719"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-2.774389,0,0,1.969706,112.7623,-872.8854)"
|
||||
cx="605.71429"
|
||||
cy="486.64789"
|
||||
fx="605.71429"
|
||||
fy="486.64789"
|
||||
r="117.14286" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient5060">
|
||||
<stop
|
||||
style="stop-color:black;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop5062" />
|
||||
<stop
|
||||
style="stop-color:black;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop5064" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5060"
|
||||
id="radialGradient6717"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(2.774389,0,0,1.969706,-1891.633,-872.8854)"
|
||||
cx="605.71429"
|
||||
cy="486.64789"
|
||||
fx="605.71429"
|
||||
fy="486.64789"
|
||||
r="117.14286" />
|
||||
<linearGradient
|
||||
id="linearGradient5048">
|
||||
<stop
|
||||
style="stop-color:black;stop-opacity:0;"
|
||||
offset="0"
|
||||
id="stop5050" />
|
||||
<stop
|
||||
id="stop5056"
|
||||
offset="0.5"
|
||||
style="stop-color:black;stop-opacity:1;" />
|
||||
<stop
|
||||
style="stop-color:black;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop5052" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5048"
|
||||
id="linearGradient6715"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(2.774389,0,0,1.969706,-1892.179,-872.8854)"
|
||||
x1="302.85715"
|
||||
y1="366.64789"
|
||||
x2="302.85715"
|
||||
y2="609.50507" />
|
||||
<linearGradient
|
||||
id="linearGradient3563">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3565" />
|
||||
<stop
|
||||
style="stop-color:#939393;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3567" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3555">
|
||||
<stop
|
||||
style="stop-color:#f2f2f2;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3557" />
|
||||
<stop
|
||||
style="stop-color:#d0d0d0;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3559" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
style="stroke-dasharray:none;stroke-miterlimit:4.0000000;stroke-width:1.2166667"
|
||||
y2="36.0328"
|
||||
x2="31.0813"
|
||||
y1="3.7319"
|
||||
x1="12.4873"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="aigrd1">
|
||||
<stop
|
||||
id="stop16177"
|
||||
style="stop-color:#D2D2D2;stroke-dasharray:none;stroke-miterlimit:4.0000000;stroke-width:1.2166667"
|
||||
offset="0" />
|
||||
<stop
|
||||
id="stop16179"
|
||||
style="stop-color:#EDEDED;stroke-dasharray:none;stroke-miterlimit:4.0000000;stroke-width:1.2166667"
|
||||
offset="1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#aigrd1"
|
||||
id="linearGradient16280"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="12.4873"
|
||||
y1="3.7319"
|
||||
x2="31.0813"
|
||||
y2="36.0328"
|
||||
gradientTransform="matrix(1.211383,0,0,1.211383,-2.021433,0.189894)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient12129">
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop12131" />
|
||||
<stop
|
||||
style="stop-color:#000000;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop12133" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient12129"
|
||||
id="radialGradient12135"
|
||||
cx="24.218407"
|
||||
cy="41.636040"
|
||||
fx="24.218407"
|
||||
fy="41.636040"
|
||||
r="22.097088"
|
||||
gradientTransform="matrix(1.000000,0.000000,0.000000,0.184000,0.000000,33.97501)"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3555"
|
||||
id="radialGradient3561"
|
||||
cx="26.728037"
|
||||
cy="38.34853"
|
||||
fx="26.728037"
|
||||
fy="38.34853"
|
||||
r="17.926361"
|
||||
gradientTransform="matrix(1.848501,-1.547102e-23,1.227926e-24,1.289078,-21.29931,-13.68176)"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3563"
|
||||
id="linearGradient3569"
|
||||
x1="28.107494"
|
||||
y1="34.868584"
|
||||
x2="22.169001"
|
||||
y2="9.8661737"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-1.056826e-16,0.883885)" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
stroke="#cc0000"
|
||||
fill="#cc0000"
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="0.25490196"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="13.713462"
|
||||
inkscape:cy="31.493755"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:grid-bbox="true"
|
||||
inkscape:document-units="px"
|
||||
inkscape:showpageshadow="false"
|
||||
inkscape:window-width="1107"
|
||||
inkscape:window-height="1072"
|
||||
inkscape:window-x="180"
|
||||
inkscape:window-y="85"
|
||||
gridempspacing="4" />
|
||||
<metadata
|
||||
id="metadata4">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>Jakub Steiner</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<dc:source>http://jimmac.musichall.cz</dc:source>
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/by-sa/2.0/" />
|
||||
<dc:title>Broken Image</dc:title>
|
||||
<dc:subject>
|
||||
<rdf:Bag>
|
||||
<rdf:li>image</rdf:li>
|
||||
<rdf:li>picture</rdf:li>
|
||||
<rdf:li>photo</rdf:li>
|
||||
<rdf:li>missing</rdf:li>
|
||||
<rdf:li>broken</rdf:li>
|
||||
<rdf:li>404</rdf:li>
|
||||
</rdf:Bag>
|
||||
</dc:subject>
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
<dc:title>Garrett LeSage</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:contributor>
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/by-sa/2.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/Notice" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/Attribution" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/ShareAlike" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer">
|
||||
<g
|
||||
style="display:inline"
|
||||
transform="matrix(2.367169e-2,0,0,2.086758e-2,45.08634,40.14468)"
|
||||
id="g6707">
|
||||
<rect
|
||||
style="opacity:0.40206185;color:black;fill:url(#linearGradient6715);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||
id="rect6709"
|
||||
width="1339.6335"
|
||||
height="478.35718"
|
||||
x="-1559.2523"
|
||||
y="-150.69685" />
|
||||
<path
|
||||
style="opacity:0.40206185;color:black;fill:url(#radialGradient6717);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||
d="M -219.61876,-150.68038 C -219.61876,-150.68038 -219.61876,327.65041 -219.61876,327.65041 C -76.744594,328.55086 125.78146,220.48075 125.78138,88.454235 C 125.78138,-43.572302 -33.655436,-150.68036 -219.61876,-150.68038 z "
|
||||
id="path6711"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
<path
|
||||
sodipodi:nodetypes="cccc"
|
||||
id="path6713"
|
||||
d="M -1559.2523,-150.68038 C -1559.2523,-150.68038 -1559.2523,327.65041 -1559.2523,327.65041 C -1702.1265,328.55086 -1904.6525,220.48075 -1904.6525,88.454235 C -1904.6525,-43.572302 -1745.2157,-150.68036 -1559.2523,-150.68038 z "
|
||||
style="opacity:0.40206185;color:black;fill:url(#radialGradient6719);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible" />
|
||||
</g>
|
||||
<path
|
||||
id="path16181"
|
||||
d="M 45.343675,39.903974 C 45.343675,41.842189 43.768877,43.416987 41.830663,43.416987 L 6.3371177,43.416987 C 4.3989037,43.416987 2.8241047,41.842189 2.8241047,39.903974 L 2.8241047,7.0947821 C 2.8241047,5.1565681 4.3989037,3.581769 6.3371177,3.581769 L 41.830663,3.581769 C 43.768877,3.581769 45.343675,5.1565681 45.343675,7.0947821 L 45.343675,39.903974 L 45.343675,39.903974 z "
|
||||
style="fill:url(#linearGradient16280);fill-rule:nonzero;stroke:#646464;stroke-width:0.99234736;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
transform="matrix(1.011299,0,0,1.004137,-0.356015,-9.658587e-2)"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true" />
|
||||
<path
|
||||
style="fill:url(#radialGradient3561);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient3569);stroke-width:0.99794304;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.61658032"
|
||||
d="M 41.467991,35.25247 L 6.6152692,35.25247 L 6.6152692,11.250058 L 41.467991,11.250058 L 41.467991,35.25247 L 41.467991,35.25247 z "
|
||||
id="path12125"
|
||||
sodipodi:nodetypes="cccccc"
|
||||
transform="matrix(1.004226,0,0,0.9999,-0.143226,0.251056)"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true" />
|
||||
<path
|
||||
style="fill:none;fill-rule:nonzero;stroke:#ffffff;stroke-width:0.99670035;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.86010359"
|
||||
d="M 44.480104,39.32848 C 44.480104,41.187964 43.499604,42.345241 41.640121,42.345241 L 6.6160507,42.345241 C 4.7565677,42.345241 3.6876787,41.276353 3.6876787,39.416869 L 3.6876787,7.5970548 C 3.6876787,5.737571 5.1985087,4.403517 7.0579927,4.403517 L 41.198179,4.403517 C 43.057662,4.403517 44.480104,5.737571 44.480104,7.5970548 L 44.480104,38.974927 L 44.480104,39.32848 z "
|
||||
id="path11975"
|
||||
sodipodi:nodetypes="cccccccccc"
|
||||
transform="matrix(1.005089,0,0,1.001536,-0.206445,8.971654e-2)"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true" />
|
||||
<g
|
||||
id="g3551"
|
||||
transform="matrix(0.751031,0,0,0.764054,10.06196,10.18347)"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true">
|
||||
<path
|
||||
d="M 11.318692,9.2240568 C 16.641997,14.693047 22.769247,19.123651 29.210664,22.931105 L 27.441568,24.159843 C 21.101863,20.04489 15.052508,15.498993 9.1840818,10.652117 L 11.318692,9.2240568 z "
|
||||
id="path2565"
|
||||
style="opacity:1;color:#000000;fill:#cc0000;fill-opacity:1;fill-rule:nonzero;stroke:#cc0000;stroke-width:2.64021659;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true" />
|
||||
<path
|
||||
d="M 26.73892,8.9210568 C 21.867631,15.95255 15.247359,21.081199 7.9065151,25.28163 L 10.087564,23.520856 C 8.7241111,24.379297 25.574485,11.804168 23.852075,10.207903 L 26.73892,8.9210568 z "
|
||||
id="path2575"
|
||||
style="opacity:1;color:#000000;fill:#cc0000;fill-opacity:1;fill-rule:nonzero;stroke:#cc0000;stroke-width:2.64021564;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
|
||||
inkscape:r_cx="true"
|
||||
inkscape:r_cy="true" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 13 KiB |
BIN
Foundation Widget Test Application/images/bulb.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
Foundation Widget Test Application/images/check.gif
Normal file
|
After Width: | Height: | Size: 448 B |
BIN
Foundation Widget Test Application/images/check.png
Normal file
|
After Width: | Height: | Size: 448 B |
BIN
Foundation Widget Test Application/images/error.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
Foundation Widget Test Application/images/x.png
Normal file
|
After Width: | Height: | Size: 544 B |
BIN
Foundation Widget Test Application/italic.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
22
Foundation Widget Test Application/package.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
<!--
|
||||
Packages the necessary local views for use by the thin client.
|
||||
-->
|
||||
<project name="Foundation Widget Test Application Packager" default="package-all" basedir=".">
|
||||
<property name="compress" value="true"/>
|
||||
<property name="client-dir" value="./Client Libraries"/>
|
||||
|
||||
<target name="package-all" depends="make-dirs, package-views">
|
||||
</target>
|
||||
|
||||
<target name="make-dirs" depends="">
|
||||
<mkdir dir="${client-dir}"/>
|
||||
</target>
|
||||
|
||||
<target name="package-views">
|
||||
<jar destfile="${client-dir}/local-views.jar" compress="${compress}" update="false">
|
||||
<fileset dir=".\bin" includes="test\transfer\view\*.class"/>
|
||||
<fileset dir=".\bin" includes="test\transfer\view\controller\*.class"/>
|
||||
</jar>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,4 @@
|
||||
Method #0 = com.foundation.tcv.controller.IClientSessionController.getViewSystemMetadata
|
||||
Method #1 = com.foundation.tcv.controller.IClientSessionController.createView(long;
|
||||
Method #2 = com.foundation.tcv.controller.IClientSessionController.processMessages(long;long;com.common.util.IList;boolean;boolean;
|
||||
Method #3 = com.foundation.tcv.controller.IClientSessionController.setCurrentResources([Ljava.lang.String;;
|
||||
@@ -0,0 +1,6 @@
|
||||
Method #0 = com.foundation.tcv.controller.IServerSessionController.processMessages(long;long;com.common.util.IList;boolean;
|
||||
Method #1 = com.foundation.tcv.controller.IServerSessionController.requestInitialView
|
||||
Method #2 = com.foundation.tcv.controller.IServerSessionController.requestResourceGroupData(com.common.util.IList;
|
||||
Method #3 = com.foundation.tcv.controller.IServerSessionController.requestResourceData(com.common.util.IList;
|
||||
Method #4 = com.foundation.tcv.controller.IServerSessionController.requestCodeData([Ljava.lang.String;;
|
||||
Method #5 = com.foundation.tcv.controller.IServerSessionController.closeSession
|
||||
@@ -0,0 +1,3 @@
|
||||
Method #0 = com.foundation.tcv.controller.IThinServerController.registerClient(com.common.util.IHashMap;
|
||||
Method #1 = com.foundation.tcv.controller.IThinServerController.getClientDownloadChunk(java.lang.String;int;
|
||||
Method #2 = com.foundation.tcv.controller.IThinServerController.getClientDownloadSize(java.lang.String;
|
||||
57
Foundation Widget Test Application/resources.xres
Normal file
BIN
Foundation Widget Test Application/scaleable_font.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
@@ -0,0 +1,163 @@
|
||||
/*
|
||||
* Copyright (c) 2005,2009 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.application;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import com.common.debug.Debug;
|
||||
import com.common.debug.DefaultLog;
|
||||
import com.common.orb.Orb;
|
||||
import com.common.thread.IRunnable;
|
||||
import com.common.thread.Scheduler;
|
||||
import com.common.util.LiteHashSet;
|
||||
import com.de22.orb.Address;
|
||||
import com.de22.orb.optional.*;
|
||||
import com.foundation.application.Application;
|
||||
import com.foundation.tcv.controller.IThinServerController;
|
||||
import com.foundation.tcv.server.controller.ApplicationBrowserService;
|
||||
import com.foundation.tcv.server.controller.IInitialViewFactory;
|
||||
import com.foundation.util.ManagedList;
|
||||
import com.foundation.view.swt.EventLoop;
|
||||
import com.foundation.view.swt.SwtViewContext;
|
||||
|
||||
public class TestViewApplication extends Application {
|
||||
private static final String SERVER_SOCKET_NAME = "testApplicationServerSocket";
|
||||
private static final Object THIN_VIEW_PERMISSION = new Object();
|
||||
private static final TestViewApplication singleton = new TestViewApplication();
|
||||
/**
|
||||
* Starts the test application.
|
||||
* @param args None.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
//getSingleton().startup();
|
||||
|
||||
EventLoop.getSingleton().startOnThisThread(new Runnable() {
|
||||
public void run() {
|
||||
getSingleton().startup();
|
||||
}//run()//
|
||||
});
|
||||
}//main()//
|
||||
/**
|
||||
* Gets the one and only instance of the application.
|
||||
* @return The singleton instance.
|
||||
*/
|
||||
public static TestViewApplication getSingleton() {
|
||||
return singleton;
|
||||
}//getSingleton()//
|
||||
/**
|
||||
* TestViewApplication constructor.
|
||||
*/
|
||||
public TestViewApplication() {
|
||||
super();
|
||||
}//TestViewApplication()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.application.Application#getDefaultRepositoryIdentifier()
|
||||
*/
|
||||
public Object getDefaultRepositoryIdentifier() {
|
||||
return null;
|
||||
}//getDefaultRepositoryIdentifier()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.application.Application#getMetadataLocation()
|
||||
*/
|
||||
public Object getMetadataLocation() {
|
||||
return null;
|
||||
}//getMetadataLocation()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.application.Application#internalShutdown()
|
||||
*/
|
||||
protected void internalShutdown() {
|
||||
try {
|
||||
Orb.closeServerSocket(SERVER_SOCKET_NAME);
|
||||
}//try//
|
||||
catch(Throwable e) {
|
||||
Debug.log(e);
|
||||
}//catch//
|
||||
|
||||
Orb.shutdown();
|
||||
SwtViewContext.getSingleton().shutdown();
|
||||
Scheduler.shutdown();
|
||||
|
||||
super.internalShutdown();
|
||||
}//internalShutdown()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.application.Application#startup()
|
||||
*/
|
||||
protected void startup() {
|
||||
//Setup the debug log.//
|
||||
Debug.setLog(new DefaultLog());
|
||||
//Setup the metadata service.//
|
||||
setupMetadataService();
|
||||
setupResourceService();
|
||||
getResourceService().setCurrentCategories(new String[] {});
|
||||
//TODO: Should call a common setup orb method perhaps.//
|
||||
Orb.setOrbWrapper(new com.de22.orb.optional.CommonOrbWrapper(new com.de22.orb.development.OrbClassLoader(".\\proxies\\"), null, null));
|
||||
|
||||
try {
|
||||
//Start the application specific code. This method should only return when the application is ready to shutdown.//
|
||||
startApplication();
|
||||
}//try//
|
||||
catch(Throwable e) {
|
||||
//Log all errors that are not caught earlier in the program.//
|
||||
Debug.log(e);
|
||||
}//catch//
|
||||
|
||||
waitForShutdown();
|
||||
}//startup()//
|
||||
/**
|
||||
* Starts the actual application.
|
||||
*/
|
||||
private void startApplication() {
|
||||
SwtViewContext.getSingleton().getRequestHandler().executeAsync(new IRunnable() {
|
||||
public Object run() {
|
||||
try {
|
||||
test.local.view.controller.MainViewController controller = new test.local.view.controller.MainViewController(SwtViewContext.getSingleton());
|
||||
|
||||
controller.open();
|
||||
}//try//
|
||||
catch(Throwable e) {
|
||||
Debug.log(e);
|
||||
}//catch//
|
||||
|
||||
return null;
|
||||
}//run()//
|
||||
});
|
||||
|
||||
try {
|
||||
Address address = new Address("localhost:9010");
|
||||
LiteHashSet permissionSet = new LiteHashSet(1);
|
||||
ApplicationBrowserService applicationBrowserService = new ApplicationBrowserService(this);
|
||||
|
||||
Debug.log("Starting test view server on " + address.toString());
|
||||
//Create the set of permissions.//
|
||||
permissionSet.add(THIN_VIEW_PERMISSION);
|
||||
|
||||
if(Orb.openServerSocket(SERVER_SOCKET_NAME, new ServerSocketOptions(address, address, new SocketOptions())) != null) {
|
||||
ManagedList serverAddresses = new ManagedList();
|
||||
ManagedList downloadAddresses = new ManagedList();
|
||||
|
||||
serverAddresses.add(address.toString());
|
||||
|
||||
//Create the thin view controller.//
|
||||
applicationBrowserService.registerApplication("Unlicensed.SampleApplication", new IInitialViewFactory() {
|
||||
public com.foundation.controller.RemoteViewController createInitialView(com.foundation.view.IViewContext viewContext) {
|
||||
return new test.remote.view.controller.MainViewController(viewContext);
|
||||
}//createInitialView()//
|
||||
}, "0.6.0", "1.0", null, null, downloadAddresses, serverAddresses, new File("./Client Libraries"));
|
||||
|
||||
//Bind the controller to the server socket.//
|
||||
Orb.bind(Orb.getProxy(applicationBrowserService, IThinServerController.class), IThinServerController.BOUND_NAME, null);
|
||||
}//if//
|
||||
else {
|
||||
Debug.log("Could not create a server socket on the specified ip:port");
|
||||
}//else//
|
||||
}//try//
|
||||
catch(Throwable e) {
|
||||
Debug.log(e, "Unable to open the view service.");
|
||||
}//catch//
|
||||
}//startApplication()//
|
||||
}//TestViewApplication//
|
||||
@@ -0,0 +1,530 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* ComboPageView
|
||||
*/
|
||||
public class ComboPageView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String PROJECT_HOLDER_COMPONENT = "projectHolder";
|
||||
public static final String COLUMN1_PANEL_COMPONENT = "column1Panel";
|
||||
public static final String PROJECT_COMBO_LABEL_COMPONENT = "projectComboLabel";
|
||||
public static final String PROJECT_COMBO_COMPONENT = "projectCombo";
|
||||
public static final String CONTACT_COMBO_LABEL_COMPONENT = "contactComboLabel";
|
||||
public static final String CONTACT_COMBO_COMPONENT = "contactCombo";
|
||||
public static final String ADDRESS_COMBO_LABEL_COMPONENT = "addressComboLabel";
|
||||
public static final String ADDRESS_COMBO_COMPONENT = "addressCombo";
|
||||
public static final String COLUMN2_PANEL_COMPONENT = "column2Panel";
|
||||
public static final String PROJECT_NOTE_COMBO_LABEL_COMPONENT = "projectNoteComboLabel";
|
||||
public static final String PROJECT_NOTE_COMBO_COMPONENT = "projectNoteCombo";
|
||||
public static final String INNER_VIEW_COMPONENT = "innerView";
|
||||
public static final String COMBO_PAGE_VIEW_COMPONENT = "ComboPageView";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int PROJECT_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0 = 0;
|
||||
protected static final int PROJECT_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 1;
|
||||
protected static final int PROJECT_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0 = 2;
|
||||
protected static final int PROJECT_COMBO_ASSOCIATION_DATA_0_ASSOCIATION_0 = 3;
|
||||
protected static final int PROJECT_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0 = 4;
|
||||
protected static final int CONTACT_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 5;
|
||||
protected static final int CONTACT_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0 = 6;
|
||||
protected static final int CONTACT_COMBO_ASSOCIATION_DATA_0_ASSOCIATION_0 = 7;
|
||||
protected static final int CONTACT_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0 = 8;
|
||||
protected static final int ADDRESS_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 9;
|
||||
protected static final int ADDRESS_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0 = 10;
|
||||
protected static final int ADDRESS_COMBO_ASSOCIATION_DATA_0_ASSOCIATION_0 = 11;
|
||||
protected static final int ADDRESS_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0 = 12;
|
||||
protected static final int PROJECT_NOTE_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 13;
|
||||
protected static final int PROJECT_NOTE_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0 = 14;
|
||||
protected static final int INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0 = 15;
|
||||
protected static final int INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0 = 16;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.ValueHolder projectHolder = null;
|
||||
private com.foundation.view.swt.Panel column1Panel = null;
|
||||
private com.foundation.view.swt.Label projectComboLabel = null;
|
||||
private com.foundation.view.swt.ComboBox projectCombo = null;
|
||||
private com.foundation.view.swt.ComboBox.IHiddenColor projectComboHiddenDataPart0 = null;
|
||||
private com.foundation.view.swt.Label contactComboLabel = null;
|
||||
private com.foundation.view.swt.ComboBox contactCombo = null;
|
||||
private com.foundation.view.swt.ComboBox.IHiddenColor contactComboHiddenDataPart0 = null;
|
||||
private com.foundation.view.swt.Label addressComboLabel = null;
|
||||
private com.foundation.view.swt.ComboBox addressCombo = null;
|
||||
private com.foundation.view.swt.ComboBox.IHiddenColor addressComboHiddenDataPart0 = null;
|
||||
private com.foundation.view.swt.Panel column2Panel = null;
|
||||
private com.foundation.view.swt.Label projectNoteComboLabel = null;
|
||||
private com.foundation.view.swt.ComboBox projectNoteCombo = null;
|
||||
private com.foundation.view.swt.PanelViewer innerView = null;
|
||||
/**
|
||||
* ComboPageView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public ComboPageView() {
|
||||
}//ComboPageView()//
|
||||
/**
|
||||
* ComboPageView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public ComboPageView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, COMBO_PAGE_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//ComboPageView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.ComboPageViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeProjectHolder(com.foundation.view.swt.Container parent) {
|
||||
projectHolder = new com.foundation.view.swt.ValueHolder(parent, PROJECT_HOLDER_COMPONENT, test.model.Project.class);
|
||||
projectHolder.setParentAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ComboPageViewController.class, PROJECT_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ComboPageViewController.class, test.local.view.controller.ComboPageViewController.SELECTED_PROJECT)}, null,true)}));
|
||||
}//initializeProjectHolder()//
|
||||
public void initializeProjectComboLabel(com.foundation.view.swt.Container parent) {
|
||||
projectComboLabel = new com.foundation.view.swt.Label(parent, PROJECT_COMBO_LABEL_COMPONENT, 0);
|
||||
|
||||
projectComboLabel.setText("Projects:");
|
||||
}//initializeProjectComboLabel()//
|
||||
public void initializeProjectCombo(com.foundation.view.swt.Container parent) {
|
||||
projectCombo = new com.foundation.view.swt.ComboBox(parent, PROJECT_COMBO_COMPONENT, com.foundation.view.swt.ComboBox.STYLE_BORDER|com.foundation.view.swt.ComboBox.STYLE_READ_ONLY);
|
||||
|
||||
projectCombo.setAutoSynchronizeSelection(true);
|
||||
projectCombo.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ComboPageViewController.class, PROJECT_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ComboPageViewController.class, test.local.view.controller.ComboPageViewController.PROJECTS)}, null,true)}));
|
||||
projectCombo.setSelectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ComboPageViewController.class, PROJECT_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ComboPageViewController.class, test.local.view.controller.ComboPageViewController.SELECTED_PROJECT)}, null,true)}));
|
||||
projectComboHiddenDataPart0 = projectCombo.addHiddenColor();
|
||||
projectComboHiddenDataPart0.setData(new com.foundation.view.JefColor("(255,255,0,0)"));
|
||||
projectComboHiddenDataPart0.setDataAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(java.lang.Object.class, PROJECT_COMBO_ASSOCIATION_DATA_0_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[0],"controllerHolder",true)}));
|
||||
projectCombo.setItemTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Project.class, PROJECT_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Project.class, test.model.Project.NAME)}, null,true)}));
|
||||
}//initializeProjectCombo()//
|
||||
public void initializeContactComboLabel(com.foundation.view.swt.Container parent) {
|
||||
contactComboLabel = new com.foundation.view.swt.Label(parent, CONTACT_COMBO_LABEL_COMPONENT, 0);
|
||||
|
||||
contactComboLabel.setText("Contacts:");
|
||||
}//initializeContactComboLabel()//
|
||||
public void initializeContactCombo(com.foundation.view.swt.Container parent) {
|
||||
contactCombo = new com.foundation.view.swt.ComboBox(parent, CONTACT_COMBO_COMPONENT, com.foundation.view.swt.ComboBox.STYLE_BORDER|com.foundation.view.swt.ComboBox.STYLE_READ_ONLY);
|
||||
|
||||
contactCombo.setAutoSynchronizeSelection(true);
|
||||
contactCombo.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ComboPageViewController.class, CONTACT_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ComboPageViewController.class, test.local.view.controller.ComboPageViewController.SELECTED_PROJECT)}, null,false)}));
|
||||
contactCombo.setSelectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ComboPageViewController.class, CONTACT_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ComboPageViewController.class, test.local.view.controller.ComboPageViewController.SELECTED_CONTACT)}, null,true)}));
|
||||
contactComboHiddenDataPart0 = contactCombo.addHiddenColor();
|
||||
contactComboHiddenDataPart0.setData(new com.foundation.view.JefColor("(255,255,0,0)"));
|
||||
contactComboHiddenDataPart0.setDataAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(java.lang.Object.class, CONTACT_COMBO_ASSOCIATION_DATA_0_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[0],"controllerHolder",true)}));
|
||||
contactCombo.setItemTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Contact.class, CONTACT_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Contact.class, test.model.Contact.NAME)}, null,true)}));
|
||||
}//initializeContactCombo()//
|
||||
public void initializeAddressComboLabel(com.foundation.view.swt.Container parent) {
|
||||
addressComboLabel = new com.foundation.view.swt.Label(parent, ADDRESS_COMBO_LABEL_COMPONENT, 0);
|
||||
|
||||
addressComboLabel.setText("Contacts:");
|
||||
}//initializeAddressComboLabel()//
|
||||
public void initializeAddressCombo(com.foundation.view.swt.Container parent) {
|
||||
addressCombo = new com.foundation.view.swt.ComboBox(parent, ADDRESS_COMBO_COMPONENT, com.foundation.view.swt.ComboBox.STYLE_BORDER|com.foundation.view.swt.ComboBox.STYLE_READ_ONLY);
|
||||
|
||||
addressCombo.setAutoSynchronizeSelection(true);
|
||||
addressCombo.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ComboPageViewController.class, ADDRESS_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ComboPageViewController.class, test.local.view.controller.ComboPageViewController.SELECTED_CONTACT)}, null,false)}));
|
||||
addressCombo.setSelectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ComboPageViewController.class, ADDRESS_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ComboPageViewController.class, test.local.view.controller.ComboPageViewController.SELECTED_ADDRESS)}, null,true)}));
|
||||
addressComboHiddenDataPart0 = addressCombo.addHiddenColor();
|
||||
addressComboHiddenDataPart0.setData(new com.foundation.view.JefColor("(255,255,0,0)"));
|
||||
addressComboHiddenDataPart0.setDataAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(java.lang.Object.class, ADDRESS_COMBO_ASSOCIATION_DATA_0_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[0],"controllerHolder",true)}));
|
||||
addressCombo.setItemTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Address.class, ADDRESS_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Address.class, test.model.Address.NAME)}, null,true)}));
|
||||
}//initializeAddressCombo()//
|
||||
public void initializeColumn1Panel(com.foundation.view.swt.Container parent) {
|
||||
column1Panel = new com.foundation.view.swt.Panel(parent, COLUMN1_PANEL_COMPONENT, 0);
|
||||
|
||||
initializeProjectComboLabel(column1Panel);
|
||||
initializeProjectCombo(column1Panel);
|
||||
initializeContactComboLabel(column1Panel);
|
||||
initializeContactCombo(column1Panel);
|
||||
initializeAddressComboLabel(column1Panel);
|
||||
initializeAddressCombo(column1Panel);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(column1Panel);
|
||||
|
||||
layout.setNumColumns(1);
|
||||
layout.setMarginHeight(0);
|
||||
layout.setMarginWidth(0);
|
||||
column1Panel.setLayout(layout);
|
||||
column1Panel.setTabOrder(new com.common.util.LiteList(new Object[] {projectCombo, contactCombo, addressCombo}));
|
||||
}//initializeColumn1Panel()//
|
||||
public void initializeProjectNoteComboLabel(com.foundation.view.swt.Container parent) {
|
||||
projectNoteComboLabel = new com.foundation.view.swt.Label(parent, PROJECT_NOTE_COMBO_LABEL_COMPONENT, 0);
|
||||
|
||||
projectNoteComboLabel.setText("Project Note:");
|
||||
}//initializeProjectNoteComboLabel()//
|
||||
public void initializeProjectNoteCombo(com.foundation.view.swt.Container parent) {
|
||||
projectNoteCombo = new com.foundation.view.swt.ComboBox(parent, PROJECT_NOTE_COMBO_COMPONENT, com.foundation.view.swt.ComboBox.STYLE_BORDER);
|
||||
|
||||
projectNoteCombo.setAutoSynchronizeSelection(true);
|
||||
projectNoteCombo.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ComboPageViewController.class, PROJECT_NOTE_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ComboPageViewController.class, test.local.view.controller.ComboPageViewController.SELECTED_PROJECT)}, null,false)}));
|
||||
projectNoteCombo.setSelectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ComboPageViewController.class, PROJECT_NOTE_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ComboPageViewController.class, test.local.view.controller.ComboPageViewController.SELECTED_PROJECT)}, null,false)}));
|
||||
}//initializeProjectNoteCombo()//
|
||||
public void initializeColumn2Panel(com.foundation.view.swt.Container parent) {
|
||||
column2Panel = new com.foundation.view.swt.Panel(parent, COLUMN2_PANEL_COMPONENT, 0);
|
||||
|
||||
initializeProjectNoteComboLabel(column2Panel);
|
||||
initializeProjectNoteCombo(column2Panel);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(column2Panel);
|
||||
|
||||
layout.setNumColumns(1);
|
||||
layout.setMarginHeight(0);
|
||||
layout.setMarginWidth(0);
|
||||
column2Panel.setLayout(layout);
|
||||
column2Panel.setTabOrder(new com.common.util.LiteList(new Object[] {projectNoteCombo}));
|
||||
}//initializeColumn2Panel()//
|
||||
public void initializeInnerView(com.foundation.view.swt.Container parent) {
|
||||
innerView = new com.foundation.view.swt.PanelViewer(parent, INNER_VIEW_COMPONENT, com.foundation.view.swt.PanelViewer.STYLE_BORDER);
|
||||
|
||||
innerView.setControllerAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ComboPageViewController.class, INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ComboPageViewController.class, test.local.view.controller.ComboPageViewController.EDITOR)}, null,true)}));
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(innerView);
|
||||
|
||||
innerView.setLayout(layout);
|
||||
innerView.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
innerView.setDefaultIsVisible(false);
|
||||
innerView.setIsVisibleAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ComboPageViewController.class, INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ComboPageViewController.class, test.local.view.controller.ComboPageViewController.EDITOR)}, null,true)}));
|
||||
}//initializeInnerView()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeProjectHolder(this);
|
||||
initializeColumn1Panel(this);
|
||||
initializeColumn2Panel(this);
|
||||
initializeInnerView(this);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(this);
|
||||
|
||||
layout.setNumColumns(2);
|
||||
layout.setMakeColumnsEqualWidth(true);
|
||||
layout.setMarginHeight(5);
|
||||
layout.setMarginWidth(5);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {innerView}));
|
||||
this.setDefaultContainerTitle("Combo");
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case PROJECT_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getSelectedProject();
|
||||
break;
|
||||
case PROJECT_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getProjects();
|
||||
break;
|
||||
case PROJECT_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getSelectedProject();
|
||||
break;
|
||||
case PROJECT_COMBO_ASSOCIATION_DATA_0_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getObjectColor((java.lang.Object) parameters[0]);
|
||||
break;
|
||||
case PROJECT_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getName();
|
||||
break;
|
||||
case CONTACT_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getSelectedProject();
|
||||
break;
|
||||
case CONTACT_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getSelectedContact();
|
||||
break;
|
||||
case CONTACT_COMBO_ASSOCIATION_DATA_0_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getObjectColor((java.lang.Object) parameters[0]);
|
||||
break;
|
||||
case CONTACT_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Contact) value).getName();
|
||||
break;
|
||||
case ADDRESS_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getSelectedContact();
|
||||
break;
|
||||
case ADDRESS_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getSelectedAddress();
|
||||
break;
|
||||
case ADDRESS_COMBO_ASSOCIATION_DATA_0_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getObjectColor((java.lang.Object) parameters[0]);
|
||||
break;
|
||||
case ADDRESS_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Address) value).getName();
|
||||
break;
|
||||
case PROJECT_NOTE_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getSelectedProject();
|
||||
break;
|
||||
case PROJECT_NOTE_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getSelectedProject();
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getEditor();
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getEditor();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case PROJECT_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getOldAttributeValue(test.local.view.controller.ComboPageViewController.SELECTED_PROJECT);
|
||||
break;
|
||||
case PROJECT_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getOldAttributeValue(test.local.view.controller.ComboPageViewController.PROJECTS);
|
||||
break;
|
||||
case PROJECT_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getOldAttributeValue(test.local.view.controller.ComboPageViewController.SELECTED_PROJECT);
|
||||
break;
|
||||
case PROJECT_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getOldAttributeValue(test.model.Project.NAME);
|
||||
break;
|
||||
case CONTACT_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getOldAttributeValue(test.local.view.controller.ComboPageViewController.SELECTED_CONTACT);
|
||||
break;
|
||||
case CONTACT_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Contact) value).getOldAttributeValue(test.model.Contact.NAME);
|
||||
break;
|
||||
case ADDRESS_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getOldAttributeValue(test.local.view.controller.ComboPageViewController.SELECTED_ADDRESS);
|
||||
break;
|
||||
case ADDRESS_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Address) value).getOldAttributeValue(test.model.Address.NAME);
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getOldAttributeValue(test.local.view.controller.ComboPageViewController.EDITOR);
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ComboPageViewController) value).getOldAttributeValue(test.local.view.controller.ComboPageViewController.EDITOR);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
case PROJECT_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
((test.local.view.controller.ComboPageViewController) value).setSelectedProject((java.lang.Object) parameters[0]);
|
||||
break;
|
||||
case CONTACT_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
((test.local.view.controller.ComboPageViewController) value).setSelectedContact((java.lang.Object) parameters[0]);
|
||||
break;
|
||||
case ADDRESS_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
((test.local.view.controller.ComboPageViewController) value).setSelectedAddress((java.lang.Object) parameters[0]);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
{ //column1Panel//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.verticalAlignment = com.foundation.view.swt.layout.GridData.BEGINNING;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
layoutData.grabExcessVerticalSpace = true;
|
||||
column1Panel.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //column2Panel//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.verticalAlignment = com.foundation.view.swt.layout.GridData.BEGINNING;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
layoutData.grabExcessVerticalSpace = true;
|
||||
column2Panel.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //innerView//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.horizontalSpan = 2;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
innerView.setLayoutData(layoutData);
|
||||
}//block//
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
projectComboHiddenDataPart0.addSelectionLink(new com.foundation.view.LinkData(projectComboLabel, com.foundation.view.swt.Label.LINK_TARGET_BACKGROUND_COLOR, null, false, false));
|
||||
contactComboHiddenDataPart0.addSelectionLink(new com.foundation.view.LinkData(contactComboLabel, com.foundation.view.swt.Label.LINK_TARGET_BACKGROUND_COLOR, null, false, false));
|
||||
addressComboHiddenDataPart0.addSelectionLink(new com.foundation.view.LinkData(addressComboLabel, com.foundation.view.swt.Label.LINK_TARGET_BACKGROUND_COLOR, null, false, false));
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpProjectHolder() {
|
||||
return projectHolder;
|
||||
}//getVpProjectHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Panel getVpColumn1Panel() {
|
||||
return column1Panel;
|
||||
}//getVpColumn1Panel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpProjectComboLabel() {
|
||||
return projectComboLabel;
|
||||
}//getVpProjectComboLabel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ComboBox getVpProjectCombo() {
|
||||
return projectCombo;
|
||||
}//getVpProjectCombo()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ComboBox.IHiddenColor getVpProjectComboHiddenDataPart0() {
|
||||
return projectComboHiddenDataPart0;
|
||||
}//getVpProjectComboHiddenDataPart0()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpContactComboLabel() {
|
||||
return contactComboLabel;
|
||||
}//getVpContactComboLabel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ComboBox getVpContactCombo() {
|
||||
return contactCombo;
|
||||
}//getVpContactCombo()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ComboBox.IHiddenColor getVpContactComboHiddenDataPart0() {
|
||||
return contactComboHiddenDataPart0;
|
||||
}//getVpContactComboHiddenDataPart0()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpAddressComboLabel() {
|
||||
return addressComboLabel;
|
||||
}//getVpAddressComboLabel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ComboBox getVpAddressCombo() {
|
||||
return addressCombo;
|
||||
}//getVpAddressCombo()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ComboBox.IHiddenColor getVpAddressComboHiddenDataPart0() {
|
||||
return addressComboHiddenDataPart0;
|
||||
}//getVpAddressComboHiddenDataPart0()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Panel getVpColumn2Panel() {
|
||||
return column2Panel;
|
||||
}//getVpColumn2Panel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpProjectNoteComboLabel() {
|
||||
return projectNoteComboLabel;
|
||||
}//getVpProjectNoteComboLabel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ComboBox getVpProjectNoteCombo() {
|
||||
return projectNoteCombo;
|
||||
}//getVpProjectNoteCombo()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.PanelViewer getVpInnerView() {
|
||||
return innerView;
|
||||
}//getVpInnerView()//
|
||||
}//ComboPageView//
|
||||
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2009,2008 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<panel name="ComboPageView" style="" container-title="Combo">
|
||||
<grid-layout column-count="2" equal-width-columns="true" margin-width="5" margin-height="5"/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.ComboPageViewController"/>
|
||||
<value-holder name="projectHolder" type="test.model.Project">
|
||||
<association function="parent" attribute="selectedProject" value-holder="controllerHolder"/>
|
||||
</value-holder>
|
||||
|
||||
<panel name="column1Panel">
|
||||
<grid-layout column-count="1" margin-width="0" margin-height="0"/>
|
||||
<grid-layout-data horizontal-fill="true" vertical-fill="true" vertical-alignment="beginning"/>
|
||||
|
||||
<label name="projectComboLabel" style="" text="Projects:"/>
|
||||
<combo name="projectCombo" style="border | read only" auto-synchronize-selection="true" tab-order="1">
|
||||
<association function="collection" attribute="projects" value-holder="controllerHolder"/>
|
||||
<association function="selection" attribute="selectedProject" value-holder="controllerHolder"/>
|
||||
<association function="item-text" attribute="name" row-type="test.model.Project"/>
|
||||
|
||||
<hidden-color data="#FFFF00">
|
||||
<association function="data" getter="getObjectColor" getter-signature="Ljava.lang.Object;" row-type="java.lang.Object" value-holder="controllerHolder"/>
|
||||
<link function="selection" component="projectComboLabel" target="background-color"/>
|
||||
</hidden-color>
|
||||
</combo>
|
||||
|
||||
<label name="contactComboLabel" style="" text="Contacts:"/>
|
||||
<combo name="contactCombo" style="border | read only" auto-synchronize-selection="true" tab-order="1">
|
||||
<association-group function="collection" value-holder="controllerHolder">
|
||||
<association-link attribute="selectedProject" row-type="test.local.view.controller.ComboPageViewController">
|
||||
<association-target-attribute attribute="contacts" row-type="test.model.Project"/>
|
||||
</association-link>
|
||||
</association-group>
|
||||
<association function="selection" attribute="selectedContact" value-holder="controllerHolder"/>
|
||||
<association function="item-text" attribute="name" row-type="test.model.Contact"/>
|
||||
|
||||
<hidden-color data="#FFFF00">
|
||||
<association function="data" getter="getObjectColor" getter-signature="Ljava.lang.Object;" row-type="java.lang.Object" value-holder="controllerHolder"/>
|
||||
<link function="selection" component="contactComboLabel" target="background-color"/>
|
||||
</hidden-color>
|
||||
</combo>
|
||||
<label name="addressComboLabel" style="" text="Contacts:"/>
|
||||
<combo name="addressCombo" style="border | read only" auto-synchronize-selection="true" tab-order="1">
|
||||
<association-group function="collection" value-holder="controllerHolder">
|
||||
<association-link attribute="selectedContact" row-type="test.local.view.controller.ComboPageViewController">
|
||||
<association-target-attribute attribute="addresses" row-type="test.model.Contact"/>
|
||||
</association-link>
|
||||
</association-group>
|
||||
<association function="selection" attribute="selectedAddress" value-holder="controllerHolder"/>
|
||||
<association function="item-text" attribute="name" row-type="test.model.Address"/>
|
||||
|
||||
<hidden-color data="#FFFF00">
|
||||
<association function="data" getter="getObjectColor" getter-signature="Ljava.lang.Object;" row-type="java.lang.Object" value-holder="controllerHolder"/>
|
||||
<link function="selection" component="addressComboLabel" target="background-color"/>
|
||||
</hidden-color>
|
||||
</combo>
|
||||
</panel>
|
||||
|
||||
<panel name="column2Panel">
|
||||
<grid-layout column-count="1" margin-width="0" margin-height="0"/>
|
||||
<grid-layout-data horizontal-fill="true" vertical-alignment="beginning" vertical-fill="true"/>
|
||||
|
||||
<label name="projectNoteComboLabel" style="" text="Project Note:"/>
|
||||
<combo name="projectNoteCombo" style="border" auto-synchronize-selection="true" tab-order="1">
|
||||
<association-group function="collection" value-holder="controllerHolder">
|
||||
<association-link attribute="selectedProject" row-type="test.local.view.controller.ComboPageViewController">
|
||||
<association-target-attribute attribute="recentNotes" row-type="test.model.Project"/>
|
||||
</association-link>
|
||||
</association-group>
|
||||
<association-group function="selection" value-holder="controllerHolder">
|
||||
<association-link attribute="selectedProject" row-type="test.local.view.controller.ComboPageViewController">
|
||||
<association-target-attribute attribute="note" row-type="test.model.Project"/>
|
||||
</association-link>
|
||||
</association-group>
|
||||
</combo>
|
||||
</panel>
|
||||
|
||||
<panel-viewer name="innerView" style="border" is-visible="false" tab-order="1">
|
||||
<fill-layout/>
|
||||
<grid-layout-data horizontal-span="2" horizontal-alignment="fill" horizontal-fill="true"/>
|
||||
|
||||
<association function="is-visible" attribute="editor" value-holder="controllerHolder"/>
|
||||
<association function="controller" attribute="editor" value-holder="controllerHolder"/>
|
||||
</panel-viewer>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,298 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* ContactEditorView
|
||||
*/
|
||||
public class ContactEditorView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String CONTACT_HOLDER_COMPONENT = "contactHolder";
|
||||
public static final String NAME_LABEL_COMPONENT = "nameLabel";
|
||||
public static final String NAME_EDITOR_COMPONENT = "nameEditor";
|
||||
public static final String BUTTON_PANEL_COMPONENT = "buttonPanel";
|
||||
public static final String ACCEPT_BUTTON_COMPONENT = "acceptButton";
|
||||
public static final String REJECT_BUTTON_COMPONENT = "rejectButton";
|
||||
public static final String CONTACT_EDITOR_VIEW_COMPONENT = "ContactEditorView";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int CONTACT_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0 = 0;
|
||||
protected static final int NAME_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 1;
|
||||
|
||||
//Method Association Identifiers//
|
||||
protected static final int ACCEPT_BUTTON_SELECTION_METHOD_ASSOCIATION = 0;
|
||||
protected static final int REJECT_BUTTON_SELECTION_METHOD_ASSOCIATION = 1;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.ValueHolder contactHolder = null;
|
||||
private com.foundation.view.swt.Label nameLabel = null;
|
||||
private com.foundation.view.swt.TextField nameEditor = null;
|
||||
private com.foundation.view.swt.Panel buttonPanel = null;
|
||||
private com.foundation.view.swt.Button acceptButton = null;
|
||||
private com.foundation.view.swt.Button rejectButton = null;
|
||||
/**
|
||||
* ContactEditorView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public ContactEditorView() {
|
||||
}//ContactEditorView()//
|
||||
/**
|
||||
* ContactEditorView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public ContactEditorView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, CONTACT_EDITOR_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//ContactEditorView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.ContactEditorViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeContactHolder(com.foundation.view.swt.Container parent) {
|
||||
contactHolder = new com.foundation.view.swt.ValueHolder(parent, CONTACT_HOLDER_COMPONENT, test.model.Contact.class);
|
||||
contactHolder.setParentAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ContactEditorViewController.class, CONTACT_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ContactEditorViewController.class, test.local.view.controller.ContactEditorViewController.CONTACT)}, null,true)}));
|
||||
}//initializeContactHolder()//
|
||||
public void initializeNameLabel(com.foundation.view.swt.Container parent) {
|
||||
nameLabel = new com.foundation.view.swt.Label(parent, NAME_LABEL_COMPONENT, 0);
|
||||
|
||||
nameLabel.setText("Name:");
|
||||
}//initializeNameLabel()//
|
||||
public void initializeNameEditor(com.foundation.view.swt.Container parent) {
|
||||
nameEditor = new com.foundation.view.swt.TextField(parent, NAME_EDITOR_COMPONENT, 0);
|
||||
|
||||
com.foundation.view.swt.TextField.TextFormat nameEditorFormat = (com.foundation.view.swt.TextField.TextFormat) nameEditor.initializeFormat(com.foundation.view.swt.TextField.TextFormat.class);
|
||||
nameEditorFormat.setValueAssociation(new com.foundation.view.SingleAssociationContainer("contactHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.model.Contact.class, NAME_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Contact.class, test.model.Contact.NAME)}, null,true)}));
|
||||
}//initializeNameEditor()//
|
||||
public void initializeAcceptButton(com.foundation.view.swt.Container parent) {
|
||||
acceptButton = new com.foundation.view.swt.Button(parent, ACCEPT_BUTTON_COMPONENT, 0);
|
||||
|
||||
acceptButton.setImage(new com.foundation.view.JefImage("icons/Accept.png"));
|
||||
acceptButton.setSelectionMethod(new com.foundation.view.MethodAssociation(this, ACCEPT_BUTTON_SELECTION_METHOD_ASSOCIATION, acceptButton, "controllerHolder", null, null));
|
||||
}//initializeAcceptButton()//
|
||||
public void initializeRejectButton(com.foundation.view.swt.Container parent) {
|
||||
rejectButton = new com.foundation.view.swt.Button(parent, REJECT_BUTTON_COMPONENT, 0);
|
||||
|
||||
rejectButton.setImage(new com.foundation.view.JefImage("icons/Reject.png"));
|
||||
rejectButton.setSelectionMethod(new com.foundation.view.MethodAssociation(this, REJECT_BUTTON_SELECTION_METHOD_ASSOCIATION, rejectButton, "controllerHolder", null, null));
|
||||
}//initializeRejectButton()//
|
||||
public void initializeButtonPanel(com.foundation.view.swt.Container parent) {
|
||||
buttonPanel = new com.foundation.view.swt.Panel(parent, BUTTON_PANEL_COMPONENT, 0);
|
||||
|
||||
initializeAcceptButton(buttonPanel);
|
||||
initializeRejectButton(buttonPanel);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(buttonPanel);
|
||||
|
||||
layout.setNumColumns(2);
|
||||
layout.setMakeColumnsEqualWidth(true);
|
||||
buttonPanel.setLayout(layout);
|
||||
buttonPanel.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
}//initializeButtonPanel()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeContactHolder(this);
|
||||
initializeNameLabel(this);
|
||||
initializeNameEditor(this);
|
||||
initializeButtonPanel(this);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(this);
|
||||
|
||||
layout.setNumColumns(1);
|
||||
layout.setMakeColumnsEqualWidth(true);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
case ACCEPT_BUTTON_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.ContactEditorViewController) value).doApply();
|
||||
break;
|
||||
case REJECT_BUTTON_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.ContactEditorViewController) value).doCancel();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case CONTACT_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ContactEditorViewController) value).getContact();
|
||||
break;
|
||||
case NAME_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Contact) value).getName();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case CONTACT_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ContactEditorViewController) value).getOldAttributeValue(test.local.view.controller.ContactEditorViewController.CONTACT);
|
||||
break;
|
||||
case NAME_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Contact) value).getOldAttributeValue(test.model.Contact.NAME);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
case NAME_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
((test.model.Contact) value).setName((java.lang.String) parameters[0]);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
{ //nameEditor//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
nameEditor.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //buttonPanel//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.END;
|
||||
buttonPanel.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //acceptButton//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.minimumWidth = 20;
|
||||
layoutData.widthHint = 20;
|
||||
layoutData.minimumHeight = 20;
|
||||
layoutData.heightHint = 20;
|
||||
acceptButton.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //rejectButton//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.minimumWidth = 20;
|
||||
layoutData.widthHint = 20;
|
||||
layoutData.minimumHeight = 20;
|
||||
layoutData.heightHint = 20;
|
||||
rejectButton.setLayoutData(layoutData);
|
||||
}//block//
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpContactHolder() {
|
||||
return contactHolder;
|
||||
}//getVpContactHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpNameLabel() {
|
||||
return nameLabel;
|
||||
}//getVpNameLabel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.TextField getVpNameEditor() {
|
||||
return nameEditor;
|
||||
}//getVpNameEditor()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Panel getVpButtonPanel() {
|
||||
return buttonPanel;
|
||||
}//getVpButtonPanel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpAcceptButton() {
|
||||
return acceptButton;
|
||||
}//getVpAcceptButton()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpRejectButton() {
|
||||
return rejectButton;
|
||||
}//getVpRejectButton()//
|
||||
}//ContactEditorView//
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--
|
||||
Copyright (c) 2009,2008 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name='thick:swt'/>
|
||||
</metadata>
|
||||
<panel style='' name='ContactEditorView'>
|
||||
<grid-layout column-count='1' equal-width-columns='true'/>
|
||||
<value-holder type='test.local.view.controller.ContactEditorViewController' name='controllerHolder'/>
|
||||
<value-holder type='test.model.Contact' name='contactHolder'>
|
||||
<association attribute='contact' function='parent' value-holder='controllerHolder'/>
|
||||
</value-holder>
|
||||
<label style='' name='nameLabel' text='Name:'/>
|
||||
<text style='' name='nameEditor'>
|
||||
<grid-layout-data horizontal-fill='true' horizontal-alignment='fill'/>
|
||||
<text-format>
|
||||
<association attribute='name' function='value' value-holder='contactHolder'/>
|
||||
</text-format>
|
||||
</text>
|
||||
<panel name='buttonPanel'>
|
||||
<grid-layout column-count='2' equal-width-columns='true'/>
|
||||
<grid-layout-data horizontal-alignment='end'/>
|
||||
<button image='icons/Accept.png' style='' name='acceptButton'>
|
||||
<grid-layout-data minimum-width='20' minimum-height='20'/>
|
||||
<method value-holder='controllerHolder' function='selection' signature='' name='doApply'/>
|
||||
</button>
|
||||
<button image='icons/Reject.png' style='' name='rejectButton'>
|
||||
<grid-layout-data minimum-width='20' minimum-height='20'/>
|
||||
<method value-holder='controllerHolder' function='selection' signature='' name='doCancel'/>
|
||||
</button>
|
||||
</panel>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,298 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* EmailAddressEditorView
|
||||
*/
|
||||
public class EmailAddressEditorView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String EMAIL_ADDRESS_HOLDER_COMPONENT = "emailAddressHolder";
|
||||
public static final String EMAIL_LABEL_COMPONENT = "emailLabel";
|
||||
public static final String EMAIL_EDITOR_COMPONENT = "emailEditor";
|
||||
public static final String BUTTON_PANEL_COMPONENT = "buttonPanel";
|
||||
public static final String ACCEPT_BUTTON_COMPONENT = "acceptButton";
|
||||
public static final String REJECT_BUTTON_COMPONENT = "rejectButton";
|
||||
public static final String EMAIL_ADDRESS_EDITOR_VIEW_COMPONENT = "EmailAddressEditorView";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int EMAIL_ADDRESS_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0 = 0;
|
||||
protected static final int EMAIL_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 1;
|
||||
|
||||
//Method Association Identifiers//
|
||||
protected static final int ACCEPT_BUTTON_SELECTION_METHOD_ASSOCIATION = 0;
|
||||
protected static final int REJECT_BUTTON_SELECTION_METHOD_ASSOCIATION = 1;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.ValueHolder emailAddressHolder = null;
|
||||
private com.foundation.view.swt.Label emailLabel = null;
|
||||
private com.foundation.view.swt.TextField emailEditor = null;
|
||||
private com.foundation.view.swt.Panel buttonPanel = null;
|
||||
private com.foundation.view.swt.Button acceptButton = null;
|
||||
private com.foundation.view.swt.Button rejectButton = null;
|
||||
/**
|
||||
* EmailAddressEditorView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public EmailAddressEditorView() {
|
||||
}//EmailAddressEditorView()//
|
||||
/**
|
||||
* EmailAddressEditorView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public EmailAddressEditorView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, EMAIL_ADDRESS_EDITOR_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//EmailAddressEditorView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.EmailAddressEditorViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeEmailAddressHolder(com.foundation.view.swt.Container parent) {
|
||||
emailAddressHolder = new com.foundation.view.swt.ValueHolder(parent, EMAIL_ADDRESS_HOLDER_COMPONENT, test.model.EmailAddress.class);
|
||||
emailAddressHolder.setParentAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.EmailAddressEditorViewController.class, EMAIL_ADDRESS_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.EmailAddressEditorViewController.class, test.local.view.controller.EmailAddressEditorViewController.EMAIL_ADDRESS)}, null,true)}));
|
||||
}//initializeEmailAddressHolder()//
|
||||
public void initializeEmailLabel(com.foundation.view.swt.Container parent) {
|
||||
emailLabel = new com.foundation.view.swt.Label(parent, EMAIL_LABEL_COMPONENT, 0);
|
||||
|
||||
emailLabel.setText("Email Address:");
|
||||
}//initializeEmailLabel()//
|
||||
public void initializeEmailEditor(com.foundation.view.swt.Container parent) {
|
||||
emailEditor = new com.foundation.view.swt.TextField(parent, EMAIL_EDITOR_COMPONENT, 0);
|
||||
|
||||
com.foundation.view.swt.TextField.TextFormat emailEditorFormat = (com.foundation.view.swt.TextField.TextFormat) emailEditor.initializeFormat(com.foundation.view.swt.TextField.TextFormat.class);
|
||||
emailEditorFormat.setValueAssociation(new com.foundation.view.SingleAssociationContainer("emailAddressHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.model.EmailAddress.class, EMAIL_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.EmailAddress.class, test.model.EmailAddress.EMAIL)}, null,true)}));
|
||||
}//initializeEmailEditor()//
|
||||
public void initializeAcceptButton(com.foundation.view.swt.Container parent) {
|
||||
acceptButton = new com.foundation.view.swt.Button(parent, ACCEPT_BUTTON_COMPONENT, 0);
|
||||
|
||||
acceptButton.setImage(new com.foundation.view.JefImage("icons/Accept.png"));
|
||||
acceptButton.setSelectionMethod(new com.foundation.view.MethodAssociation(this, ACCEPT_BUTTON_SELECTION_METHOD_ASSOCIATION, acceptButton, "controllerHolder", null, null));
|
||||
}//initializeAcceptButton()//
|
||||
public void initializeRejectButton(com.foundation.view.swt.Container parent) {
|
||||
rejectButton = new com.foundation.view.swt.Button(parent, REJECT_BUTTON_COMPONENT, 0);
|
||||
|
||||
rejectButton.setImage(new com.foundation.view.JefImage("icons/Reject.png"));
|
||||
rejectButton.setSelectionMethod(new com.foundation.view.MethodAssociation(this, REJECT_BUTTON_SELECTION_METHOD_ASSOCIATION, rejectButton, "controllerHolder", null, null));
|
||||
}//initializeRejectButton()//
|
||||
public void initializeButtonPanel(com.foundation.view.swt.Container parent) {
|
||||
buttonPanel = new com.foundation.view.swt.Panel(parent, BUTTON_PANEL_COMPONENT, 0);
|
||||
|
||||
initializeAcceptButton(buttonPanel);
|
||||
initializeRejectButton(buttonPanel);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(buttonPanel);
|
||||
|
||||
layout.setNumColumns(2);
|
||||
layout.setMakeColumnsEqualWidth(true);
|
||||
buttonPanel.setLayout(layout);
|
||||
buttonPanel.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
}//initializeButtonPanel()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeEmailAddressHolder(this);
|
||||
initializeEmailLabel(this);
|
||||
initializeEmailEditor(this);
|
||||
initializeButtonPanel(this);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(this);
|
||||
|
||||
layout.setNumColumns(1);
|
||||
layout.setMakeColumnsEqualWidth(true);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
case ACCEPT_BUTTON_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.EmailAddressEditorViewController) value).doApply();
|
||||
break;
|
||||
case REJECT_BUTTON_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.EmailAddressEditorViewController) value).doCancel();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case EMAIL_ADDRESS_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.EmailAddressEditorViewController) value).getEmailAddress();
|
||||
break;
|
||||
case EMAIL_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.EmailAddress) value).getEmail();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case EMAIL_ADDRESS_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.EmailAddressEditorViewController) value).getOldAttributeValue(test.local.view.controller.EmailAddressEditorViewController.EMAIL_ADDRESS);
|
||||
break;
|
||||
case EMAIL_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.EmailAddress) value).getOldAttributeValue(test.model.EmailAddress.EMAIL);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
case EMAIL_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
((test.model.EmailAddress) value).setEmail((java.lang.String) parameters[0]);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
{ //emailEditor//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
emailEditor.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //buttonPanel//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.END;
|
||||
buttonPanel.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //acceptButton//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.minimumWidth = 20;
|
||||
layoutData.widthHint = 20;
|
||||
layoutData.minimumHeight = 20;
|
||||
layoutData.heightHint = 20;
|
||||
acceptButton.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //rejectButton//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.minimumWidth = 20;
|
||||
layoutData.widthHint = 20;
|
||||
layoutData.minimumHeight = 20;
|
||||
layoutData.heightHint = 20;
|
||||
rejectButton.setLayoutData(layoutData);
|
||||
}//block//
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpEmailAddressHolder() {
|
||||
return emailAddressHolder;
|
||||
}//getVpEmailAddressHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpEmailLabel() {
|
||||
return emailLabel;
|
||||
}//getVpEmailLabel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.TextField getVpEmailEditor() {
|
||||
return emailEditor;
|
||||
}//getVpEmailEditor()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Panel getVpButtonPanel() {
|
||||
return buttonPanel;
|
||||
}//getVpButtonPanel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpAcceptButton() {
|
||||
return acceptButton;
|
||||
}//getVpAcceptButton()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpRejectButton() {
|
||||
return rejectButton;
|
||||
}//getVpRejectButton()//
|
||||
}//EmailAddressEditorView//
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version='1.0'?>
|
||||
<!--
|
||||
Copyright (c) 2009,2008 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name='thick:swt'/>
|
||||
</metadata>
|
||||
<panel style='' name='EmailAddressEditorView'>
|
||||
<grid-layout column-count='1' equal-width-columns='true'/>
|
||||
<value-holder type='test.local.view.controller.EmailAddressEditorViewController' name='controllerHolder'/>
|
||||
<value-holder type='test.model.EmailAddress' name='emailAddressHolder'>
|
||||
<association attribute='emailAddress' function='parent' value-holder='controllerHolder'/>
|
||||
</value-holder>
|
||||
<label style='' name='emailLabel' text='Email Address:'/>
|
||||
<text style='' name='emailEditor'>
|
||||
<grid-layout-data horizontal-fill='true' horizontal-alignment='fill'/>
|
||||
<text-format>
|
||||
<association attribute='email' function='value' value-holder='emailAddressHolder'/>
|
||||
</text-format>
|
||||
</text>
|
||||
<panel name='buttonPanel'>
|
||||
<grid-layout column-count='2' equal-width-columns='true'/>
|
||||
<grid-layout-data horizontal-alignment='end'/>
|
||||
<button image='icons/Accept.png' style='' name='acceptButton'>
|
||||
<grid-layout-data minimum-width='20' minimum-height='20'/>
|
||||
<method value-holder='controllerHolder' function='selection' signature='' name='doApply'/>
|
||||
</button>
|
||||
<button image='icons/Reject.png' style='' name='rejectButton'>
|
||||
<grid-layout-data minimum-width='20' minimum-height='20'/>
|
||||
<method value-holder='controllerHolder' function='selection' signature='' name='doCancel'/>
|
||||
</button>
|
||||
</panel>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,306 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* EnhancedListPageView
|
||||
*/
|
||||
public class EnhancedListPageView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String SAMPLE_LIST1_LABEL_COMPONENT = "sampleList1Label";
|
||||
public static final String SAMPLE_LIST1_COMPONENT = "sampleList1";
|
||||
public static final String INNER_VIEW_COMPONENT = "innerView";
|
||||
public static final String ENHANCED_LIST_PAGE_VIEW_COMPONENT = "EnhancedListPageView";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int SAMPLE_LIST1_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 0;
|
||||
protected static final int SAMPLE_LIST1_ASSOCIATION_SELECTION_ASSOCIATION_0 = 1;
|
||||
protected static final int SAMPLE_LIST1_ASSOCIATION_DATA_0_ASSOCIATION_0 = 2;
|
||||
protected static final int SAMPLE_LIST1_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0 = 3;
|
||||
protected static final int SAMPLE_LIST1_ASSOCIATION_ITEM_IMAGE_ASSOCIATION_0 = 4;
|
||||
protected static final int INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0 = 5;
|
||||
protected static final int INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0 = 6;
|
||||
|
||||
//Method Association Identifiers//
|
||||
protected static final int UNNAMED_COMPONENT1_SELECTION_METHOD_ASSOCIATION = 0;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.Label sampleList1Label = null;
|
||||
private com.foundation.view.swt.EnhancedList sampleList1 = null;
|
||||
private com.foundation.view.swt.EnhancedList.IHiddenColor sampleList1HiddenDataPart0 = null;
|
||||
private com.foundation.view.swt.Menu unnamedComponent0 = null;
|
||||
private com.foundation.view.swt.Menu unnamedComponent1 = null;
|
||||
private com.foundation.view.swt.PanelViewer innerView = null;
|
||||
/**
|
||||
* EnhancedListPageView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public EnhancedListPageView() {
|
||||
}//EnhancedListPageView()//
|
||||
/**
|
||||
* EnhancedListPageView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public EnhancedListPageView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, ENHANCED_LIST_PAGE_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//EnhancedListPageView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.EnhancedListPageViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeSampleList1Label(com.foundation.view.swt.Container parent) {
|
||||
sampleList1Label = new com.foundation.view.swt.Label(parent, SAMPLE_LIST1_LABEL_COMPONENT, 0);
|
||||
|
||||
sampleList1Label.setText("Sample list box:");
|
||||
}//initializeSampleList1Label()//
|
||||
public void initializeSampleList1PopupMenu(com.foundation.view.IAbstractComponent parent) {
|
||||
unnamedComponent0 = new com.foundation.view.swt.Menu(sampleList1, null, com.foundation.view.swt.Menu.STYLE_POPUP);
|
||||
|
||||
unnamedComponent1 = new com.foundation.view.swt.Menu(unnamedComponent0, null, com.foundation.view.swt.Menu.STYLE_PUSH);
|
||||
|
||||
unnamedComponent1.setText("Test Menu Item");
|
||||
unnamedComponent1.setSelectionMethod(new com.foundation.view.MethodAssociation(this, UNNAMED_COMPONENT1_SELECTION_METHOD_ASSOCIATION, unnamedComponent1, "controllerHolder", null, null));
|
||||
}//initializeSampleList1PopupMenu()//
|
||||
public void initializeSampleList1(com.foundation.view.swt.Container parent) {
|
||||
sampleList1 = new com.foundation.view.swt.EnhancedList(parent, SAMPLE_LIST1_COMPONENT, com.foundation.view.swt.EnhancedList.STYLE_BORDER|com.foundation.view.swt.EnhancedList.STYLE_H_SCROLL);
|
||||
|
||||
sampleList1.setDecorateItems(true);
|
||||
sampleList1.setAutoSynchronizeSelection(true);
|
||||
sampleList1.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.EnhancedListPageViewController.class, SAMPLE_LIST1_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.EnhancedListPageViewController.class, test.local.view.controller.EnhancedListPageViewController.PROJECTS)}, null,true)}));
|
||||
sampleList1.setSelectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.EnhancedListPageViewController.class, SAMPLE_LIST1_ASSOCIATION_SELECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.EnhancedListPageViewController.class, test.local.view.controller.EnhancedListPageViewController.SELECTION)}, null,true)}));
|
||||
sampleList1HiddenDataPart0 = sampleList1.addHiddenColor();
|
||||
sampleList1HiddenDataPart0.setData(new com.foundation.view.JefColor("(255,255,0,0)"));
|
||||
sampleList1HiddenDataPart0.setDataAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(java.lang.Object.class, SAMPLE_LIST1_ASSOCIATION_DATA_0_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[0],"controllerHolder",true)}));
|
||||
initializeSampleList1PopupMenu(sampleList1);
|
||||
sampleList1.setItemTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Project.class, SAMPLE_LIST1_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Project.class, test.model.Project.NAME)}, null,true)}));
|
||||
sampleList1.setItemImageAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Project.class, SAMPLE_LIST1_ASSOCIATION_ITEM_IMAGE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[0],"controllerHolder",true)}));
|
||||
}//initializeSampleList1()//
|
||||
public void initializeInnerView(com.foundation.view.swt.Container parent) {
|
||||
innerView = new com.foundation.view.swt.PanelViewer(parent, INNER_VIEW_COMPONENT, com.foundation.view.swt.PanelViewer.STYLE_BORDER);
|
||||
|
||||
innerView.setControllerAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.EnhancedListPageViewController.class, INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.EnhancedListPageViewController.class, test.local.view.controller.EnhancedListPageViewController.EDITOR)}, null,true)}));
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(innerView);
|
||||
|
||||
innerView.setLayout(layout);
|
||||
innerView.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
innerView.setDefaultIsVisible(false);
|
||||
innerView.setIsVisibleAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.EnhancedListPageViewController.class, INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.EnhancedListPageViewController.class, test.local.view.controller.EnhancedListPageViewController.EDITOR)}, null,true)}));
|
||||
}//initializeInnerView()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeSampleList1Label(this);
|
||||
initializeSampleList1(this);
|
||||
initializeInnerView(this);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(this);
|
||||
|
||||
layout.setNumColumns(1);
|
||||
layout.setMarginHeight(5);
|
||||
layout.setMarginWidth(5);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
this.setDefaultContainerTitle("Enhanced List");
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
case UNNAMED_COMPONENT1_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.EnhancedListPageViewController) value).doSomething();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case SAMPLE_LIST1_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.EnhancedListPageViewController) value).getProjects();
|
||||
break;
|
||||
case SAMPLE_LIST1_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.EnhancedListPageViewController) value).getSelection();
|
||||
break;
|
||||
case SAMPLE_LIST1_ASSOCIATION_DATA_0_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.EnhancedListPageViewController) value).getObjectColor((java.lang.Object) parameters[0]);
|
||||
break;
|
||||
case SAMPLE_LIST1_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getName();
|
||||
break;
|
||||
case SAMPLE_LIST1_ASSOCIATION_ITEM_IMAGE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.EnhancedListPageViewController) value).getImage((test.model.Project) parameters[0]);
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.EnhancedListPageViewController) value).getEditor();
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.EnhancedListPageViewController) value).getEditor();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case SAMPLE_LIST1_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.EnhancedListPageViewController) value).getOldAttributeValue(test.local.view.controller.EnhancedListPageViewController.PROJECTS);
|
||||
break;
|
||||
case SAMPLE_LIST1_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.EnhancedListPageViewController) value).getOldAttributeValue(test.local.view.controller.EnhancedListPageViewController.SELECTION);
|
||||
break;
|
||||
case SAMPLE_LIST1_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getOldAttributeValue(test.model.Project.NAME);
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.EnhancedListPageViewController) value).getOldAttributeValue(test.local.view.controller.EnhancedListPageViewController.EDITOR);
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.EnhancedListPageViewController) value).getOldAttributeValue(test.local.view.controller.EnhancedListPageViewController.EDITOR);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
case SAMPLE_LIST1_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
((test.local.view.controller.EnhancedListPageViewController) value).setSelection((java.lang.Object) parameters[0]);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
{ //sampleList1//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.verticalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
layoutData.grabExcessVerticalSpace = true;
|
||||
sampleList1.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //innerView//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
innerView.setLayoutData(layoutData);
|
||||
}//block//
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
sampleList1HiddenDataPart0.addSelectionLink(new com.foundation.view.LinkData(sampleList1Label, com.foundation.view.swt.Label.LINK_TARGET_BACKGROUND_COLOR, null, false, false));
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpSampleList1Label() {
|
||||
return sampleList1Label;
|
||||
}//getVpSampleList1Label()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.EnhancedList getVpSampleList1() {
|
||||
return sampleList1;
|
||||
}//getVpSampleList1()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.EnhancedList.IHiddenColor getVpSampleList1HiddenDataPart0() {
|
||||
return sampleList1HiddenDataPart0;
|
||||
}//getVpSampleList1HiddenDataPart0()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Menu getVpUnnamedComponent0() {
|
||||
return unnamedComponent0;
|
||||
}//getVpUnnamedComponent0()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Menu getVpUnnamedComponent1() {
|
||||
return unnamedComponent1;
|
||||
}//getVpUnnamedComponent1()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.PanelViewer getVpInnerView() {
|
||||
return innerView;
|
||||
}//getVpInnerView()//
|
||||
}//EnhancedListPageView//
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0"?>
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<panel name="EnhancedListPageView" style="" container-title="Enhanced List">
|
||||
<grid-layout column-count="1" margin-width="5" margin-height="5"/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.EnhancedListPageViewController"/>
|
||||
|
||||
<label name="sampleList1Label" style="" text="Sample list box:"/>
|
||||
<enhanced-list name="sampleList1" style="border | horizontal scroll" auto-synchronize-selection="true" decorate-items="true">
|
||||
<grid-layout-data horizontal-alignment="fill" vertical-alignment="fill" horizontal-fill="true" vertical-fill="true"/>
|
||||
<association function="collection" attribute="projects" value-holder="controllerHolder"/>
|
||||
<association function="selection" attribute="selection" value-holder="controllerHolder"/>
|
||||
<association function="item-text" attribute="name" row-type="test.model.Project"/>
|
||||
<association function="item-image" getter="getImage" getter-signature="Ltest.model.Project;" row-type="test.model.Project" value-holder="controllerHolder"/> <!-- decorate="true" decoration-attribute="" -->
|
||||
|
||||
<hidden-color data="#FFFF00">
|
||||
<association function="data" getter="getObjectColor" getter-signature="Ljava.lang.Object;" row-type="java.lang.Object" value-holder="controllerHolder"/>
|
||||
<link function="selection" component="sampleList1Label" target="background-color"/>
|
||||
</hidden-color>
|
||||
|
||||
<menu-floating>
|
||||
<menu text="Test Menu Item">
|
||||
<method function="selection" name="doSomething" value-holder="controllerHolder"/>
|
||||
</menu>
|
||||
</menu-floating>
|
||||
</enhanced-list>
|
||||
<panel-viewer name="innerView" style="border" is-visible="false">
|
||||
<fill-layout/>
|
||||
<grid-layout-data horizontal-alignment="fill" horizontal-fill="true"/>
|
||||
|
||||
<association function="is-visible" attribute="editor" value-holder="controllerHolder"/>
|
||||
<association function="controller" attribute="editor" value-holder="controllerHolder"/>
|
||||
</panel-viewer>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,163 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* EnhancedListPerformanceTestView
|
||||
*/
|
||||
public class EnhancedListPerformanceTestView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String ENHANCED_LIST_PERFORMANCE_TEST_VIEW_COMPONENT = "EnhancedListPerformanceTestView";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int UNNAMED_COMPONENT0_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 0;
|
||||
protected static final int UNNAMED_COMPONENT0_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0 = 1;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.EnhancedList unnamedComponent0 = null;
|
||||
/**
|
||||
* EnhancedListPerformanceTestView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public EnhancedListPerformanceTestView() {
|
||||
}//EnhancedListPerformanceTestView()//
|
||||
/**
|
||||
* EnhancedListPerformanceTestView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public EnhancedListPerformanceTestView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, ENHANCED_LIST_PERFORMANCE_TEST_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//EnhancedListPerformanceTestView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.EnhancedListPerformanceTestViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeUnnamedComponent0(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent0 = new com.foundation.view.swt.EnhancedList(parent, null, com.foundation.view.swt.EnhancedList.STYLE_BORDER);
|
||||
|
||||
unnamedComponent0.setDecorateItems(true);
|
||||
unnamedComponent0.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.EnhancedListPerformanceTestViewController.class, UNNAMED_COMPONENT0_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.EnhancedListPerformanceTestViewController.class, test.local.view.controller.EnhancedListPerformanceTestViewController.COLLECTION)}, null,true)}));
|
||||
unnamedComponent0.setItemTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(java.lang.Object.class, UNNAMED_COMPONENT0_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[0], null,true)}));
|
||||
}//initializeUnnamedComponent0()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeUnnamedComponent0(this);
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(this);
|
||||
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case UNNAMED_COMPONENT0_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.EnhancedListPerformanceTestViewController) value).getCollection();
|
||||
break;
|
||||
case UNNAMED_COMPONENT0_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0:
|
||||
result = ((java.lang.Object) value).toString();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case UNNAMED_COMPONENT0_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.EnhancedListPerformanceTestViewController) value).getOldAttributeValue(test.local.view.controller.EnhancedListPerformanceTestViewController.COLLECTION);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.EnhancedList getVpUnnamedComponent0() {
|
||||
return unnamedComponent0;
|
||||
}//getVpUnnamedComponent0()//
|
||||
}//EnhancedListPerformanceTestView//
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2009,2008 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<panel name="EnhancedListPerformanceTestView" style="" container-image="" container-title="">
|
||||
<fill-layout/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.EnhancedListPerformanceTestViewController"/>
|
||||
|
||||
<enhanced-list style="border" decorate-items="true">
|
||||
<association function="collection" attribute="collection" value-holder="controllerHolder"/>
|
||||
<association function="item-text" getter="toString" row-type="java.lang.Object"/>
|
||||
</enhanced-list>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,201 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* ExpandBarPageView
|
||||
*/
|
||||
public class ExpandBarPageView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String SAMPLE_EXPAND_BAR_COMPONENT = "sampleExpandBar";
|
||||
public static final String ITEM1_LABEL_COMPONENT = "item1Label";
|
||||
public static final String ITEM2_LABEL_COMPONENT = "item2Label";
|
||||
public static final String ITEM3_LABEL_COMPONENT = "item3Label";
|
||||
public static final String EXPAND_BAR_PAGE_VIEW_COMPONENT = "ExpandBarPageView";
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.ExpandBar sampleExpandBar = null;
|
||||
private com.foundation.view.swt.Label item1Label = null;
|
||||
private com.foundation.view.swt.Label item2Label = null;
|
||||
private com.foundation.view.swt.Label item3Label = null;
|
||||
/**
|
||||
* ExpandBarPageView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public ExpandBarPageView() {
|
||||
}//ExpandBarPageView()//
|
||||
/**
|
||||
* ExpandBarPageView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public ExpandBarPageView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, EXPAND_BAR_PAGE_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//ExpandBarPageView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.ExpandBarPageViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeItem1Label(com.foundation.view.swt.Container parent) {
|
||||
item1Label = new com.foundation.view.swt.Label(parent, ITEM1_LABEL_COMPONENT, 0);
|
||||
|
||||
item1Label.setText("...item1...");
|
||||
item1Label.setDefaultContainerTitle("First Item");
|
||||
}//initializeItem1Label()//
|
||||
public void initializeItem2Label(com.foundation.view.swt.Container parent) {
|
||||
item2Label = new com.foundation.view.swt.Label(parent, ITEM2_LABEL_COMPONENT, 0);
|
||||
|
||||
item2Label.setText("...item2...");
|
||||
item2Label.setDefaultContainerTitle("Second Item");
|
||||
}//initializeItem2Label()//
|
||||
public void initializeItem3Label(com.foundation.view.swt.Container parent) {
|
||||
item3Label = new com.foundation.view.swt.Label(parent, ITEM3_LABEL_COMPONENT, 0);
|
||||
|
||||
item3Label.setText("...item3...");
|
||||
item3Label.setDefaultContainerTitle("Third Item");
|
||||
}//initializeItem3Label()//
|
||||
public void initializeSampleExpandBar(com.foundation.view.swt.Container parent) {
|
||||
sampleExpandBar = new com.foundation.view.swt.ExpandBar(parent, SAMPLE_EXPAND_BAR_COMPONENT, com.foundation.view.swt.ExpandBar.STYLE_BORDER);
|
||||
|
||||
initializeItem1Label(sampleExpandBar);
|
||||
initializeItem2Label(sampleExpandBar);
|
||||
initializeItem3Label(sampleExpandBar);
|
||||
sampleExpandBar.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
}//initializeSampleExpandBar()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeSampleExpandBar(this);
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(this);
|
||||
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
this.setDefaultContainerTitle("Expand Bar");
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ExpandBar getVpSampleExpandBar() {
|
||||
return sampleExpandBar;
|
||||
}//getVpSampleExpandBar()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpItem1Label() {
|
||||
return item1Label;
|
||||
}//getVpItem1Label()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpItem2Label() {
|
||||
return item2Label;
|
||||
}//getVpItem2Label()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpItem3Label() {
|
||||
return item3Label;
|
||||
}//getVpItem3Label()//
|
||||
}//ExpandBarPageView//
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2009,2008 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<panel name="ExpandBarPageView" style="" container-title="Expand Bar">
|
||||
<fill-layout/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.ExpandBarPageViewController"/>
|
||||
|
||||
<expand-bar name="sampleExpandBar" style="border">
|
||||
<item name="item1">
|
||||
<label name="item1Label" text="...item1..." container-title="First Item"/>
|
||||
</item>
|
||||
<item name="item2">
|
||||
<label name="item2Label" text="...item2..." container-title="Second Item"/>
|
||||
</item>
|
||||
<item name="item2">
|
||||
<label name="item3Label" text="...item3..." container-title="Third Item"/>
|
||||
</item>
|
||||
</expand-bar>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,179 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* ImagePageView
|
||||
*/
|
||||
public class ImagePageView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String UPLOAD_IMAGE_BUTTON_COMPONENT = "uploadImageButton";
|
||||
public static final String DOWNLOAD_IMAGE_BUTTON_COMPONENT = "downloadImageButton";
|
||||
public static final String IMAGE_PAGE_VIEW_COMPONENT = "ImagePageView";
|
||||
|
||||
//Method Association Identifiers//
|
||||
protected static final int UPLOAD_IMAGE_BUTTON_SELECTION_METHOD_ASSOCIATION = 0;
|
||||
protected static final int DOWNLOAD_IMAGE_BUTTON_SELECTION_METHOD_ASSOCIATION = 1;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.Button uploadImageButton = null;
|
||||
private com.foundation.view.swt.Button downloadImageButton = null;
|
||||
/**
|
||||
* ImagePageView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public ImagePageView() {
|
||||
}//ImagePageView()//
|
||||
/**
|
||||
* ImagePageView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public ImagePageView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, IMAGE_PAGE_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//ImagePageView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.ImagePageViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeUploadImageButton(com.foundation.view.swt.Container parent) {
|
||||
uploadImageButton = new com.foundation.view.swt.Button(parent, UPLOAD_IMAGE_BUTTON_COMPONENT, 0);
|
||||
|
||||
uploadImageButton.setText("Upload Image");
|
||||
uploadImageButton.setSelectionMethod(new com.foundation.view.MethodAssociation(this, UPLOAD_IMAGE_BUTTON_SELECTION_METHOD_ASSOCIATION, uploadImageButton, "controllerHolder", null, null));
|
||||
}//initializeUploadImageButton()//
|
||||
public void initializeDownloadImageButton(com.foundation.view.swt.Container parent) {
|
||||
downloadImageButton = new com.foundation.view.swt.Button(parent, DOWNLOAD_IMAGE_BUTTON_COMPONENT, 0);
|
||||
|
||||
downloadImageButton.setText("Download Image");
|
||||
downloadImageButton.setSelectionMethod(new com.foundation.view.MethodAssociation(this, DOWNLOAD_IMAGE_BUTTON_SELECTION_METHOD_ASSOCIATION, downloadImageButton, "controllerHolder", null, null));
|
||||
}//initializeDownloadImageButton()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeUploadImageButton(this);
|
||||
initializeDownloadImageButton(this);
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(this);
|
||||
|
||||
layout.setType(org.eclipse.swt.SWT.VERTICAL);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
this.setDefaultContainerTitle("Image");
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
case UPLOAD_IMAGE_BUTTON_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.ImagePageViewController) value).doUploadImage();
|
||||
break;
|
||||
case DOWNLOAD_IMAGE_BUTTON_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.ImagePageViewController) value).doDownloadImage();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpUploadImageButton() {
|
||||
return uploadImageButton;
|
||||
}//getVpUploadImageButton()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpDownloadImageButton() {
|
||||
return downloadImageButton;
|
||||
}//getVpDownloadImageButton()//
|
||||
}//ImagePageView//
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2009,2008 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<panel name="ImagePageView" style="" container-title="Image">
|
||||
<fill-layout direction="vertical"/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.ImagePageViewController"/>
|
||||
|
||||
<button name="uploadImageButton" style="" text="Upload Image">
|
||||
<method function="selection" name="doUploadImage" signature="" value-holder="controllerHolder"/>
|
||||
</button>
|
||||
<button name="downloadImageButton" style="" text="Download Image">
|
||||
<method function="selection" name="doDownloadImage" signature="" value-holder="controllerHolder"/>
|
||||
</button>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,165 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* InnerViewPageView
|
||||
*/
|
||||
public class InnerViewPageView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String INNER_VIEW_COMPONENT = "innerView";
|
||||
public static final String INNER_VIEW_PAGE_VIEW_COMPONENT = "InnerViewPageView";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0 = 0;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.PanelViewer innerView = null;
|
||||
/**
|
||||
* InnerViewPageView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public InnerViewPageView() {
|
||||
}//InnerViewPageView()//
|
||||
/**
|
||||
* InnerViewPageView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public InnerViewPageView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, INNER_VIEW_PAGE_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//InnerViewPageView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.InnerViewPageViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeInnerView(com.foundation.view.swt.Container parent) {
|
||||
innerView = new com.foundation.view.swt.PanelViewer(parent, INNER_VIEW_COMPONENT, 0);
|
||||
|
||||
innerView.setControllerAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.InnerViewPageViewController.class, INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.InnerViewPageViewController.class, test.local.view.controller.InnerViewPageViewController.INNER_VIEW)}, null,true)}));
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(innerView);
|
||||
|
||||
innerView.setLayout(layout);
|
||||
innerView.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
innerView.setDefaultBackgroundColor(new com.foundation.view.JefGradient("red"));
|
||||
}//initializeInnerView()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeInnerView(this);
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(this);
|
||||
|
||||
layout.setType(org.eclipse.swt.SWT.VERTICAL);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
this.setDefaultContainerTitle("Inner View");
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.InnerViewPageViewController) value).getInnerView();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.InnerViewPageViewController) value).getOldAttributeValue(test.local.view.controller.InnerViewPageViewController.INNER_VIEW);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.PanelViewer getVpInnerView() {
|
||||
return innerView;
|
||||
}//getVpInnerView()//
|
||||
}//InnerViewPageView//
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2009,2008 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<panel name="InnerViewPageView" style="" container-title="Inner View">
|
||||
<fill-layout direction="vertical"/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.InnerViewPageViewController"/>
|
||||
|
||||
<panel-viewer name="innerView" style="" background-color="red">
|
||||
<fill-layout/>
|
||||
<association function="controller" attribute="innerView" value-holder="controllerHolder"/>
|
||||
</panel-viewer>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,267 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* ListPageView
|
||||
*/
|
||||
public class ListPageView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String SAMPLE_LIST1_LABEL_COMPONENT = "sampleList1Label";
|
||||
public static final String SAMPLE_LIST1_COMPONENT = "sampleList1";
|
||||
public static final String INNER_VIEW_COMPONENT = "innerView";
|
||||
public static final String LIST_PAGE_VIEW_COMPONENT = "ListPageView";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int SAMPLE_LIST1_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 0;
|
||||
protected static final int SAMPLE_LIST1_ASSOCIATION_SELECTION_ASSOCIATION_0 = 1;
|
||||
protected static final int SAMPLE_LIST1_ASSOCIATION_DATA_0_ASSOCIATION_0 = 2;
|
||||
protected static final int SAMPLE_LIST1_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0 = 3;
|
||||
protected static final int INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0 = 4;
|
||||
protected static final int INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0 = 5;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.Label sampleList1Label = null;
|
||||
private com.foundation.view.swt.ListBox sampleList1 = null;
|
||||
private com.foundation.view.swt.ListBox.IHiddenColor sampleList1HiddenDataPart0 = null;
|
||||
private com.foundation.view.swt.PanelViewer innerView = null;
|
||||
/**
|
||||
* ListPageView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public ListPageView() {
|
||||
}//ListPageView()//
|
||||
/**
|
||||
* ListPageView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public ListPageView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, LIST_PAGE_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//ListPageView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.ListPageViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeSampleList1Label(com.foundation.view.swt.Container parent) {
|
||||
sampleList1Label = new com.foundation.view.swt.Label(parent, SAMPLE_LIST1_LABEL_COMPONENT, 0);
|
||||
|
||||
sampleList1Label.setText("Sample list box:");
|
||||
}//initializeSampleList1Label()//
|
||||
public void initializeSampleList1(com.foundation.view.swt.Container parent) {
|
||||
sampleList1 = new com.foundation.view.swt.ListBox(parent, SAMPLE_LIST1_COMPONENT, com.foundation.view.swt.ListBox.STYLE_BORDER);
|
||||
|
||||
sampleList1.setAutoSynchronizeSelection(true);
|
||||
sampleList1.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ListPageViewController.class, SAMPLE_LIST1_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ListPageViewController.class, test.local.view.controller.ListPageViewController.PROJECTS)}, null,true)}));
|
||||
sampleList1.setSelectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ListPageViewController.class, SAMPLE_LIST1_ASSOCIATION_SELECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ListPageViewController.class, test.local.view.controller.ListPageViewController.SELECTION)}, null,true)}));
|
||||
sampleList1HiddenDataPart0 = sampleList1.addHiddenColor();
|
||||
sampleList1HiddenDataPart0.setData(new com.foundation.view.JefColor("(255,255,0,0)"));
|
||||
sampleList1HiddenDataPart0.setDataAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(java.lang.Object.class, SAMPLE_LIST1_ASSOCIATION_DATA_0_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[0],"controllerHolder",true)}));
|
||||
sampleList1.setItemTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Project.class, SAMPLE_LIST1_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Project.class, test.model.Project.NAME)}, null,true)}));
|
||||
}//initializeSampleList1()//
|
||||
public void initializeInnerView(com.foundation.view.swt.Container parent) {
|
||||
innerView = new com.foundation.view.swt.PanelViewer(parent, INNER_VIEW_COMPONENT, com.foundation.view.swt.PanelViewer.STYLE_BORDER);
|
||||
|
||||
innerView.setControllerAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ListPageViewController.class, INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ListPageViewController.class, test.local.view.controller.ListPageViewController.EDITOR)}, null,true)}));
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(innerView);
|
||||
|
||||
innerView.setLayout(layout);
|
||||
innerView.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
innerView.setDefaultIsVisible(false);
|
||||
innerView.setIsVisibleAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ListPageViewController.class, INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ListPageViewController.class, test.local.view.controller.ListPageViewController.EDITOR)}, null,true)}));
|
||||
}//initializeInnerView()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeSampleList1Label(this);
|
||||
initializeSampleList1(this);
|
||||
initializeInnerView(this);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(this);
|
||||
|
||||
layout.setNumColumns(1);
|
||||
layout.setMarginHeight(5);
|
||||
layout.setMarginWidth(5);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
this.setDefaultContainerTitle("List");
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case SAMPLE_LIST1_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ListPageViewController) value).getProjects();
|
||||
break;
|
||||
case SAMPLE_LIST1_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ListPageViewController) value).getSelection();
|
||||
break;
|
||||
case SAMPLE_LIST1_ASSOCIATION_DATA_0_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ListPageViewController) value).getObjectColor((java.lang.Object) parameters[0]);
|
||||
break;
|
||||
case SAMPLE_LIST1_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getName();
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ListPageViewController) value).getEditor();
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ListPageViewController) value).getEditor();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case SAMPLE_LIST1_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ListPageViewController) value).getOldAttributeValue(test.local.view.controller.ListPageViewController.PROJECTS);
|
||||
break;
|
||||
case SAMPLE_LIST1_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ListPageViewController) value).getOldAttributeValue(test.local.view.controller.ListPageViewController.SELECTION);
|
||||
break;
|
||||
case SAMPLE_LIST1_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getOldAttributeValue(test.model.Project.NAME);
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ListPageViewController) value).getOldAttributeValue(test.local.view.controller.ListPageViewController.EDITOR);
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ListPageViewController) value).getOldAttributeValue(test.local.view.controller.ListPageViewController.EDITOR);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
case SAMPLE_LIST1_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
((test.local.view.controller.ListPageViewController) value).setSelection((java.lang.Object) parameters[0]);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
{ //sampleList1//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.verticalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
layoutData.grabExcessVerticalSpace = true;
|
||||
sampleList1.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //innerView//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
innerView.setLayoutData(layoutData);
|
||||
}//block//
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
sampleList1HiddenDataPart0.addSelectionLink(new com.foundation.view.LinkData(sampleList1Label, com.foundation.view.swt.Label.LINK_TARGET_BACKGROUND_COLOR, null, false, false));
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpSampleList1Label() {
|
||||
return sampleList1Label;
|
||||
}//getVpSampleList1Label()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ListBox getVpSampleList1() {
|
||||
return sampleList1;
|
||||
}//getVpSampleList1()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ListBox.IHiddenColor getVpSampleList1HiddenDataPart0() {
|
||||
return sampleList1HiddenDataPart0;
|
||||
}//getVpSampleList1HiddenDataPart0()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.PanelViewer getVpInnerView() {
|
||||
return innerView;
|
||||
}//getVpInnerView()//
|
||||
}//ListPageView//
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2009,2008 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<panel name="ListPageView" style="" container-title="List">
|
||||
<grid-layout column-count="1" margin-width="5" margin-height="5"/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.ListPageViewController"/>
|
||||
|
||||
<label name="sampleList1Label" style="" text="Sample list box:"/>
|
||||
<list name="sampleList1" style="border" auto-synchronize-selection="true">
|
||||
<grid-layout-data horizontal-alignment="fill" vertical-alignment="fill" horizontal-fill="true" vertical-fill="true"/>
|
||||
<association function="collection" attribute="projects" value-holder="controllerHolder"/>
|
||||
<association function="selection" attribute="selection" value-holder="controllerHolder"/>
|
||||
<association function="item-text" attribute="name" row-type="test.model.Project"/>
|
||||
|
||||
<hidden-color data="#FFFF00">
|
||||
<association function="data" getter="getObjectColor" getter-signature="Ljava.lang.Object;" row-type="java.lang.Object" value-holder="controllerHolder"/>
|
||||
<link function="selection" component="sampleList1Label" target="background-color"/>
|
||||
</hidden-color>
|
||||
</list>
|
||||
<panel-viewer name="innerView" style="border" is-visible="false">
|
||||
<fill-layout/>
|
||||
<grid-layout-data horizontal-alignment="fill" horizontal-fill="true"/>
|
||||
|
||||
<association function="is-visible" attribute="editor" value-holder="controllerHolder"/>
|
||||
<association function="controller" attribute="editor" value-holder="controllerHolder"/>
|
||||
</panel-viewer>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,157 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* ListPerformanceTestView
|
||||
*/
|
||||
public class ListPerformanceTestView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String LIST_PERFORMANCE_TEST_VIEW_COMPONENT = "ListPerformanceTestView";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int UNNAMED_COMPONENT0_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 0;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.ListBox unnamedComponent0 = null;
|
||||
/**
|
||||
* ListPerformanceTestView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public ListPerformanceTestView() {
|
||||
}//ListPerformanceTestView()//
|
||||
/**
|
||||
* ListPerformanceTestView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public ListPerformanceTestView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, LIST_PERFORMANCE_TEST_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//ListPerformanceTestView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.ListPerformanceTestViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeUnnamedComponent0(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent0 = new com.foundation.view.swt.ListBox(parent, null, com.foundation.view.swt.ListBox.STYLE_BORDER|com.foundation.view.swt.ListBox.STYLE_V_SCROLL);
|
||||
|
||||
unnamedComponent0.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ListPerformanceTestViewController.class, UNNAMED_COMPONENT0_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ListPerformanceTestViewController.class, test.local.view.controller.ListPerformanceTestViewController.COLLECTION)}, null,true)}));
|
||||
}//initializeUnnamedComponent0()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeUnnamedComponent0(this);
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(this);
|
||||
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case UNNAMED_COMPONENT0_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ListPerformanceTestViewController) value).getCollection();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case UNNAMED_COMPONENT0_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ListPerformanceTestViewController) value).getOldAttributeValue(test.local.view.controller.ListPerformanceTestViewController.COLLECTION);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ListBox getVpUnnamedComponent0() {
|
||||
return unnamedComponent0;
|
||||
}//getVpUnnamedComponent0()//
|
||||
}//ListPerformanceTestView//
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2009,2008 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<panel name="ListPerformanceTestView" style="" container-image="" container-title="">
|
||||
<fill-layout/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.ListPerformanceTestViewController"/>
|
||||
|
||||
<list style="border | vertical scroll">
|
||||
<association function="collection" attribute="collection" value-holder="controllerHolder"/>
|
||||
</list>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,443 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* MainView
|
||||
*/
|
||||
public class MainView extends com.foundation.view.swt.Window implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String SAMPLE_TAB_PANEL_COMPONENT = "sampleTabPanel";
|
||||
public static final String SCROLL_PANEL_COMPONENT = "scrollPanel";
|
||||
public static final String CONTENT1_COMPONENT = "content1";
|
||||
public static final String CONTENT2_COMPONENT = "content2";
|
||||
public static final String BUTTON_PANEL_COMPONENT = "buttonPanel";
|
||||
public static final String OK_BUTTON_COMPONENT = "okButton";
|
||||
public static final String CANCEL_BUTTON_COMPONENT = "cancelButton";
|
||||
public static final String NOBG_PANEL_COMPONENT = "nobgPanel";
|
||||
public static final String MAIN_VIEW_COMPONENT = "MainView";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int SAMPLE_TAB_PANEL_ASSOCIATION_PAGES_ASSOCIATION_0 = 0;
|
||||
|
||||
//Method Association Identifiers//
|
||||
protected static final int THIS_CLOSED_METHOD_ASSOCIATION = 0;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.TabPanel sampleTabPanel = null;
|
||||
private com.foundation.view.swt.Panel scrollPanel = null;
|
||||
private com.foundation.view.swt.Panel content1 = null;
|
||||
private com.foundation.view.swt.Button unnamedComponent0 = null;
|
||||
private com.foundation.view.swt.Panel content2 = null;
|
||||
private com.foundation.view.swt.Panel buttonPanel = null;
|
||||
private com.foundation.view.swt.Button okButton = null;
|
||||
private com.foundation.view.swt.Button cancelButton = null;
|
||||
private com.foundation.view.swt.Panel unnamedComponent1 = null;
|
||||
private com.foundation.view.swt.Panel nobgPanel = null;
|
||||
private com.foundation.view.swt.Panel unnamedComponent2 = null;
|
||||
private com.foundation.view.swt.Label unnamedComponent3 = null;
|
||||
private com.foundation.view.swt.Label unnamedComponent4 = null;
|
||||
private com.foundation.view.swt.Button unnamedComponent5 = null;
|
||||
/**
|
||||
* MainView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public MainView() {
|
||||
}//MainView()//
|
||||
/**
|
||||
* MainView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
*/
|
||||
public MainView(com.foundation.controller.ViewController controller) {
|
||||
super((com.foundation.controller.ViewController) controller.getParent(), MAIN_VIEW_COMPONENT, com.foundation.view.swt.Window.STYLE_SHELL_TRIM, controller.getContext(), controller);
|
||||
|
||||
}//MainView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.MainViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeContent1(com.foundation.view.swt.Container parent) {
|
||||
content1 = new com.foundation.view.swt.Panel(parent, CONTENT1_COMPONENT, 0);
|
||||
|
||||
content1.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
content1.setDefaultBackgroundColor(new com.foundation.view.JefGradient("red"));
|
||||
}//initializeContent1()//
|
||||
public void initializeUnnamedComponent0(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent0 = new com.foundation.view.swt.Button(parent, null, com.foundation.view.swt.Button.STYLE_CHECK);
|
||||
|
||||
unnamedComponent0.setText("Visibility");
|
||||
unnamedComponent0.setIsSelected(Boolean.FALSE);
|
||||
unnamedComponent0.setDefaultBackgroundColor(new com.foundation.view.JefGradient("(143,255,143,0)"));
|
||||
}//initializeUnnamedComponent0()//
|
||||
public void initializeContent2(com.foundation.view.swt.Container parent) {
|
||||
content2 = new com.foundation.view.swt.Panel(parent, CONTENT2_COMPONENT, 0);
|
||||
|
||||
content2.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
content2.setDefaultIsVisible(false);
|
||||
content2.setDefaultBackgroundColor(new com.foundation.view.JefGradient("blue"));
|
||||
}//initializeContent2()//
|
||||
public void initializeOkButton(com.foundation.view.swt.Container parent) {
|
||||
okButton = new com.foundation.view.swt.Button(parent, OK_BUTTON_COMPONENT, 0);
|
||||
|
||||
okButton.setText("Ok");
|
||||
}//initializeOkButton()//
|
||||
public void initializeCancelButton(com.foundation.view.swt.Container parent) {
|
||||
cancelButton = new com.foundation.view.swt.Button(parent, CANCEL_BUTTON_COMPONENT, 0);
|
||||
|
||||
cancelButton.setText("Cancel");
|
||||
}//initializeCancelButton()//
|
||||
public void initializeButtonPanel(com.foundation.view.swt.Container parent) {
|
||||
buttonPanel = new com.foundation.view.swt.Panel(parent, BUTTON_PANEL_COMPONENT, 0);
|
||||
|
||||
initializeOkButton(buttonPanel);
|
||||
initializeCancelButton(buttonPanel);
|
||||
com.foundation.view.swt.RowLayout layout = new com.foundation.view.swt.RowLayout(buttonPanel);
|
||||
|
||||
layout.setSpacing(10);
|
||||
layout.setWrap(false);
|
||||
layout.setPack(false);
|
||||
layout.setAlignment(org.eclipse.swt.SWT.END);
|
||||
layout.setJustify(false);
|
||||
buttonPanel.setLayout(layout);
|
||||
buttonPanel.setTabOrder(new com.common.util.LiteList(new Object[] {okButton, cancelButton}));
|
||||
buttonPanel.setDefaultBackgroundColor(new com.foundation.view.JefGradient("yellow"));
|
||||
}//initializeButtonPanel()//
|
||||
public void initializeScrollPanel(com.foundation.view.swt.Container parent) {
|
||||
scrollPanel = new com.foundation.view.swt.Panel(parent, SCROLL_PANEL_COMPONENT, com.foundation.view.swt.Panel.STYLE_V_SCROLL);
|
||||
|
||||
initializeContent1(scrollPanel);
|
||||
initializeUnnamedComponent0(scrollPanel);
|
||||
initializeContent2(scrollPanel);
|
||||
initializeButtonPanel(scrollPanel);
|
||||
com.foundation.view.swt.RowLayout layout = new com.foundation.view.swt.RowLayout(scrollPanel);
|
||||
|
||||
layout.setType(org.eclipse.swt.SWT.VERTICAL);
|
||||
layout.setMarginHeight(30);
|
||||
layout.setMarginWidth(30);
|
||||
layout.setWrap(false);
|
||||
layout.setAlignment(org.eclipse.swt.SWT.FILL);
|
||||
scrollPanel.setLayout(layout);
|
||||
scrollPanel.setTabOrder(new com.common.util.LiteList(new Object[] {buttonPanel}));
|
||||
scrollPanel.setDefaultContainerTitle("Red|Blue");
|
||||
}//initializeScrollPanel()//
|
||||
public void initializeUnnamedComponent3(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent3 = new com.foundation.view.swt.Label(parent, null, 0);
|
||||
|
||||
unnamedComponent3.setText("A short message to you!");
|
||||
}//initializeUnnamedComponent3()//
|
||||
public void initializeUnnamedComponent2(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent2 = new com.foundation.view.swt.Panel(parent, null, 0);
|
||||
|
||||
initializeUnnamedComponent3(unnamedComponent2);
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(unnamedComponent2);
|
||||
|
||||
unnamedComponent2.setLayout(layout);
|
||||
unnamedComponent2.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
}//initializeUnnamedComponent2()//
|
||||
public void initializeNobgPanel(com.foundation.view.swt.Container parent) {
|
||||
nobgPanel = new com.foundation.view.swt.Panel(parent, NOBG_PANEL_COMPONENT, com.foundation.view.swt.Panel.STYLE_NO_BACKGROUND);
|
||||
|
||||
nobgPanel.setInheritBackground(com.foundation.view.swt.Panel.INHERIT_FORCE);
|
||||
initializeUnnamedComponent2(nobgPanel);
|
||||
com.foundation.view.swt.CenterLayout layout = new com.foundation.view.swt.CenterLayout(nobgPanel);
|
||||
|
||||
nobgPanel.setLayout(layout);
|
||||
nobgPanel.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
nobgPanel.setDefaultIsVisible(false);
|
||||
nobgPanel.setDefaultBackgroundColor(new com.foundation.view.JefGradient("(15,15,255,143)"));
|
||||
}//initializeNobgPanel()//
|
||||
public void initializeUnnamedComponent4(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent4 = new com.foundation.view.swt.Label(parent, null, com.foundation.view.swt.Label.STYLE_WRAP);
|
||||
|
||||
unnamedComponent4.setText("This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap.");
|
||||
}//initializeUnnamedComponent4()//
|
||||
public void initializeUnnamedComponent5(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent5 = new com.foundation.view.swt.Button(parent, null, com.foundation.view.swt.Button.STYLE_CHECK);
|
||||
|
||||
unnamedComponent5.setText("Visibility");
|
||||
unnamedComponent5.setIsSelected(Boolean.FALSE);
|
||||
}//initializeUnnamedComponent5()//
|
||||
public void initializeUnnamedComponent1(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent1 = new com.foundation.view.swt.Panel(parent, null, 0);
|
||||
|
||||
initializeNobgPanel(unnamedComponent1);
|
||||
initializeUnnamedComponent4(unnamedComponent1);
|
||||
initializeUnnamedComponent5(unnamedComponent1);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(unnamedComponent1);
|
||||
|
||||
layout.setNumColumns(1);
|
||||
unnamedComponent1.setLayout(layout);
|
||||
unnamedComponent1.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
unnamedComponent1.setDefaultContainerTitle("Overlay Example");
|
||||
}//initializeUnnamedComponent1()//
|
||||
public void initializeSampleTabPanel(com.foundation.view.swt.Container parent) {
|
||||
sampleTabPanel = new com.foundation.view.swt.TabPanel(parent, SAMPLE_TAB_PANEL_COMPONENT, 0);
|
||||
|
||||
com.foundation.view.swt.TabPanel.IPagesHolder pagesHolder = sampleTabPanel.addPages();
|
||||
pagesHolder.setPagesAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.MainViewController.class, SAMPLE_TAB_PANEL_ASSOCIATION_PAGES_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.MainViewController.class, test.local.view.controller.MainViewController.TAB_VIEW_CONTROLLERS)}, null,true)}));
|
||||
initializeScrollPanel(sampleTabPanel);
|
||||
initializeUnnamedComponent1(sampleTabPanel);
|
||||
sampleTabPanel.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
}//initializeSampleTabPanel()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
this.setClosedMethod(new com.foundation.view.MethodAssociation(this, THIS_CLOSED_METHOD_ASSOCIATION, this, "controllerHolder", null, null));
|
||||
initializeControllerHolder(this);
|
||||
initializeSampleTabPanel(this);
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(this);
|
||||
|
||||
layout.setType(org.eclipse.swt.SWT.VERTICAL);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {sampleTabPanel}));
|
||||
this.setSize(900, 1100);
|
||||
this.setDefaultContainerTitle("Component Test System");
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#pack()
|
||||
*/
|
||||
public void pack() {
|
||||
//Don't pack since a custom size was specified.
|
||||
}//pack()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
case THIS_CLOSED_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.MainViewController) value).doClose();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case SAMPLE_TAB_PANEL_ASSOCIATION_PAGES_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.MainViewController) value).getTabViewControllers();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case SAMPLE_TAB_PANEL_ASSOCIATION_PAGES_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.MainViewController) value).getOldAttributeValue(test.local.view.controller.MainViewController.TAB_VIEW_CONTROLLERS);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
{ //content1//
|
||||
com.foundation.view.swt.layout.RowData layoutData = new com.foundation.view.swt.layout.RowData();
|
||||
|
||||
layoutData.height = 300;
|
||||
content1.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //content2//
|
||||
com.foundation.view.swt.layout.RowData layoutData = new com.foundation.view.swt.layout.RowData();
|
||||
|
||||
layoutData.height = 300;
|
||||
content2.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //nobgPanel//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.exclude = true;
|
||||
nobgPanel.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //null//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.verticalAlignment = com.foundation.view.swt.layout.GridData.BEGINNING;
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.BEGINNING;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
layoutData.grabExcessVerticalSpace = true;
|
||||
unnamedComponent4.setLayoutData(layoutData);
|
||||
}//block//
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
unnamedComponent0.addSelectionLink(new com.foundation.view.LinkData(content2, com.foundation.view.swt.Panel.LINK_TARGET_IS_VISIBLE, null, false, false));
|
||||
unnamedComponent5.addSelectionLink(new com.foundation.view.LinkData(nobgPanel, com.foundation.view.swt.Panel.LINK_TARGET_IS_VISIBLE, null, false, false));
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.TabPanel getVpSampleTabPanel() {
|
||||
return sampleTabPanel;
|
||||
}//getVpSampleTabPanel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Panel getVpScrollPanel() {
|
||||
return scrollPanel;
|
||||
}//getVpScrollPanel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Panel getVpContent1() {
|
||||
return content1;
|
||||
}//getVpContent1()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpUnnamedComponent0() {
|
||||
return unnamedComponent0;
|
||||
}//getVpUnnamedComponent0()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Panel getVpContent2() {
|
||||
return content2;
|
||||
}//getVpContent2()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Panel getVpButtonPanel() {
|
||||
return buttonPanel;
|
||||
}//getVpButtonPanel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpOkButton() {
|
||||
return okButton;
|
||||
}//getVpOkButton()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpCancelButton() {
|
||||
return cancelButton;
|
||||
}//getVpCancelButton()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Panel getVpUnnamedComponent1() {
|
||||
return unnamedComponent1;
|
||||
}//getVpUnnamedComponent1()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Panel getVpNobgPanel() {
|
||||
return nobgPanel;
|
||||
}//getVpNobgPanel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Panel getVpUnnamedComponent2() {
|
||||
return unnamedComponent2;
|
||||
}//getVpUnnamedComponent2()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpUnnamedComponent3() {
|
||||
return unnamedComponent3;
|
||||
}//getVpUnnamedComponent3()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpUnnamedComponent4() {
|
||||
return unnamedComponent4;
|
||||
}//getVpUnnamedComponent4()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpUnnamedComponent5() {
|
||||
return unnamedComponent5;
|
||||
}//getVpUnnamedComponent5()//
|
||||
}//MainView//
|
||||
@@ -0,0 +1,201 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2009,2008 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<window name="MainView" style="window trim" width="900" height="1100" container-title="Component Test System">
|
||||
<fill-layout direction="vertical"/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.MainViewController"/>
|
||||
<method function="closed" name="doClose" signature="" value-holder="controllerHolder"/>
|
||||
<!--
|
||||
<menu-bar>
|
||||
<menu-cascade name="fileMenu" text="File">
|
||||
<menu name="testMenuItem" text="Menu Item 1...">
|
||||
</menu>
|
||||
</menu-cascade>
|
||||
</menu-bar>
|
||||
-->
|
||||
|
||||
<tab-panel name="sampleTabPanel" style="" tab-order="1">
|
||||
<!--
|
||||
<page>
|
||||
<panel name="sampleButtonTabPanel" container-title="Buttons" tab-order="1">
|
||||
<grid-layout column-count="2" equal-width-columns="false" vertical-spacing="2" horizontal-spacing="2" margin-width="5" margin-height="5"/>
|
||||
|
||||
<label name="helpLabel" text="This tab displays the different types of buttons and shows off linking of the button selection states and the visibility and enabled state of the buttons.">
|
||||
<grid-layout-data horizontal-span="2"/>
|
||||
</label>
|
||||
|
||||
<panel name="sampleButtonPanel" tab-order="1" background-image="res://View/General/BackgroundImage" inherit-background="all">
|
||||
<grid-layout-data horizontal-span="2"/>
|
||||
<grid-layout column-count="2" equal-width-columns="false" vertical-spacing="2" horizontal-spacing="2" margin-width="20" margin-height="20"/>
|
||||
|
||||
<button name="sampleUpArrowButton" style="up-arrow" text="Sample Up Arrow Button" tab-order="1">
|
||||
</button>
|
||||
<button name="sampleDownArrowButton" style="down-arrow" text="Sample Down Arrow Button" tab-order="1">
|
||||
</button>
|
||||
<button name="sampleLeftArrowButton" style="left-arrow" text="Sample Left Arrow Button" tab-order="1">
|
||||
</button>
|
||||
<button name="sampleRightArrowButton" style="right-arrow" text="Sample Right Arrow Button" tab-order="1">
|
||||
</button>
|
||||
<button-toggle name="sampleCheckButton" style="check" text="Sample Check Button" tab-order="1">
|
||||
</button-toggle>
|
||||
<button-toggle name="sampleRadioButton" style="radio" text="Sample Radio Button" tab-order="1">
|
||||
</button-toggle>
|
||||
<button-toggle name="sampleToggleButton" style="toggle" text="Sample Toggle Button" tab-order="1">
|
||||
</button-toggle>
|
||||
<button name="sampleFlatButton" style="flat" text="Sample Flat Button" tab-order="1">
|
||||
</button>
|
||||
</panel>
|
||||
|
||||
<button name="showButton" style="" text="Show" tab-order="1">
|
||||
<link function="selection" component="sampleButtonPanel" target="is-visible" data="Boolean.TRUE"/>
|
||||
</button>
|
||||
<button name="hideButton" style="" text="Hide" tab-order="1">
|
||||
<link function="selection" component="sampleButtonPanel" target="is-visible" data="Boolean.FALSE"/>
|
||||
</button>
|
||||
<button-toggle name="enableButton" style="check" text="Enable" is-selected="true" tab-order="1">
|
||||
<grid-layout-data horizontal-span="2"/>
|
||||
<link function="selection" component="sampleButtonPanel" target="is-enabled"/>
|
||||
<link function="selection" component="showButton" target="is-enabled"/>
|
||||
<link function="selection" component="hideButton" target="is-enabled"/>
|
||||
</button-toggle>
|
||||
<button name="disabledButton" style="" text="Disabled" tab-order="1">
|
||||
<association function="is-enabled" attribute="nullAttribute" value-holder="controllerHolder"/>
|
||||
</button>
|
||||
<button name="enabledButton" style="" text="Enbled" tab-order="1">
|
||||
<association function="is-enabled" attribute="nonNullAttribute" value-holder="controllerHolder"/>
|
||||
</button>
|
||||
<button name="openDialog1Button" style="" text="Dialog 1" tab-order="1">
|
||||
<method function="selection" name="doOpenDialog1" value-holder="controllerHolder"/>
|
||||
</button>
|
||||
<button name="openDialog2Button" style="" text="Dialog 2" tab-order="1">
|
||||
<method function="selection" name="doOpenDialog2" value-holder="controllerHolder"/>
|
||||
</button>
|
||||
|
||||
<panel>
|
||||
<grid-layout-data horizontal-span="2" horizontal-alignment="fill" horizontal-fill="true" minimum-height="20"/>
|
||||
</panel>
|
||||
<label style="horizontal | separator">
|
||||
<grid-layout-data horizontal-span="2" horizontal-alignment="fill" horizontal-fill="true"/>
|
||||
</label>
|
||||
<panel>
|
||||
<grid-layout-data horizontal-span="2" horizontal-alignment="fill" horizontal-fill="true" minimum-height="20"/>
|
||||
</panel>
|
||||
|
||||
<panel tab-order="1">
|
||||
<grid-layout column-count="2" equal-width-columns="false" vertical-spacing="2" horizontal-spacing="2" margin-width="5" margin-height="5"/>
|
||||
<grid-layout-data horizontal-span="2" horizontal-alignment="fill" horizontal-fill="true"/>
|
||||
|
||||
<label text="Test type:"/>
|
||||
<label text="Row Count:"/>
|
||||
|
||||
<combo style="" auto-synchronize-selection="true" tab-order="1">
|
||||
<association function="collection" attribute="tests" value-holder="controllerHolder"/>
|
||||
<association function="selection" attribute="selectedTest" value-holder="controllerHolder"/>
|
||||
</combo>
|
||||
|
||||
<text style="border" tool-tip-text="Specify the number of rows of data in the test." auto-synchronize-text="true" tab-order="1">
|
||||
<grid-layout-data minimum-width="140"/>
|
||||
|
||||
<integer-format model-type="integer" min-value="0" max-value="10000">
|
||||
<association function="value" attribute="testRowCount" value-holder="controllerHolder"/>
|
||||
</integer-format>
|
||||
</text>
|
||||
|
||||
<button name="displayTestButton" style="" text="Display Test" tab-order="1">
|
||||
<grid-layout-data horizontal-span="2" horizontal-alignment="center" horizontal-fill="true"/>
|
||||
|
||||
<association function="is-enabled" attribute="selectedTest" value-holder="controllerHolder"/>
|
||||
<method function="selection" name="doDisplayTest" value-holder="controllerHolder"/>
|
||||
</button>
|
||||
</panel>
|
||||
<panel-viewer style='border' name='innerView' tab-order="1">
|
||||
<fill-layout/>
|
||||
<grid-layout-data horizontal-fill='true' horizontal-alignment='fill' horizontal-span="2" vertical-fill="true" vertical-alignment="fill" minimum-width="200" minimum-height="200"/>
|
||||
<association function='controller' attribute='testController' value-holder='controllerHolder'/>
|
||||
</panel-viewer>
|
||||
</panel>
|
||||
</page>
|
||||
-->
|
||||
<pages>
|
||||
<association function="pages" attribute="tabViewControllers" value-holder="controllerHolder"/>
|
||||
</pages>
|
||||
<!--
|
||||
<page>
|
||||
<sash-form style="horizontal" weights="10, 20" container-title="Sash">
|
||||
<panel name="bluePanel" background-color="#0000FFFF,#4545D09F,diagonal"/>
|
||||
<panel name="sashPanel">
|
||||
<panel name="greenPanel" background-color="#00FF00FF,#45D0459F,diagonal"/>
|
||||
<sash style="horizontal"/>
|
||||
<panel name="blackAndWhitePanel" background-color="#000000FF,#4545459F,diagonal"/>
|
||||
<sash style="horizontal"/>
|
||||
<panel name="redPanel" background-color="#FF0000FF,#D045459F,diagonal"/>
|
||||
</panel>
|
||||
</sash-form>
|
||||
</page>
|
||||
-->
|
||||
<page>
|
||||
<panel name="scrollPanel" container-title="Red|Blue" style="vertical scroll">
|
||||
<!--<grid-layout column-count="1" margin-width="4" vertical-spacing="0"/>-->
|
||||
<row-layout direction="vertical" alignment="fill" wrap="false" margin-width="30" margin-height="30"/>
|
||||
|
||||
<panel name="content1" background-color="red">
|
||||
<!--<grid-layout-data horizontal-fill="true" horizontal-alignment="fill" vertical-fill="false" vertical-alignment="fill" minimum-height="300" default-height="300"/>-->
|
||||
<row-layout-data height="300"/>
|
||||
</panel>
|
||||
<button-toggle style="check" text="Visibility" is-selected="false" background-color="#8F8">
|
||||
<!--<grid-layout-data horizontal-alignment="fill" horizontal-fill="true" vertical-fill="false" vertical-alignment="beginning"/>-->
|
||||
<link function="selection" component="content2" target="is-visible"/>
|
||||
</button-toggle>
|
||||
<panel name="content2" background-color="blue" is-visible="false">
|
||||
<!--<grid-layout-data horizontal-fill="true" horizontal-alignment="fill" vertical-fill="false" vertical-alignment="fill" minimum-height="300" default-height="300"/>-->
|
||||
<row-layout-data height="300"/>
|
||||
</panel>
|
||||
<panel name="buttonPanel" style="" tab-order="1" background-color="yellow">
|
||||
<row-layout wrap="false" pack="false" spacing="10" justify="false" alignment="end"/>
|
||||
<!--<grid-layout-data horizontal-alignment="end" horizontal-fill="true" vertical-fill="true" vertical-alignment="end"/>-->
|
||||
|
||||
<button name="okButton" style="" text="Ok" tab-order="1">
|
||||
</button>
|
||||
<button name="cancelButton" style="" text="Cancel" tab-order="1">
|
||||
</button>
|
||||
</panel>
|
||||
</panel>
|
||||
</page>
|
||||
<page>
|
||||
<panel container-title="Overlay Example">
|
||||
<grid-layout column-count="1"/>
|
||||
|
||||
<panel name="nobgPanel" style="no background" inherit-background="all" background-color="#00F8" is-visible="false">
|
||||
<grid-layout-data exclude="true"/>
|
||||
<center-layout/>
|
||||
|
||||
<panel>
|
||||
<grid-layout-data horizontal-fill="false" horizontal-alignment="fill" vertical-fill="false" vertical-alignment="fill" minimum-height="100" minimum-width="100"/>
|
||||
<fill-layout/>
|
||||
|
||||
<label text="A short message to you!">
|
||||
</label>
|
||||
</panel>
|
||||
</panel>
|
||||
<label style="wrap" text="This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap. This is a really long label text and it goes on for ever so that it will hopefully wrap.">
|
||||
<grid-layout-data horizontal-fill="true" horizontal-alignment="beginning" vertical-fill="true" vertical-alignment="beginning"/>
|
||||
</label>
|
||||
<button-toggle style="check" text="Visibility" is-selected="false">
|
||||
<link function="selection" component="nobgPanel" target="is-visible"/>
|
||||
</button-toggle>
|
||||
</panel>
|
||||
</page>
|
||||
</tab-panel>
|
||||
</window>
|
||||
</vml>
|
||||
@@ -0,0 +1,353 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* ProjectEditorView
|
||||
*/
|
||||
public class ProjectEditorView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String PROJECT_HOLDER_COMPONENT = "projectHolder";
|
||||
public static final String NAME_LABEL_COMPONENT = "nameLabel";
|
||||
public static final String NAME_EDITOR_COMPONENT = "nameEditor";
|
||||
public static final String PROGRESS_LABEL_COMPONENT = "progressLabel";
|
||||
public static final String PROGRESS_EDITOR_COMPONENT = "progressEditor";
|
||||
public static final String BUTTON_PANEL_COMPONENT = "buttonPanel";
|
||||
public static final String ACCEPT_BUTTON_COMPONENT = "acceptButton";
|
||||
public static final String REJECT_BUTTON_COMPONENT = "rejectButton";
|
||||
public static final String PROJECT_EDITOR_VIEW_COMPONENT = "ProjectEditorView";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int PROJECT_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0 = 0;
|
||||
protected static final int NAME_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 1;
|
||||
protected static final int PROGRESS_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 2;
|
||||
|
||||
//Method Association Identifiers//
|
||||
protected static final int ACCEPT_BUTTON_SELECTION_METHOD_ASSOCIATION = 0;
|
||||
protected static final int REJECT_BUTTON_SELECTION_METHOD_ASSOCIATION = 1;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.ValueHolder projectHolder = null;
|
||||
private com.foundation.view.swt.Label nameLabel = null;
|
||||
private com.foundation.view.swt.TextField nameEditor = null;
|
||||
private com.foundation.view.swt.Label progressLabel = null;
|
||||
private com.foundation.view.swt.TextField progressEditor = null;
|
||||
private com.foundation.view.swt.Panel buttonPanel = null;
|
||||
private com.foundation.view.swt.Button acceptButton = null;
|
||||
private com.foundation.view.swt.Button rejectButton = null;
|
||||
/**
|
||||
* ProjectEditorView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public ProjectEditorView() {
|
||||
}//ProjectEditorView()//
|
||||
/**
|
||||
* ProjectEditorView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public ProjectEditorView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, PROJECT_EDITOR_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//ProjectEditorView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.ProjectEditorViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeProjectHolder(com.foundation.view.swt.Container parent) {
|
||||
projectHolder = new com.foundation.view.swt.ValueHolder(parent, PROJECT_HOLDER_COMPONENT, test.model.Project.class);
|
||||
projectHolder.setParentAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.ProjectEditorViewController.class, PROJECT_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.ProjectEditorViewController.class, test.local.view.controller.ProjectEditorViewController.PROJECT)}, null,true)}));
|
||||
}//initializeProjectHolder()//
|
||||
public void initializeNameLabel(com.foundation.view.swt.Container parent) {
|
||||
nameLabel = new com.foundation.view.swt.Label(parent, NAME_LABEL_COMPONENT, 0);
|
||||
|
||||
nameLabel.setText("Name:");
|
||||
}//initializeNameLabel()//
|
||||
public void initializeNameEditor(com.foundation.view.swt.Container parent) {
|
||||
nameEditor = new com.foundation.view.swt.TextField(parent, NAME_EDITOR_COMPONENT, com.foundation.view.swt.TextField.STYLE_BORDER);
|
||||
|
||||
com.foundation.view.swt.TextField.TextFormat nameEditorFormat = (com.foundation.view.swt.TextField.TextFormat) nameEditor.initializeFormat(com.foundation.view.swt.TextField.TextFormat.class);
|
||||
nameEditorFormat.setValueAssociation(new com.foundation.view.SingleAssociationContainer("projectHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.model.Project.class, NAME_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Project.class, test.model.Project.NAME)}, null,true,test.model.Project.NAME)}));
|
||||
nameEditor.setAutoSynchronizeValue(true);
|
||||
}//initializeNameEditor()//
|
||||
public void initializeProgressLabel(com.foundation.view.swt.Container parent) {
|
||||
progressLabel = new com.foundation.view.swt.Label(parent, PROGRESS_LABEL_COMPONENT, 0);
|
||||
|
||||
progressLabel.setText("Progress:");
|
||||
}//initializeProgressLabel()//
|
||||
public void initializeProgressEditor(com.foundation.view.swt.Container parent) {
|
||||
progressEditor = new com.foundation.view.swt.TextField(parent, PROGRESS_EDITOR_COMPONENT, com.foundation.view.swt.TextField.STYLE_BORDER);
|
||||
|
||||
com.foundation.view.swt.TextField.PercentFormat progressEditorFormat = (com.foundation.view.swt.TextField.PercentFormat) progressEditor.initializeFormat(com.foundation.view.swt.TextField.PercentFormat.class);
|
||||
progressEditorFormat.setModelType(com.foundation.view.swt.TextField.IntegerFormat.DATA_TYPE_BIG_DECIMAL);
|
||||
progressEditorFormat.setValueAssociation(new com.foundation.view.SingleAssociationContainer("projectHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.model.Project.class, PROGRESS_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Project.class, test.model.Project.PROGRESS)}, null,true,test.model.Project.PROGRESS)}));
|
||||
progressEditor.setAutoSynchronizeValue(true);
|
||||
progressEditor.setSelectOnFocus(true);
|
||||
}//initializeProgressEditor()//
|
||||
public void initializeAcceptButton(com.foundation.view.swt.Container parent) {
|
||||
acceptButton = new com.foundation.view.swt.Button(parent, ACCEPT_BUTTON_COMPONENT, 0);
|
||||
|
||||
acceptButton.setImage(new com.foundation.view.JefImage("icons/Accept.png"));
|
||||
acceptButton.setSelectionMethod(new com.foundation.view.MethodAssociation(this, ACCEPT_BUTTON_SELECTION_METHOD_ASSOCIATION, acceptButton, "controllerHolder", null, null));
|
||||
}//initializeAcceptButton()//
|
||||
public void initializeRejectButton(com.foundation.view.swt.Container parent) {
|
||||
rejectButton = new com.foundation.view.swt.Button(parent, REJECT_BUTTON_COMPONENT, 0);
|
||||
|
||||
rejectButton.setImage(new com.foundation.view.JefImage("icons/Reject.png"));
|
||||
rejectButton.setSelectionMethod(new com.foundation.view.MethodAssociation(this, REJECT_BUTTON_SELECTION_METHOD_ASSOCIATION, rejectButton, "controllerHolder", null, null));
|
||||
}//initializeRejectButton()//
|
||||
public void initializeButtonPanel(com.foundation.view.swt.Container parent) {
|
||||
buttonPanel = new com.foundation.view.swt.Panel(parent, BUTTON_PANEL_COMPONENT, 0);
|
||||
|
||||
initializeAcceptButton(buttonPanel);
|
||||
initializeRejectButton(buttonPanel);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(buttonPanel);
|
||||
|
||||
layout.setNumColumns(2);
|
||||
layout.setMakeColumnsEqualWidth(true);
|
||||
buttonPanel.setLayout(layout);
|
||||
buttonPanel.setTabOrder(new com.common.util.LiteList(new Object[] {acceptButton, rejectButton}));
|
||||
}//initializeButtonPanel()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeProjectHolder(this);
|
||||
initializeNameLabel(this);
|
||||
initializeNameEditor(this);
|
||||
initializeProgressLabel(this);
|
||||
initializeProgressEditor(this);
|
||||
initializeButtonPanel(this);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(this);
|
||||
|
||||
layout.setNumColumns(1);
|
||||
layout.setMakeColumnsEqualWidth(true);
|
||||
layout.setMarginWidth(2);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {nameEditor, progressEditor, buttonPanel}));
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
case ACCEPT_BUTTON_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.ProjectEditorViewController) value).doApply();
|
||||
break;
|
||||
case REJECT_BUTTON_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.ProjectEditorViewController) value).doCancel();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case PROJECT_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ProjectEditorViewController) value).getProject();
|
||||
break;
|
||||
case NAME_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getName();
|
||||
break;
|
||||
case PROGRESS_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getProgress();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case PROJECT_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.ProjectEditorViewController) value).getOldAttributeValue(test.local.view.controller.ProjectEditorViewController.PROJECT);
|
||||
break;
|
||||
case NAME_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getOldAttributeValue(test.model.Project.NAME);
|
||||
break;
|
||||
case PROGRESS_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getOldAttributeValue(test.model.Project.PROGRESS);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
case NAME_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
((test.model.Project) value).setName((java.lang.String) parameters[0]);
|
||||
break;
|
||||
case PROGRESS_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
((test.model.Project) value).setProgress((java.math.BigDecimal) parameters[0]);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
{ //nameEditor//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
nameEditor.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //progressEditor//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
progressEditor.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //buttonPanel//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.END;
|
||||
buttonPanel.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //acceptButton//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.minimumWidth = 20;
|
||||
layoutData.widthHint = 20;
|
||||
layoutData.minimumHeight = 20;
|
||||
layoutData.heightHint = 20;
|
||||
acceptButton.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //rejectButton//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.minimumWidth = 20;
|
||||
layoutData.widthHint = 20;
|
||||
layoutData.minimumHeight = 20;
|
||||
layoutData.heightHint = 20;
|
||||
rejectButton.setLayoutData(layoutData);
|
||||
}//block//
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpProjectHolder() {
|
||||
return projectHolder;
|
||||
}//getVpProjectHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpNameLabel() {
|
||||
return nameLabel;
|
||||
}//getVpNameLabel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.TextField getVpNameEditor() {
|
||||
return nameEditor;
|
||||
}//getVpNameEditor()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpProgressLabel() {
|
||||
return progressLabel;
|
||||
}//getVpProgressLabel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.TextField getVpProgressEditor() {
|
||||
return progressEditor;
|
||||
}//getVpProgressEditor()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Panel getVpButtonPanel() {
|
||||
return buttonPanel;
|
||||
}//getVpButtonPanel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpAcceptButton() {
|
||||
return acceptButton;
|
||||
}//getVpAcceptButton()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpRejectButton() {
|
||||
return rejectButton;
|
||||
}//getVpRejectButton()//
|
||||
}//ProjectEditorView//
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2009,2008 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name='thick:swt'/>
|
||||
</metadata>
|
||||
<panel style='' name='ProjectEditorView'>
|
||||
<grid-layout margin-width='2' equal-width-columns='true' column-count='1'/>
|
||||
<value-holder type='test.local.view.controller.ProjectEditorViewController' name='controllerHolder'/>
|
||||
<value-holder type='test.model.Project' name='projectHolder'>
|
||||
<association attribute='project' function='parent' value-holder='controllerHolder'/>
|
||||
</value-holder>
|
||||
<label style='' name='nameLabel' text='Name:'/>
|
||||
<text auto-synchronize-text='true' style='border' name='nameEditor' tab-order='1'>
|
||||
<grid-layout-data horizontal-fill='true' horizontal-alignment='fill'/>
|
||||
<text-format>
|
||||
<association function='value' value-holder='projectHolder' attribute='name' decorate='true'/>
|
||||
</text-format>
|
||||
</text>
|
||||
<label style='' name='progressLabel' text='Progress:'/>
|
||||
<text auto-synchronize-text='true' style='border' select-on-focus='true' name='progressEditor' tab-order='1'>
|
||||
<grid-layout-data horizontal-fill='true' horizontal-alignment='fill'/>
|
||||
<percent-format model-type="big-decimal">
|
||||
<association function='value' value-holder='projectHolder' attribute='progress' decorate='true'/>
|
||||
</percent-format>
|
||||
</text>
|
||||
<panel name='buttonPanel' tab-order='2'>
|
||||
<grid-layout column-count='2' equal-width-columns='true'/>
|
||||
<grid-layout-data horizontal-alignment='end'/>
|
||||
<button style='' image='icons/Accept.png' name='acceptButton' tab-order='1'>
|
||||
<grid-layout-data minimum-width='20' minimum-height='20'/>
|
||||
<method value-holder='controllerHolder' function='selection' signature='' name='doApply'/>
|
||||
</button>
|
||||
<button style='' image='icons/Reject.png' name='rejectButton' tab-order='1'>
|
||||
<grid-layout-data minimum-width='20' minimum-height='20'/>
|
||||
<method value-holder='controllerHolder' function='selection' signature='' name='doCancel'/>
|
||||
</button>
|
||||
</panel>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,150 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* SampleInnerView
|
||||
*/
|
||||
public class SampleInnerView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String PLACEHOLDER_COMPONENT = "placeholder";
|
||||
public static final String SAMPLE_INNER_VIEW_COMPONENT = "SampleInnerView";
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.Label placeholder = null;
|
||||
/**
|
||||
* SampleInnerView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public SampleInnerView() {
|
||||
}//SampleInnerView()//
|
||||
/**
|
||||
* SampleInnerView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public SampleInnerView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, SAMPLE_INNER_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//SampleInnerView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.SampleInnerViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializePlaceholder(com.foundation.view.swt.Container parent) {
|
||||
placeholder = new com.foundation.view.swt.Label(parent, PLACEHOLDER_COMPONENT, 0);
|
||||
|
||||
placeholder.setText("Test Inner View");
|
||||
placeholder.setDefaultBackgroundColor(new com.foundation.view.JefGradient("(0,255,0,0)"));
|
||||
}//initializePlaceholder()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializePlaceholder(this);
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(this);
|
||||
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpPlaceholder() {
|
||||
return placeholder;
|
||||
}//getVpPlaceholder()//
|
||||
}//SampleInnerView//
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2009,2008 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<panel name="SampleInnerView" style="">
|
||||
<fill-layout/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.SampleInnerViewController"/>
|
||||
|
||||
<label name="placeholder" style="" text="Test Inner View" background-color="#00FF00"/>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,298 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* StreetAddressEditorView
|
||||
*/
|
||||
public class StreetAddressEditorView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String STREET_ADDRESS_HOLDER_COMPONENT = "streetAddressHolder";
|
||||
public static final String LINE_LABEL_COMPONENT = "lineLabel";
|
||||
public static final String LINE_EDITOR_COMPONENT = "lineEditor";
|
||||
public static final String BUTTON_PANEL_COMPONENT = "buttonPanel";
|
||||
public static final String ACCEPT_BUTTON_COMPONENT = "acceptButton";
|
||||
public static final String REJECT_BUTTON_COMPONENT = "rejectButton";
|
||||
public static final String STREET_ADDRESS_EDITOR_VIEW_COMPONENT = "StreetAddressEditorView";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int STREET_ADDRESS_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0 = 0;
|
||||
protected static final int LINE_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 1;
|
||||
|
||||
//Method Association Identifiers//
|
||||
protected static final int ACCEPT_BUTTON_SELECTION_METHOD_ASSOCIATION = 0;
|
||||
protected static final int REJECT_BUTTON_SELECTION_METHOD_ASSOCIATION = 1;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.ValueHolder streetAddressHolder = null;
|
||||
private com.foundation.view.swt.Label lineLabel = null;
|
||||
private com.foundation.view.swt.TextField lineEditor = null;
|
||||
private com.foundation.view.swt.Panel buttonPanel = null;
|
||||
private com.foundation.view.swt.Button acceptButton = null;
|
||||
private com.foundation.view.swt.Button rejectButton = null;
|
||||
/**
|
||||
* StreetAddressEditorView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public StreetAddressEditorView() {
|
||||
}//StreetAddressEditorView()//
|
||||
/**
|
||||
* StreetAddressEditorView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public StreetAddressEditorView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, STREET_ADDRESS_EDITOR_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//StreetAddressEditorView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.StreetAddressEditorViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeStreetAddressHolder(com.foundation.view.swt.Container parent) {
|
||||
streetAddressHolder = new com.foundation.view.swt.ValueHolder(parent, STREET_ADDRESS_HOLDER_COMPONENT, test.model.StreetAddress.class);
|
||||
streetAddressHolder.setParentAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.StreetAddressEditorViewController.class, STREET_ADDRESS_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.StreetAddressEditorViewController.class, test.local.view.controller.StreetAddressEditorViewController.STREET_ADDRESS)}, null,true)}));
|
||||
}//initializeStreetAddressHolder()//
|
||||
public void initializeLineLabel(com.foundation.view.swt.Container parent) {
|
||||
lineLabel = new com.foundation.view.swt.Label(parent, LINE_LABEL_COMPONENT, 0);
|
||||
|
||||
lineLabel.setText("Street Address:");
|
||||
}//initializeLineLabel()//
|
||||
public void initializeLineEditor(com.foundation.view.swt.Container parent) {
|
||||
lineEditor = new com.foundation.view.swt.TextField(parent, LINE_EDITOR_COMPONENT, 0);
|
||||
|
||||
com.foundation.view.swt.TextField.TextFormat lineEditorFormat = (com.foundation.view.swt.TextField.TextFormat) lineEditor.initializeFormat(com.foundation.view.swt.TextField.TextFormat.class);
|
||||
lineEditorFormat.setValueAssociation(new com.foundation.view.SingleAssociationContainer("streetAddressHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.model.StreetAddress.class, LINE_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.StreetAddress.class, test.model.StreetAddress.LINE)}, null,true)}));
|
||||
}//initializeLineEditor()//
|
||||
public void initializeAcceptButton(com.foundation.view.swt.Container parent) {
|
||||
acceptButton = new com.foundation.view.swt.Button(parent, ACCEPT_BUTTON_COMPONENT, 0);
|
||||
|
||||
acceptButton.setImage(new com.foundation.view.JefImage("icons/Accept.png"));
|
||||
acceptButton.setSelectionMethod(new com.foundation.view.MethodAssociation(this, ACCEPT_BUTTON_SELECTION_METHOD_ASSOCIATION, acceptButton, "controllerHolder", null, null));
|
||||
}//initializeAcceptButton()//
|
||||
public void initializeRejectButton(com.foundation.view.swt.Container parent) {
|
||||
rejectButton = new com.foundation.view.swt.Button(parent, REJECT_BUTTON_COMPONENT, 0);
|
||||
|
||||
rejectButton.setImage(new com.foundation.view.JefImage("icons/Reject.png"));
|
||||
rejectButton.setSelectionMethod(new com.foundation.view.MethodAssociation(this, REJECT_BUTTON_SELECTION_METHOD_ASSOCIATION, rejectButton, "controllerHolder", null, null));
|
||||
}//initializeRejectButton()//
|
||||
public void initializeButtonPanel(com.foundation.view.swt.Container parent) {
|
||||
buttonPanel = new com.foundation.view.swt.Panel(parent, BUTTON_PANEL_COMPONENT, 0);
|
||||
|
||||
initializeAcceptButton(buttonPanel);
|
||||
initializeRejectButton(buttonPanel);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(buttonPanel);
|
||||
|
||||
layout.setNumColumns(2);
|
||||
layout.setMakeColumnsEqualWidth(true);
|
||||
buttonPanel.setLayout(layout);
|
||||
buttonPanel.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
}//initializeButtonPanel()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeStreetAddressHolder(this);
|
||||
initializeLineLabel(this);
|
||||
initializeLineEditor(this);
|
||||
initializeButtonPanel(this);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(this);
|
||||
|
||||
layout.setNumColumns(1);
|
||||
layout.setMakeColumnsEqualWidth(true);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
case ACCEPT_BUTTON_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.StreetAddressEditorViewController) value).doApply();
|
||||
break;
|
||||
case REJECT_BUTTON_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.StreetAddressEditorViewController) value).doCancel();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case STREET_ADDRESS_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.StreetAddressEditorViewController) value).getStreetAddress();
|
||||
break;
|
||||
case LINE_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.StreetAddress) value).getLine();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case STREET_ADDRESS_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.StreetAddressEditorViewController) value).getOldAttributeValue(test.local.view.controller.StreetAddressEditorViewController.STREET_ADDRESS);
|
||||
break;
|
||||
case LINE_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.StreetAddress) value).getOldAttributeValue(test.model.StreetAddress.LINE);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
case LINE_EDITOR_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
((test.model.StreetAddress) value).setLine((java.lang.String) parameters[0]);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
{ //lineEditor//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
lineEditor.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //buttonPanel//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.END;
|
||||
buttonPanel.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //acceptButton//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.minimumWidth = 20;
|
||||
layoutData.widthHint = 20;
|
||||
layoutData.minimumHeight = 20;
|
||||
layoutData.heightHint = 20;
|
||||
acceptButton.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //rejectButton//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.minimumWidth = 20;
|
||||
layoutData.widthHint = 20;
|
||||
layoutData.minimumHeight = 20;
|
||||
layoutData.heightHint = 20;
|
||||
rejectButton.setLayoutData(layoutData);
|
||||
}//block//
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpStreetAddressHolder() {
|
||||
return streetAddressHolder;
|
||||
}//getVpStreetAddressHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpLineLabel() {
|
||||
return lineLabel;
|
||||
}//getVpLineLabel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.TextField getVpLineEditor() {
|
||||
return lineEditor;
|
||||
}//getVpLineEditor()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Panel getVpButtonPanel() {
|
||||
return buttonPanel;
|
||||
}//getVpButtonPanel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpAcceptButton() {
|
||||
return acceptButton;
|
||||
}//getVpAcceptButton()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpRejectButton() {
|
||||
return rejectButton;
|
||||
}//getVpRejectButton()//
|
||||
}//StreetAddressEditorView//
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2009,2008 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name='thick:swt'/>
|
||||
</metadata>
|
||||
<panel style='' name='StreetAddressEditorView'>
|
||||
<grid-layout column-count='1' equal-width-columns='true'/>
|
||||
<value-holder type='test.local.view.controller.StreetAddressEditorViewController' name='controllerHolder'/>
|
||||
<value-holder type='test.model.StreetAddress' name='streetAddressHolder'>
|
||||
<association attribute='streetAddress' function='parent' value-holder='controllerHolder'/>
|
||||
</value-holder>
|
||||
<label style='' name='lineLabel' text='Street Address:'/>
|
||||
<text style='' name='lineEditor'>
|
||||
<grid-layout-data horizontal-fill='true' horizontal-alignment='fill'/>
|
||||
<text-format>
|
||||
<association attribute='line' function='value' value-holder='streetAddressHolder'/>
|
||||
</text-format>
|
||||
</text>
|
||||
<panel name='buttonPanel'>
|
||||
<grid-layout column-count='2' equal-width-columns='true'/>
|
||||
<grid-layout-data horizontal-alignment='end'/>
|
||||
<button image='icons/Accept.png' style='' name='acceptButton'>
|
||||
<grid-layout-data minimum-width='20' minimum-height='20'/>
|
||||
<method value-holder='controllerHolder' function='selection' signature='' name='doApply'/>
|
||||
</button>
|
||||
<button image='icons/Reject.png' style='' name='rejectButton'>
|
||||
<grid-layout-data minimum-width='20' minimum-height='20'/>
|
||||
<method value-holder='controllerHolder' function='selection' signature='' name='doCancel'/>
|
||||
</button>
|
||||
</panel>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,355 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* StyledTextPageView
|
||||
*/
|
||||
public class StyledTextPageView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String SAMPLE_STYLED_TEXT_PANEL_COMPONENT = "sampleStyledTextPanel";
|
||||
public static final String STYLED_TEXT_TOOL_BAR_COMPONENT = "styledTextToolBar";
|
||||
public static final String BOLD_BUTTON_COMPONENT = "boldButton";
|
||||
public static final String UNDERLINE_BUTTON_COMPONENT = "underlineButton";
|
||||
public static final String ITALIC_BUTTON_COMPONENT = "italicButton";
|
||||
public static final String STRIKEOUT_BUTTON_COMPONENT = "strikeoutButton";
|
||||
public static final String FONT_NAME_COMBO_COMPONENT = "fontNameCombo";
|
||||
public static final String FONT_SIZE_COMBO_COMPONENT = "fontSizeCombo";
|
||||
public static final String STYLED_TEXT_TEST_COMPONENT = "styledTextTest";
|
||||
public static final String STYLED_TEXT_PAGE_VIEW_COMPONENT = "StyledTextPageView";
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.Panel sampleStyledTextPanel = null;
|
||||
private com.foundation.view.swt.ToolBar styledTextToolBar = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem boldButton = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem underlineButton = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem italicButton = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem strikeoutButton = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem unnamedComponent0 = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem unnamedComponent1 = null;
|
||||
private com.foundation.view.swt.FontNameComboBox fontNameCombo = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem unnamedComponent2 = null;
|
||||
private com.foundation.view.swt.FontSizeComboBox fontSizeCombo = null;
|
||||
private com.foundation.view.swt.StyledText styledTextTest = null;
|
||||
/**
|
||||
* StyledTextPageView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public StyledTextPageView() {
|
||||
}//StyledTextPageView()//
|
||||
/**
|
||||
* StyledTextPageView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public StyledTextPageView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, STYLED_TEXT_PAGE_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//StyledTextPageView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.StyledTextPageViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeBoldButton(com.foundation.view.swt.Container parent) {
|
||||
boldButton = new com.foundation.view.swt.ToolBar.ToolItem(parent, BOLD_BUTTON_COMPONENT, com.foundation.view.swt.ToolBar.ToolItem.STYLE_CHECK);
|
||||
|
||||
boldButton.setImage(new com.foundation.view.JefImage("bold.png"));
|
||||
boldButton.setIsEnabled(true);
|
||||
}//initializeBoldButton()//
|
||||
public void initializeUnderlineButton(com.foundation.view.swt.Container parent) {
|
||||
underlineButton = new com.foundation.view.swt.ToolBar.ToolItem(parent, UNDERLINE_BUTTON_COMPONENT, com.foundation.view.swt.ToolBar.ToolItem.STYLE_CHECK);
|
||||
|
||||
underlineButton.setImage(new com.foundation.view.JefImage("underline.png"));
|
||||
underlineButton.setIsEnabled(true);
|
||||
}//initializeUnderlineButton()//
|
||||
public void initializeItalicButton(com.foundation.view.swt.Container parent) {
|
||||
italicButton = new com.foundation.view.swt.ToolBar.ToolItem(parent, ITALIC_BUTTON_COMPONENT, com.foundation.view.swt.ToolBar.ToolItem.STYLE_CHECK);
|
||||
|
||||
italicButton.setImage(new com.foundation.view.JefImage("italic.png"));
|
||||
italicButton.setIsEnabled(true);
|
||||
}//initializeItalicButton()//
|
||||
public void initializeStrikeoutButton(com.foundation.view.swt.Container parent) {
|
||||
strikeoutButton = new com.foundation.view.swt.ToolBar.ToolItem(parent, STRIKEOUT_BUTTON_COMPONENT, com.foundation.view.swt.ToolBar.ToolItem.STYLE_CHECK);
|
||||
|
||||
strikeoutButton.setImage(new com.foundation.view.JefImage("strikeout2.png"));
|
||||
strikeoutButton.setIsEnabled(true);
|
||||
}//initializeStrikeoutButton()//
|
||||
public void initializeUnnamedComponent0(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent0 = new com.foundation.view.swt.ToolBar.ToolItem(parent, null, com.foundation.view.swt.ToolBar.ToolItem.STYLE_SEPARATOR);
|
||||
|
||||
unnamedComponent0.setWidth(4);
|
||||
}//initializeUnnamedComponent0()//
|
||||
public void initializeFontNameCombo(com.foundation.view.swt.Container parent) {
|
||||
fontNameCombo = new com.foundation.view.swt.FontNameComboBox(parent, FONT_NAME_COMBO_COMPONENT, 0);
|
||||
|
||||
}//initializeFontNameCombo()//
|
||||
public void initializeUnnamedComponent1(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent1 = new com.foundation.view.swt.ToolBar.ToolItem(parent, null, com.foundation.view.swt.ToolBar.ToolItem.STYLE_SEPARATOR);
|
||||
|
||||
initializeFontNameCombo(styledTextToolBar);
|
||||
unnamedComponent1.setControl(fontNameCombo);
|
||||
}//initializeUnnamedComponent1()//
|
||||
public void initializeFontSizeCombo(com.foundation.view.swt.Container parent) {
|
||||
fontSizeCombo = new com.foundation.view.swt.FontSizeComboBox(parent, FONT_SIZE_COMBO_COMPONENT, 0);
|
||||
|
||||
}//initializeFontSizeCombo()//
|
||||
public void initializeUnnamedComponent2(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent2 = new com.foundation.view.swt.ToolBar.ToolItem(parent, null, com.foundation.view.swt.ToolBar.ToolItem.STYLE_SEPARATOR);
|
||||
|
||||
initializeFontSizeCombo(styledTextToolBar);
|
||||
unnamedComponent2.setControl(fontSizeCombo);
|
||||
}//initializeUnnamedComponent2()//
|
||||
public void initializeStyledTextToolBar(com.foundation.view.swt.Container parent) {
|
||||
styledTextToolBar = new com.foundation.view.swt.ToolBar(parent, STYLED_TEXT_TOOL_BAR_COMPONENT, 0);
|
||||
|
||||
initializeBoldButton(styledTextToolBar);
|
||||
initializeUnderlineButton(styledTextToolBar);
|
||||
initializeItalicButton(styledTextToolBar);
|
||||
initializeStrikeoutButton(styledTextToolBar);
|
||||
initializeUnnamedComponent0(styledTextToolBar);
|
||||
initializeUnnamedComponent1(styledTextToolBar);
|
||||
initializeUnnamedComponent2(styledTextToolBar);
|
||||
}//initializeStyledTextToolBar()//
|
||||
public void initializeStyledTextTest(com.foundation.view.swt.Container parent) {
|
||||
styledTextTest = new com.foundation.view.swt.StyledText(parent, STYLED_TEXT_TEST_COMPONENT, 0);
|
||||
styledTextTest.setText("hello world");
|
||||
}//initializeStyledTextTest()//
|
||||
public void initializeSampleStyledTextPanel(com.foundation.view.swt.Container parent) {
|
||||
sampleStyledTextPanel = new com.foundation.view.swt.Panel(parent, SAMPLE_STYLED_TEXT_PANEL_COMPONENT, 0);
|
||||
|
||||
initializeStyledTextToolBar(sampleStyledTextPanel);
|
||||
initializeStyledTextTest(sampleStyledTextPanel);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(sampleStyledTextPanel);
|
||||
|
||||
layout.setMarginHeight(4);
|
||||
layout.setMarginWidth(4);
|
||||
sampleStyledTextPanel.setLayout(layout);
|
||||
sampleStyledTextPanel.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
sampleStyledTextPanel.setDefaultBackgroundColor(new com.foundation.view.JefGradient("(255,85,255,0)"));
|
||||
}//initializeSampleStyledTextPanel()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeSampleStyledTextPanel(this);
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(this);
|
||||
|
||||
layout.setType(org.eclipse.swt.SWT.VERTICAL);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
this.setDefaultContainerTitle("Styled Text");
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
{ //styledTextTest//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.verticalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.minimumWidth = 100;
|
||||
layoutData.widthHint = 100;
|
||||
layoutData.minimumHeight = 100;
|
||||
layoutData.heightHint = 100;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
layoutData.grabExcessVerticalSpace = true;
|
||||
styledTextTest.setLayoutData(layoutData);
|
||||
}//block//
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
boldButton.addSelectionLink(new com.foundation.view.LinkData(styledTextTest, com.foundation.view.swt.StyledText.LINK_TARGET_BOLD_TEXT, null, false, false));
|
||||
underlineButton.addSelectionLink(new com.foundation.view.LinkData(styledTextTest, com.foundation.view.swt.StyledText.LINK_TARGET_UNDERLINE_TEXT, null, false, false));
|
||||
italicButton.addSelectionLink(new com.foundation.view.LinkData(styledTextTest, com.foundation.view.swt.StyledText.LINK_TARGET_ITALIC_TEXT, null, false, false));
|
||||
strikeoutButton.addSelectionLink(new com.foundation.view.LinkData(styledTextTest, com.foundation.view.swt.StyledText.LINK_TARGET_STRIKEOUT_TEXT, null, false, false));
|
||||
fontNameCombo.addSelectionLink(new com.foundation.view.LinkData(styledTextTest, com.foundation.view.swt.StyledText.LINK_TARGET_TEXT_FONT_NAME, null, false, false));
|
||||
fontSizeCombo.addSelectionLink(new com.foundation.view.LinkData(styledTextTest, com.foundation.view.swt.StyledText.LINK_TARGET_TEXT_FONT_SIZE, null, false, false));
|
||||
styledTextTest.addBoldTextLink(new com.foundation.view.LinkData(boldButton, com.foundation.view.swt.ToolBar.ToolItem.LINK_TARGET_SELECTION, null, false, false));
|
||||
styledTextTest.addItalicTextLink(new com.foundation.view.LinkData(italicButton, com.foundation.view.swt.ToolBar.ToolItem.LINK_TARGET_SELECTION, null, false, false));
|
||||
styledTextTest.addUnderlineTextLink(new com.foundation.view.LinkData(underlineButton, com.foundation.view.swt.ToolBar.ToolItem.LINK_TARGET_SELECTION, null, false, false));
|
||||
styledTextTest.addStrikeoutTextLink(new com.foundation.view.LinkData(strikeoutButton, com.foundation.view.swt.ToolBar.ToolItem.LINK_TARGET_SELECTION, null, false, false));
|
||||
styledTextTest.addTextFontNameLink(new com.foundation.view.LinkData(fontNameCombo, com.foundation.view.swt.FontNameComboBox.LINK_TARGET_SELECTION, null, false, false));
|
||||
styledTextTest.addTextFontSizeLink(new com.foundation.view.LinkData(fontSizeCombo, com.foundation.view.swt.FontSizeComboBox.LINK_TARGET_SELECTION, null, false, false));
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Panel getVpSampleStyledTextPanel() {
|
||||
return sampleStyledTextPanel;
|
||||
}//getVpSampleStyledTextPanel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar getVpStyledTextToolBar() {
|
||||
return styledTextToolBar;
|
||||
}//getVpStyledTextToolBar()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpBoldButton() {
|
||||
return boldButton;
|
||||
}//getVpBoldButton()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpUnderlineButton() {
|
||||
return underlineButton;
|
||||
}//getVpUnderlineButton()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpItalicButton() {
|
||||
return italicButton;
|
||||
}//getVpItalicButton()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpStrikeoutButton() {
|
||||
return strikeoutButton;
|
||||
}//getVpStrikeoutButton()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpUnnamedComponent0() {
|
||||
return unnamedComponent0;
|
||||
}//getVpUnnamedComponent0()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpUnnamedComponent1() {
|
||||
return unnamedComponent1;
|
||||
}//getVpUnnamedComponent1()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.FontNameComboBox getVpFontNameCombo() {
|
||||
return fontNameCombo;
|
||||
}//getVpFontNameCombo()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpUnnamedComponent2() {
|
||||
return unnamedComponent2;
|
||||
}//getVpUnnamedComponent2()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.FontSizeComboBox getVpFontSizeCombo() {
|
||||
return fontSizeCombo;
|
||||
}//getVpFontSizeCombo()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.StyledText getVpStyledTextTest() {
|
||||
return styledTextTest;
|
||||
}//getVpStyledTextTest()//
|
||||
}//StyledTextPageView//
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2009,2008 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<panel name="StyledTextPageView" style="" container-title="Styled Text">
|
||||
<fill-layout direction="vertical"/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.StyledTextPageViewController"/>
|
||||
|
||||
<panel name="sampleStyledTextPanel" background-color="#FF55FF">
|
||||
<grid-layout-data horizontal-span="1"/>
|
||||
<grid-layout margin-width="4" margin-height="4"/>
|
||||
|
||||
<tool-bar name="styledTextToolBar" style="">
|
||||
<tool-item-toggle name="boldButton" style="check" image="bold.png" is-enabled="true">
|
||||
<link function="selection" component="styledTextTest" target="boldText"/>
|
||||
</tool-item-toggle>
|
||||
<tool-item-toggle name="underlineButton" style="check" image="underline.png" is-enabled="true">
|
||||
<link function="selection" component="styledTextTest" target="underlineText"/>
|
||||
</tool-item-toggle>
|
||||
<tool-item-toggle name="italicButton" style="check" image="italic.png" is-enabled="true">
|
||||
<link function="selection" component="styledTextTest" target="italicText"/>
|
||||
</tool-item-toggle>
|
||||
<tool-item-toggle name="strikeoutButton" style="check" image="strikeout2.png" is-enabled="true">
|
||||
<link function="selection" component="styledTextTest" target="strikeoutText"/>
|
||||
</tool-item-toggle>
|
||||
<tool-item-separator style="separator" width="4">
|
||||
</tool-item-separator>
|
||||
<tool-item-custom style="separator">
|
||||
<font-name-combo name="fontNameCombo" style="">
|
||||
<link function="selection" component="styledTextTest" target="textFontName"/>
|
||||
</font-name-combo>
|
||||
</tool-item-custom>
|
||||
<tool-item-custom style="separator">
|
||||
<font-size-combo name="fontSizeCombo" style="">
|
||||
<link function="selection" component="styledTextTest" target="textFontSize"/>
|
||||
</font-size-combo>
|
||||
</tool-item-custom>
|
||||
</tool-bar>
|
||||
|
||||
<styled-text name="styledTextTest" style="" text="hello world">
|
||||
<grid-layout-data vertical-fill="true" horizontal-fill="true" vertical-alignment="fill" horizontal-alignment="fill" minimum-width="100" minimum-height="100"/>
|
||||
|
||||
<link function="boldText" component="boldButton" target="selection"/>
|
||||
<link function="underlineText" component="underlineButton" target="selection"/>
|
||||
<link function="italicText" component="italicButton" target="selection"/>
|
||||
<link function="strikeoutText" component="strikeoutButton" target="selection"/>
|
||||
<link function="textFontName" component="fontNameCombo" target="selection"/>
|
||||
<link function="textFontSize" component="fontSizeCombo" target="selection"/>
|
||||
</styled-text>
|
||||
</panel>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,566 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* TableEditorPageView
|
||||
*/
|
||||
public class TableEditorPageView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String SAMPLE_TABLE_COMPONENT = "sampleTable";
|
||||
public static final String CELL_TEXT_COMPONENT = "cellText";
|
||||
public static final String CELL_BYTE_COMPONENT = "cellByte";
|
||||
public static final String CELL_SHORT_COMPONENT = "cellShort";
|
||||
public static final String CELL_INTEGER_COMPONENT = "cellInteger";
|
||||
public static final String CELL_LONG_COMPONENT = "cellLong";
|
||||
public static final String CELL_FLOAT_COMPONENT = "cellFloat";
|
||||
public static final String CELL_DOUBLE_COMPONENT = "cellDouble";
|
||||
public static final String CELL_BIG_DECIMAL_COMPONENT = "cellBigDecimal";
|
||||
public static final String CELL_CURRENCY_COMPONENT = "cellCurrency";
|
||||
public static final String CELL_PERCENT_COMPONENT = "cellPercent";
|
||||
public static final String CELL_TIME_COMPONENT = "cellTime";
|
||||
public static final String CELL_DATE_COMPONENT = "cellDate";
|
||||
public static final String TABLE_EDITOR_PAGE_VIEW_COMPONENT = "TableEditorPageView";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int CELL_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 0;
|
||||
protected static final int CELL_BYTE_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 1;
|
||||
protected static final int CELL_SHORT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 2;
|
||||
protected static final int CELL_INTEGER_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 3;
|
||||
protected static final int CELL_LONG_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 4;
|
||||
protected static final int CELL_FLOAT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 5;
|
||||
protected static final int CELL_DOUBLE_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 6;
|
||||
protected static final int CELL_BIG_DECIMAL_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 7;
|
||||
protected static final int CELL_CURRENCY_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 8;
|
||||
protected static final int CELL_PERCENT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 9;
|
||||
protected static final int CELL_TIME_ASSOCIATION_SELECTION_ASSOCIATION_0 = 10;
|
||||
protected static final int CELL_DATE_ASSOCIATION_SELECTION_ASSOCIATION_0 = 11;
|
||||
protected static final int SAMPLE_TABLE_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 12;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.SimpleTable sampleTable = null;
|
||||
private com.foundation.view.swt.cell.CellTextField cellText = null;
|
||||
private com.foundation.view.swt.cell.CellTextField cellByte = null;
|
||||
private com.foundation.view.swt.cell.CellTextField cellShort = null;
|
||||
private com.foundation.view.swt.cell.CellTextField cellInteger = null;
|
||||
private com.foundation.view.swt.cell.CellTextField cellLong = null;
|
||||
private com.foundation.view.swt.cell.CellTextField cellFloat = null;
|
||||
private com.foundation.view.swt.cell.CellTextField cellDouble = null;
|
||||
private com.foundation.view.swt.cell.CellTextField cellBigDecimal = null;
|
||||
private com.foundation.view.swt.cell.CellTextField cellCurrency = null;
|
||||
private com.foundation.view.swt.cell.CellTextField cellPercent = null;
|
||||
private com.foundation.view.swt.cell.CellDateTime cellTime = null;
|
||||
private com.foundation.view.swt.cell.CellDateTime cellDate = null;
|
||||
/**
|
||||
* TableEditorPageView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public TableEditorPageView() {
|
||||
}//TableEditorPageView()//
|
||||
/**
|
||||
* TableEditorPageView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public TableEditorPageView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, TABLE_EDITOR_PAGE_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//TableEditorPageView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.TableEditorPageViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeCellText(com.foundation.view.swt.SimpleTable parent) {
|
||||
cellText = new com.foundation.view.swt.cell.CellTextField(parent, CELL_TEXT_COMPONENT, 0);
|
||||
|
||||
com.foundation.view.swt.cell.CellTextField.TextFormat cellTextFormat = (com.foundation.view.swt.cell.CellTextField.TextFormat) cellText.initializeFormat(com.foundation.view.swt.cell.CellTextField.TextFormat.class);
|
||||
cellTextFormat.setValueAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Data.class, CELL_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Data.class, test.model.Data.TEXT)}, null,true)}));
|
||||
cellText.setAutoSynchronizeValue(true);
|
||||
}//initializeCellText()//
|
||||
public void initializeCellByte(com.foundation.view.swt.SimpleTable parent) {
|
||||
cellByte = new com.foundation.view.swt.cell.CellTextField(parent, CELL_BYTE_COMPONENT, 0);
|
||||
|
||||
com.foundation.view.swt.cell.CellTextField.IntegerFormat cellByteFormat = (com.foundation.view.swt.cell.CellTextField.IntegerFormat) cellByte.initializeFormat(com.foundation.view.swt.cell.CellTextField.IntegerFormat.class);
|
||||
cellByteFormat.setModelType(com.foundation.view.swt.cell.CellTextField.IntegerFormat.DATA_TYPE_BYTE);
|
||||
cellByteFormat.setMaxValue(new java.math.BigDecimal("127"));
|
||||
cellByteFormat.setMinValue(new java.math.BigDecimal("-128"));
|
||||
cellByteFormat.setValueAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Data.class, CELL_BYTE_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Data.class, test.model.Data.BYTE)}, null,true)}));
|
||||
cellByte.setAutoSynchronizeValue(true);
|
||||
}//initializeCellByte()//
|
||||
public void initializeCellShort(com.foundation.view.swt.SimpleTable parent) {
|
||||
cellShort = new com.foundation.view.swt.cell.CellTextField(parent, CELL_SHORT_COMPONENT, 0);
|
||||
|
||||
com.foundation.view.swt.cell.CellTextField.IntegerFormat cellShortFormat = (com.foundation.view.swt.cell.CellTextField.IntegerFormat) cellShort.initializeFormat(com.foundation.view.swt.cell.CellTextField.IntegerFormat.class);
|
||||
cellShortFormat.setModelType(com.foundation.view.swt.cell.CellTextField.IntegerFormat.DATA_TYPE_SHORT);
|
||||
cellShortFormat.setMaxValue(new java.math.BigDecimal("32767"));
|
||||
cellShortFormat.setMinValue(new java.math.BigDecimal("-32768"));
|
||||
cellShortFormat.setValueAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Data.class, CELL_SHORT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Data.class, test.model.Data.SHORT)}, null,true)}));
|
||||
cellShort.setAutoSynchronizeValue(true);
|
||||
}//initializeCellShort()//
|
||||
public void initializeCellInteger(com.foundation.view.swt.SimpleTable parent) {
|
||||
cellInteger = new com.foundation.view.swt.cell.CellTextField(parent, CELL_INTEGER_COMPONENT, 0);
|
||||
|
||||
com.foundation.view.swt.cell.CellTextField.IntegerFormat cellIntegerFormat = (com.foundation.view.swt.cell.CellTextField.IntegerFormat) cellInteger.initializeFormat(com.foundation.view.swt.cell.CellTextField.IntegerFormat.class);
|
||||
cellIntegerFormat.setModelType(com.foundation.view.swt.cell.CellTextField.IntegerFormat.DATA_TYPE_INTEGER);
|
||||
cellIntegerFormat.setMaxValue(new java.math.BigDecimal("2147483647"));
|
||||
cellIntegerFormat.setMinValue(new java.math.BigDecimal("-2147483648"));
|
||||
cellIntegerFormat.setValueAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Data.class, CELL_INTEGER_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Data.class, test.model.Data.INTEGER)}, null,true)}));
|
||||
cellInteger.setAutoSynchronizeValue(true);
|
||||
}//initializeCellInteger()//
|
||||
public void initializeCellLong(com.foundation.view.swt.SimpleTable parent) {
|
||||
cellLong = new com.foundation.view.swt.cell.CellTextField(parent, CELL_LONG_COMPONENT, 0);
|
||||
|
||||
com.foundation.view.swt.cell.CellTextField.IntegerFormat cellLongFormat = (com.foundation.view.swt.cell.CellTextField.IntegerFormat) cellLong.initializeFormat(com.foundation.view.swt.cell.CellTextField.IntegerFormat.class);
|
||||
cellLongFormat.setModelType(com.foundation.view.swt.cell.CellTextField.IntegerFormat.DATA_TYPE_LONG);
|
||||
cellLongFormat.setMaxValue(new java.math.BigDecimal("9223372036854775807"));
|
||||
cellLongFormat.setMinValue(new java.math.BigDecimal("-9223372036854775808"));
|
||||
cellLongFormat.setValueAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Data.class, CELL_LONG_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Data.class, test.model.Data.LONG)}, null,true)}));
|
||||
cellLong.setAutoSynchronizeValue(true);
|
||||
}//initializeCellLong()//
|
||||
public void initializeCellFloat(com.foundation.view.swt.SimpleTable parent) {
|
||||
cellFloat = new com.foundation.view.swt.cell.CellTextField(parent, CELL_FLOAT_COMPONENT, 0);
|
||||
|
||||
com.foundation.view.swt.cell.CellTextField.FloatFormat cellFloatFormat = (com.foundation.view.swt.cell.CellTextField.FloatFormat) cellFloat.initializeFormat(com.foundation.view.swt.cell.CellTextField.FloatFormat.class);
|
||||
cellFloatFormat.setModelType(com.foundation.view.swt.cell.CellTextField.IntegerFormat.DATA_TYPE_FLOAT);
|
||||
cellFloatFormat.setMaxValue(new java.math.BigDecimal("340282346638528859811704183484516925440"));
|
||||
cellFloatFormat.setMinValue(new java.math.BigDecimal("-340282346638528859811704183484516925440"));
|
||||
cellFloatFormat.setValueAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Data.class, CELL_FLOAT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Data.class, test.model.Data.FLOAT)}, null,true)}));
|
||||
cellFloatFormat.setMaxFractionDigits(new Integer(4));
|
||||
cellFloat.setAutoSynchronizeValue(true);
|
||||
}//initializeCellFloat()//
|
||||
public void initializeCellDouble(com.foundation.view.swt.SimpleTable parent) {
|
||||
cellDouble = new com.foundation.view.swt.cell.CellTextField(parent, CELL_DOUBLE_COMPONENT, 0);
|
||||
|
||||
com.foundation.view.swt.cell.CellTextField.FloatFormat cellDoubleFormat = (com.foundation.view.swt.cell.CellTextField.FloatFormat) cellDouble.initializeFormat(com.foundation.view.swt.cell.CellTextField.FloatFormat.class);
|
||||
cellDoubleFormat.setModelType(com.foundation.view.swt.cell.CellTextField.IntegerFormat.DATA_TYPE_DOUBLE);
|
||||
cellDoubleFormat.setMaxValue(new java.math.BigDecimal("179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368"));
|
||||
cellDoubleFormat.setMinValue(new java.math.BigDecimal("-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368"));
|
||||
cellDoubleFormat.setValueAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Data.class, CELL_DOUBLE_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Data.class, test.model.Data.DOUBLE)}, null,true)}));
|
||||
cellDoubleFormat.setMaxFractionDigits(new Integer(8));
|
||||
cellDouble.setAutoSynchronizeValue(true);
|
||||
}//initializeCellDouble()//
|
||||
public void initializeCellBigDecimal(com.foundation.view.swt.SimpleTable parent) {
|
||||
cellBigDecimal = new com.foundation.view.swt.cell.CellTextField(parent, CELL_BIG_DECIMAL_COMPONENT, 0);
|
||||
|
||||
com.foundation.view.swt.cell.CellTextField.FloatFormat cellBigDecimalFormat = (com.foundation.view.swt.cell.CellTextField.FloatFormat) cellBigDecimal.initializeFormat(com.foundation.view.swt.cell.CellTextField.FloatFormat.class);
|
||||
cellBigDecimalFormat.setModelType(com.foundation.view.swt.cell.CellTextField.IntegerFormat.DATA_TYPE_BIG_DECIMAL);
|
||||
cellBigDecimalFormat.setValueAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Data.class, CELL_BIG_DECIMAL_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Data.class, test.model.Data.BIG_DECIMAL)}, null,true)}));
|
||||
cellBigDecimalFormat.setMaxFractionDigits(new Integer(10));
|
||||
cellBigDecimal.setAutoSynchronizeValue(true);
|
||||
}//initializeCellBigDecimal()//
|
||||
public void initializeCellCurrency(com.foundation.view.swt.SimpleTable parent) {
|
||||
cellCurrency = new com.foundation.view.swt.cell.CellTextField(parent, CELL_CURRENCY_COMPONENT, 0);
|
||||
|
||||
com.foundation.view.swt.cell.CellTextField.CurrencyFormat cellCurrencyFormat = (com.foundation.view.swt.cell.CellTextField.CurrencyFormat) cellCurrency.initializeFormat(com.foundation.view.swt.cell.CellTextField.CurrencyFormat.class);
|
||||
cellCurrencyFormat.setModelType(com.foundation.view.swt.cell.CellTextField.IntegerFormat.DATA_TYPE_BIG_DECIMAL);
|
||||
cellCurrencyFormat.setValueAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Data.class, CELL_CURRENCY_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Data.class, test.model.Data.CURRENCY)}, null,true)}));
|
||||
cellCurrency.setAutoSynchronizeValue(true);
|
||||
}//initializeCellCurrency()//
|
||||
public void initializeCellPercent(com.foundation.view.swt.SimpleTable parent) {
|
||||
cellPercent = new com.foundation.view.swt.cell.CellTextField(parent, CELL_PERCENT_COMPONENT, 0);
|
||||
|
||||
com.foundation.view.swt.cell.CellTextField.PercentFormat cellPercentFormat = (com.foundation.view.swt.cell.CellTextField.PercentFormat) cellPercent.initializeFormat(com.foundation.view.swt.cell.CellTextField.PercentFormat.class);
|
||||
cellPercentFormat.setModelType(com.foundation.view.swt.cell.CellTextField.IntegerFormat.DATA_TYPE_BIG_DECIMAL);
|
||||
cellPercentFormat.setValueAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Data.class, CELL_PERCENT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Data.class, test.model.Data.PERCENT)}, null,true)}));
|
||||
cellPercentFormat.setMaxFractionDigits(new Integer(2));
|
||||
cellPercentFormat.setMinFractionDigits(new Integer(1));
|
||||
cellPercent.setAutoSynchronizeValue(true);
|
||||
}//initializeCellPercent()//
|
||||
public void initializeCellTime(com.foundation.view.swt.SimpleTable parent) {
|
||||
cellTime = new com.foundation.view.swt.cell.CellDateTime(parent, CELL_TIME_COMPONENT, com.foundation.view.swt.cell.CellDateTime.STYLE_SHORT|com.foundation.view.swt.cell.CellDateTime.STYLE_TIME);
|
||||
|
||||
cellTime.setSelectionAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Data.class, CELL_TIME_ASSOCIATION_SELECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Data.class, test.model.Data.TIME)}, null,true)}));
|
||||
}//initializeCellTime()//
|
||||
public void initializeCellDate(com.foundation.view.swt.SimpleTable parent) {
|
||||
cellDate = new com.foundation.view.swt.cell.CellDateTime(parent, CELL_DATE_COMPONENT, com.foundation.view.swt.cell.CellDateTime.STYLE_MEDIUM|com.foundation.view.swt.cell.CellDateTime.STYLE_DATE);
|
||||
|
||||
cellDate.setSelectionAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Data.class, CELL_DATE_ASSOCIATION_SELECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Data.class, test.model.Data.DATE)}, null,true)}));
|
||||
}//initializeCellDate()//
|
||||
public void initializeSampleTable(com.foundation.view.swt.Container parent) {
|
||||
sampleTable = new com.foundation.view.swt.SimpleTable(parent, SAMPLE_TABLE_COMPONENT, com.foundation.view.swt.SimpleTable.STYLE_BORDER|com.foundation.view.swt.SimpleTable.STYLE_SINGLE);
|
||||
|
||||
sampleTable.setAutoFit(true);
|
||||
com.foundation.view.swt.SimpleTable.ColumnData sampleTableColumnPart0 = sampleTable.addColumn();
|
||||
sampleTableColumnPart0.setHeaderText("Text");
|
||||
initializeCellText(sampleTable);
|
||||
sampleTableColumnPart0.addCellComponent(test.model.Data.class, cellText);
|
||||
com.foundation.view.swt.SimpleTable.ColumnData sampleTableColumnPart1 = sampleTable.addColumn();
|
||||
sampleTableColumnPart1.setHeaderText("Byte");
|
||||
initializeCellByte(sampleTable);
|
||||
sampleTableColumnPart1.addCellComponent(test.model.Data.class, cellByte);
|
||||
com.foundation.view.swt.SimpleTable.ColumnData sampleTableColumnPart2 = sampleTable.addColumn();
|
||||
sampleTableColumnPart2.setHeaderText("Short");
|
||||
initializeCellShort(sampleTable);
|
||||
sampleTableColumnPart2.addCellComponent(test.model.Data.class, cellShort);
|
||||
com.foundation.view.swt.SimpleTable.ColumnData sampleTableColumnPart3 = sampleTable.addColumn();
|
||||
sampleTableColumnPart3.setHeaderText("Integer");
|
||||
initializeCellInteger(sampleTable);
|
||||
sampleTableColumnPart3.addCellComponent(test.model.Data.class, cellInteger);
|
||||
com.foundation.view.swt.SimpleTable.ColumnData sampleTableColumnPart4 = sampleTable.addColumn();
|
||||
sampleTableColumnPart4.setHeaderText("Long");
|
||||
initializeCellLong(sampleTable);
|
||||
sampleTableColumnPart4.addCellComponent(test.model.Data.class, cellLong);
|
||||
com.foundation.view.swt.SimpleTable.ColumnData sampleTableColumnPart5 = sampleTable.addColumn();
|
||||
sampleTableColumnPart5.setHeaderText("Float");
|
||||
initializeCellFloat(sampleTable);
|
||||
sampleTableColumnPart5.addCellComponent(test.model.Data.class, cellFloat);
|
||||
com.foundation.view.swt.SimpleTable.ColumnData sampleTableColumnPart6 = sampleTable.addColumn();
|
||||
sampleTableColumnPart6.setHeaderText("Double");
|
||||
initializeCellDouble(sampleTable);
|
||||
sampleTableColumnPart6.addCellComponent(test.model.Data.class, cellDouble);
|
||||
com.foundation.view.swt.SimpleTable.ColumnData sampleTableColumnPart7 = sampleTable.addColumn();
|
||||
sampleTableColumnPart7.setHeaderText("BigDecimal");
|
||||
initializeCellBigDecimal(sampleTable);
|
||||
sampleTableColumnPart7.addCellComponent(test.model.Data.class, cellBigDecimal);
|
||||
com.foundation.view.swt.SimpleTable.ColumnData sampleTableColumnPart8 = sampleTable.addColumn();
|
||||
sampleTableColumnPart8.setHeaderText("Currency");
|
||||
initializeCellCurrency(sampleTable);
|
||||
sampleTableColumnPart8.addCellComponent(test.model.Data.class, cellCurrency);
|
||||
com.foundation.view.swt.SimpleTable.ColumnData sampleTableColumnPart9 = sampleTable.addColumn();
|
||||
sampleTableColumnPart9.setHeaderText("Percent");
|
||||
initializeCellPercent(sampleTable);
|
||||
sampleTableColumnPart9.addCellComponent(test.model.Data.class, cellPercent);
|
||||
com.foundation.view.swt.SimpleTable.ColumnData sampleTableColumnPart10 = sampleTable.addColumn();
|
||||
sampleTableColumnPart10.setHeaderText("Time");
|
||||
initializeCellTime(sampleTable);
|
||||
sampleTableColumnPart10.addCellComponent(test.model.Data.class, cellTime);
|
||||
com.foundation.view.swt.SimpleTable.ColumnData sampleTableColumnPart11 = sampleTable.addColumn();
|
||||
sampleTableColumnPart11.setHeaderText("Date");
|
||||
initializeCellDate(sampleTable);
|
||||
sampleTableColumnPart11.addCellComponent(test.model.Data.class, cellDate);
|
||||
sampleTable.setRowHeight(new Integer(18));
|
||||
sampleTable.setAutoSynchronizeSelection(true);
|
||||
sampleTable.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TableEditorPageViewController.class, SAMPLE_TABLE_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TableEditorPageViewController.class, test.local.view.controller.TableEditorPageViewController.DATA)}, null,true)}));
|
||||
}//initializeSampleTable()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeSampleTable(this);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(this);
|
||||
|
||||
layout.setNumColumns(1);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
this.setDefaultContainerTitle("Table");
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case CELL_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getText();
|
||||
break;
|
||||
case CELL_BYTE_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getByte();
|
||||
break;
|
||||
case CELL_SHORT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getShort();
|
||||
break;
|
||||
case CELL_INTEGER_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getInteger();
|
||||
break;
|
||||
case CELL_LONG_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getLong();
|
||||
break;
|
||||
case CELL_FLOAT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getFloat();
|
||||
break;
|
||||
case CELL_DOUBLE_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getDouble();
|
||||
break;
|
||||
case CELL_BIG_DECIMAL_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getBigDecimal();
|
||||
break;
|
||||
case CELL_CURRENCY_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getCurrency();
|
||||
break;
|
||||
case CELL_PERCENT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getPercent();
|
||||
break;
|
||||
case CELL_TIME_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getTime();
|
||||
break;
|
||||
case CELL_DATE_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getDate();
|
||||
break;
|
||||
case SAMPLE_TABLE_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TableEditorPageViewController) value).getData();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case CELL_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getOldAttributeValue(test.model.Data.TEXT);
|
||||
break;
|
||||
case CELL_BYTE_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getOldAttributeValue(test.model.Data.BYTE);
|
||||
break;
|
||||
case CELL_SHORT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getOldAttributeValue(test.model.Data.SHORT);
|
||||
break;
|
||||
case CELL_INTEGER_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getOldAttributeValue(test.model.Data.INTEGER);
|
||||
break;
|
||||
case CELL_LONG_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getOldAttributeValue(test.model.Data.LONG);
|
||||
break;
|
||||
case CELL_FLOAT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getOldAttributeValue(test.model.Data.FLOAT);
|
||||
break;
|
||||
case CELL_DOUBLE_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getOldAttributeValue(test.model.Data.DOUBLE);
|
||||
break;
|
||||
case CELL_BIG_DECIMAL_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getOldAttributeValue(test.model.Data.BIG_DECIMAL);
|
||||
break;
|
||||
case CELL_CURRENCY_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getOldAttributeValue(test.model.Data.CURRENCY);
|
||||
break;
|
||||
case CELL_PERCENT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getOldAttributeValue(test.model.Data.PERCENT);
|
||||
break;
|
||||
case CELL_TIME_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getOldAttributeValue(test.model.Data.TIME);
|
||||
break;
|
||||
case CELL_DATE_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.model.Data) value).getOldAttributeValue(test.model.Data.DATE);
|
||||
break;
|
||||
case SAMPLE_TABLE_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TableEditorPageViewController) value).getOldAttributeValue(test.local.view.controller.TableEditorPageViewController.DATA);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
case CELL_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
((test.model.Data) value).setText((java.lang.String) parameters[0]);
|
||||
break;
|
||||
case CELL_BYTE_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
((test.model.Data) value).setByte((java.lang.Byte) parameters[0]);
|
||||
break;
|
||||
case CELL_SHORT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
((test.model.Data) value).setShort((java.lang.Short) parameters[0]);
|
||||
break;
|
||||
case CELL_INTEGER_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
((test.model.Data) value).setInteger((java.lang.Integer) parameters[0]);
|
||||
break;
|
||||
case CELL_LONG_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
((test.model.Data) value).setLong((java.lang.Long) parameters[0]);
|
||||
break;
|
||||
case CELL_FLOAT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
((test.model.Data) value).setFloat((java.lang.Float) parameters[0]);
|
||||
break;
|
||||
case CELL_DOUBLE_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
((test.model.Data) value).setDouble((java.lang.Double) parameters[0]);
|
||||
break;
|
||||
case CELL_BIG_DECIMAL_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
((test.model.Data) value).setBigDecimal((java.math.BigDecimal) parameters[0]);
|
||||
break;
|
||||
case CELL_CURRENCY_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
((test.model.Data) value).setCurrency((java.math.BigDecimal) parameters[0]);
|
||||
break;
|
||||
case CELL_PERCENT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
((test.model.Data) value).setPercent((java.math.BigDecimal) parameters[0]);
|
||||
break;
|
||||
case CELL_TIME_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
((test.model.Data) value).setTime((java.util.Date) parameters[0]);
|
||||
break;
|
||||
case CELL_DATE_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
((test.model.Data) value).setDate((java.util.Date) parameters[0]);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
{ //sampleTable//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.verticalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
layoutData.grabExcessVerticalSpace = true;
|
||||
sampleTable.setLayoutData(layoutData);
|
||||
}//block//
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.SimpleTable getVpSampleTable() {
|
||||
return sampleTable;
|
||||
}//getVpSampleTable()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellTextField getVpCellText() {
|
||||
return cellText;
|
||||
}//getVpCellText()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellTextField getVpCellByte() {
|
||||
return cellByte;
|
||||
}//getVpCellByte()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellTextField getVpCellShort() {
|
||||
return cellShort;
|
||||
}//getVpCellShort()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellTextField getVpCellInteger() {
|
||||
return cellInteger;
|
||||
}//getVpCellInteger()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellTextField getVpCellLong() {
|
||||
return cellLong;
|
||||
}//getVpCellLong()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellTextField getVpCellFloat() {
|
||||
return cellFloat;
|
||||
}//getVpCellFloat()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellTextField getVpCellDouble() {
|
||||
return cellDouble;
|
||||
}//getVpCellDouble()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellTextField getVpCellBigDecimal() {
|
||||
return cellBigDecimal;
|
||||
}//getVpCellBigDecimal()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellTextField getVpCellCurrency() {
|
||||
return cellCurrency;
|
||||
}//getVpCellCurrency()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellTextField getVpCellPercent() {
|
||||
return cellPercent;
|
||||
}//getVpCellPercent()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellDateTime getVpCellTime() {
|
||||
return cellTime;
|
||||
}//getVpCellTime()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellDateTime getVpCellDate() {
|
||||
return cellDate;
|
||||
}//getVpCellDate()//
|
||||
}//TableEditorPageView//
|
||||
@@ -0,0 +1,157 @@
|
||||
<?xml version="1.0"?>
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name='thick:swt'/>
|
||||
</metadata>
|
||||
<panel style='' name='TableEditorPageView' container-title='Table'>
|
||||
<grid-layout column-count='1'/>
|
||||
<value-holder type='test.local.view.controller.TableEditorPageViewController' name='controllerHolder'/>
|
||||
<simple-table auto-synchronize-selection='true' style='single selection | border' row-height='18' auto-fit='true' name='sampleTable'>
|
||||
<grid-layout-data horizontal-alignment='fill' vertical-fill='true' horizontal-fill='true' vertical-alignment='fill'/>
|
||||
|
||||
<association attribute='data' function='collection' value-holder='controllerHolder'/>
|
||||
|
||||
<columns>
|
||||
<column header-text='Text'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Data'>
|
||||
<cell-text auto-synchronize-text='true' style='' name='cellText'>
|
||||
<text-format>
|
||||
<association attribute='text' function='value' row-type='test.model.Data'/>
|
||||
</text-format>
|
||||
</cell-text>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<column header-text='Byte'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Data'>
|
||||
<cell-text auto-synchronize-text='true' style='' name='cellByte'>
|
||||
<integer-format model-type="byte">
|
||||
<association attribute='byte' function='value' row-type='test.model.Data'/>
|
||||
</integer-format>
|
||||
</cell-text>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<column header-text='Short'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Data'>
|
||||
<cell-text auto-synchronize-text='true' style='' name='cellShort'>
|
||||
<integer-format model-type="short">
|
||||
<association attribute='short' function='value' row-type='test.model.Data'/>
|
||||
</integer-format>
|
||||
</cell-text>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<column header-text='Integer'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Data'>
|
||||
<cell-text auto-synchronize-text='true' style='' name='cellInteger'>
|
||||
<integer-format model-type="integer">
|
||||
<association attribute='integer' function='value' row-type='test.model.Data'/>
|
||||
</integer-format>
|
||||
</cell-text>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<column header-text='Long'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Data'>
|
||||
<cell-text auto-synchronize-text='true' style='' name='cellLong'>
|
||||
<integer-format model-type="long">
|
||||
<association attribute='long' function='value' row-type='test.model.Data'/>
|
||||
</integer-format>
|
||||
</cell-text>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<column header-text='Float'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Data'>
|
||||
<cell-text auto-synchronize-text='true' style='' name='cellFloat'>
|
||||
<decimal-format model-type="float" max-fraction-digits="4">
|
||||
<association attribute='float' function='value' row-type='test.model.Data'/>
|
||||
</decimal-format>
|
||||
</cell-text>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<column header-text='Double'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Data'>
|
||||
<cell-text auto-synchronize-text='true' style='' name='cellDouble'>
|
||||
<decimal-format model-type="double" max-fraction-digits="8">
|
||||
<association attribute='double' function='value' row-type='test.model.Data'/>
|
||||
</decimal-format>
|
||||
</cell-text>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<column header-text='BigDecimal'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Data'>
|
||||
<cell-text auto-synchronize-text='true' style='' name='cellBigDecimal'>
|
||||
<decimal-format model-type="big-decimal" max-fraction-digits="10">
|
||||
<association attribute='bigDecimal' function='value' row-type='test.model.Data'/>
|
||||
</decimal-format>
|
||||
</cell-text>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<column header-text='Currency'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Data'>
|
||||
<cell-text auto-synchronize-text='true' style='' name='cellCurrency'>
|
||||
<currency-format model-type="big-decimal">
|
||||
<association attribute='currency' function='value' row-type='test.model.Data'/>
|
||||
</currency-format>
|
||||
</cell-text>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<column header-text='Percent'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Data'>
|
||||
<cell-text auto-synchronize-text='true' style='' name='cellPercent'>
|
||||
<percent-format model-type="big-decimal" max-fraction-digits="2" min-fraction-digits="1">
|
||||
<association attribute='percent' function='value' row-type='test.model.Data'/>
|
||||
</percent-format>
|
||||
</cell-text>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<column header-text='Time'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Data'>
|
||||
<cell-date-time style='short | time' name='cellTime'>
|
||||
<association attribute='time' function='selection' row-type='test.model.Data'/>
|
||||
</cell-date-time>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<column header-text='Date'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Data'>
|
||||
<cell-date-time style='medium | date' name='cellDate'>
|
||||
<association attribute='date' function='selection' row-type='test.model.Data'/>
|
||||
</cell-date-time>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<!--
|
||||
<column header-text='Calendar'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Data'>
|
||||
<cell-date-time style='long | calendar' name='cellCalendar'>
|
||||
<association attribute='calendar' function='selection' row-type='test.model.Data'/>
|
||||
</cell-date-time>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
-->
|
||||
</columns>
|
||||
</simple-table>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,634 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* TablePageView
|
||||
*/
|
||||
public class TablePageView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String TABLE_TOOLS_COMPONENT = "tableTools";
|
||||
public static final String ADD_TOOL_ITEM_COMPONENT = "addToolItem";
|
||||
public static final String REMOVE_TOOL_ITEM_COMPONENT = "removeToolItem";
|
||||
public static final String REMOVE_ALL_TOOL_ITEM_COMPONENT = "removeAllToolItem";
|
||||
public static final String TEST_HYPERLINK_COMPONENT = "testHyperlink";
|
||||
public static final String TEST_HYPERLINK2_COMPONENT = "testHyperlink2";
|
||||
public static final String CLEAR_SELECTION_LINK_COMPONENT = "clearSelectionLink";
|
||||
public static final String SAMPLE_TABLE1_LABEL_COMPONENT = "sampleTable1Label";
|
||||
public static final String SAMPLE_TABLE_COMPONENT = "sampleTable";
|
||||
public static final String FIRST_CELL_PANEL_COMPONENT = "firstCellPanel";
|
||||
public static final String FIRST_CELL_BUTTON_COMPONENT = "firstCellButton";
|
||||
public static final String SECOND_CELL_BUTTON_COMPONENT = "secondCellButton";
|
||||
public static final String FIRST_CELL_PROGRESS_COMPONENT = "firstCellProgress";
|
||||
public static final String FIRST_CELL_COMBO_COMPONENT = "firstCellCombo";
|
||||
public static final String FIRST_CELL_TEXT_COMPONENT = "firstCellText";
|
||||
public static final String INNER_VIEW_COMPONENT = "innerView";
|
||||
public static final String TABLE_PAGE_VIEW_COMPONENT = "TablePageView";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int SAMPLE_TABLE_COLUMN_PART0_ASSOCIATION_COLUMN_HEADER_IMAGE_ASSOCIATION_0 = 0;
|
||||
protected static final int SAMPLE_TABLE_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0 = 1;
|
||||
protected static final int SAMPLE_TABLE_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_IMAGE_ASSOCIATION_0 = 2;
|
||||
protected static final int FIRST_CELL_PROGRESS_ASSOCIATION_PROGRESS_ASSOCIATION_0 = 3;
|
||||
protected static final int FIRST_CELL_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 4;
|
||||
protected static final int FIRST_CELL_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0 = 5;
|
||||
protected static final int FIRST_CELL_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0 = 6;
|
||||
protected static final int FIRST_CELL_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 7;
|
||||
protected static final int SAMPLE_TABLE_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 8;
|
||||
protected static final int SAMPLE_TABLE_ASSOCIATION_SELECTION_ASSOCIATION_0 = 9;
|
||||
protected static final int SAMPLE_TABLE_ASSOCIATION_DATA_0_ASSOCIATION_0 = 10;
|
||||
protected static final int SAMPLE_TABLE_ASSOCIATION_DATA_1_ASSOCIATION_0 = 11;
|
||||
protected static final int INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0 = 12;
|
||||
protected static final int INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0 = 13;
|
||||
|
||||
//Method Association Identifiers//
|
||||
protected static final int ADD_TOOL_ITEM_SELECTION_METHOD_ASSOCIATION = 0;
|
||||
protected static final int REMOVE_TOOL_ITEM_SELECTION_METHOD_ASSOCIATION = 1;
|
||||
protected static final int REMOVE_ALL_TOOL_ITEM_SELECTION_METHOD_ASSOCIATION = 2;
|
||||
protected static final int TEST_HYPERLINK_SELECTION_METHOD_ASSOCIATION = 3;
|
||||
protected static final int TEST_HYPERLINK2_SELECTION_METHOD_ASSOCIATION = 4;
|
||||
protected static final int CLEAR_SELECTION_LINK_SELECTION_METHOD_ASSOCIATION = 5;
|
||||
protected static final int FIRST_CELL_BUTTON_SELECTION_METHOD_ASSOCIATION = 6;
|
||||
protected static final int SECOND_CELL_BUTTON_SELECTION_METHOD_ASSOCIATION = 7;
|
||||
protected static final int SAMPLE_TABLE_KEY_BINDING_8_0 = 8;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.ToolBar tableTools = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem addToolItem = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem removeToolItem = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem removeAllToolItem = null;
|
||||
private com.foundation.view.swt.Link testHyperlink = null;
|
||||
private com.foundation.view.swt.Link testHyperlink2 = null;
|
||||
private com.foundation.view.swt.Link clearSelectionLink = null;
|
||||
private com.foundation.view.swt.Label sampleTable1Label = null;
|
||||
private com.foundation.view.swt.SimpleTable sampleTable = null;
|
||||
private com.foundation.view.swt.cell.CellPanel firstCellPanel = null;
|
||||
private com.foundation.view.swt.cell.CellButton firstCellButton = null;
|
||||
private com.foundation.view.swt.cell.CellButton secondCellButton = null;
|
||||
private com.foundation.view.swt.cell.CellProgress firstCellProgress = null;
|
||||
private com.foundation.view.swt.cell.CellComboBox firstCellCombo = null;
|
||||
private com.foundation.view.swt.cell.CellTextField firstCellText = null;
|
||||
private com.foundation.view.swt.SimpleTable.IHiddenBoolean sampleTableHiddenDataPart0 = null;
|
||||
private com.foundation.view.swt.SimpleTable.IHiddenColor sampleTableHiddenDataPart1 = null;
|
||||
private com.foundation.view.swt.PanelViewer innerView = null;
|
||||
/**
|
||||
* TablePageView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public TablePageView() {
|
||||
}//TablePageView()//
|
||||
/**
|
||||
* TablePageView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public TablePageView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, TABLE_PAGE_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//TablePageView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.TablePageViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeAddToolItem(com.foundation.view.swt.Container parent) {
|
||||
addToolItem = new com.foundation.view.swt.ToolBar.ToolItem(parent, ADD_TOOL_ITEM_COMPONENT, com.foundation.view.swt.ToolBar.ToolItem.STYLE_PUSH);
|
||||
|
||||
addToolItem.setText("Add");
|
||||
addToolItem.setSelectionMethod(new com.foundation.view.MethodAssociation(this, ADD_TOOL_ITEM_SELECTION_METHOD_ASSOCIATION, addToolItem, "controllerHolder", null, null));
|
||||
}//initializeAddToolItem()//
|
||||
public void initializeRemoveToolItem(com.foundation.view.swt.Container parent) {
|
||||
removeToolItem = new com.foundation.view.swt.ToolBar.ToolItem(parent, REMOVE_TOOL_ITEM_COMPONENT, com.foundation.view.swt.ToolBar.ToolItem.STYLE_PUSH);
|
||||
|
||||
removeToolItem.setText("Remove");
|
||||
removeToolItem.setSelectionMethod(new com.foundation.view.MethodAssociation(this, REMOVE_TOOL_ITEM_SELECTION_METHOD_ASSOCIATION, removeToolItem, "controllerHolder", null, null));
|
||||
}//initializeRemoveToolItem()//
|
||||
public void initializeRemoveAllToolItem(com.foundation.view.swt.Container parent) {
|
||||
removeAllToolItem = new com.foundation.view.swt.ToolBar.ToolItem(parent, REMOVE_ALL_TOOL_ITEM_COMPONENT, com.foundation.view.swt.ToolBar.ToolItem.STYLE_PUSH);
|
||||
|
||||
removeAllToolItem.setText("Remove All");
|
||||
removeAllToolItem.setSelectionMethod(new com.foundation.view.MethodAssociation(this, REMOVE_ALL_TOOL_ITEM_SELECTION_METHOD_ASSOCIATION, removeAllToolItem, "controllerHolder", null, null));
|
||||
}//initializeRemoveAllToolItem()//
|
||||
public void initializeTableTools(com.foundation.view.swt.Container parent) {
|
||||
tableTools = new com.foundation.view.swt.ToolBar(parent, TABLE_TOOLS_COMPONENT, com.foundation.view.swt.ToolBar.STYLE_HORIZONTAL);
|
||||
|
||||
initializeAddToolItem(tableTools);
|
||||
initializeRemoveToolItem(tableTools);
|
||||
initializeRemoveAllToolItem(tableTools);
|
||||
}//initializeTableTools()//
|
||||
public void initializeTestHyperlink(com.foundation.view.swt.Container parent) {
|
||||
testHyperlink = new com.foundation.view.swt.Link(parent, TEST_HYPERLINK_COMPONENT, 0);
|
||||
|
||||
testHyperlink.setText("<a>Turn OFF the label.</a>");
|
||||
testHyperlink.setSelectionMethod(new com.foundation.view.MethodAssociation(this, TEST_HYPERLINK_SELECTION_METHOD_ASSOCIATION, testHyperlink, "controllerHolder", null, null));
|
||||
testHyperlink.setDefaultIsVisible(false);
|
||||
}//initializeTestHyperlink()//
|
||||
public void initializeTestHyperlink2(com.foundation.view.swt.Container parent) {
|
||||
testHyperlink2 = new com.foundation.view.swt.Link(parent, TEST_HYPERLINK2_COMPONENT, 0);
|
||||
|
||||
testHyperlink2.setText("<a>Turn ON the label.</a>");
|
||||
testHyperlink2.setSelectionMethod(new com.foundation.view.MethodAssociation(this, TEST_HYPERLINK2_SELECTION_METHOD_ASSOCIATION, testHyperlink2, "controllerHolder", null, null));
|
||||
testHyperlink2.setDefaultIsVisible(false);
|
||||
}//initializeTestHyperlink2()//
|
||||
public void initializeClearSelectionLink(com.foundation.view.swt.Container parent) {
|
||||
clearSelectionLink = new com.foundation.view.swt.Link(parent, CLEAR_SELECTION_LINK_COMPONENT, 0);
|
||||
|
||||
clearSelectionLink.setText("<a>Clear selection.</a>");
|
||||
clearSelectionLink.setSelectionMethod(new com.foundation.view.MethodAssociation(this, CLEAR_SELECTION_LINK_SELECTION_METHOD_ASSOCIATION, clearSelectionLink, "controllerHolder", null, null));
|
||||
clearSelectionLink.setDefaultIsVisible(true);
|
||||
}//initializeClearSelectionLink()//
|
||||
public void initializeSampleTable1Label(com.foundation.view.swt.Container parent) {
|
||||
sampleTable1Label = new com.foundation.view.swt.Label(parent, SAMPLE_TABLE1_LABEL_COMPONENT, 0);
|
||||
|
||||
sampleTable1Label.setText("Table of projects:");
|
||||
}//initializeSampleTable1Label()//
|
||||
public void initializeFirstCellButton(com.foundation.view.swt.cell.CellPanel parent) {
|
||||
firstCellButton = new com.foundation.view.swt.cell.CellButton(parent, FIRST_CELL_BUTTON_COMPONENT, 0);
|
||||
|
||||
firstCellButton.setText("...");
|
||||
firstCellButton.setSelectionMethod(new com.foundation.view.MethodAssociation(this, FIRST_CELL_BUTTON_SELECTION_METHOD_ASSOCIATION, firstCellButton, "controllerHolder", null, null));
|
||||
}//initializeFirstCellButton()//
|
||||
public void initializeSecondCellButton(com.foundation.view.swt.cell.CellPanel parent) {
|
||||
secondCellButton = new com.foundation.view.swt.cell.CellButton(parent, SECOND_CELL_BUTTON_COMPONENT, 0);
|
||||
|
||||
secondCellButton.setText("...");
|
||||
secondCellButton.setSelectionMethod(new com.foundation.view.MethodAssociation(this, SECOND_CELL_BUTTON_SELECTION_METHOD_ASSOCIATION, secondCellButton, "controllerHolder", null, null));
|
||||
}//initializeSecondCellButton()//
|
||||
public void initializeFirstCellPanel(com.foundation.view.swt.SimpleTable parent) {
|
||||
firstCellPanel = new com.foundation.view.swt.cell.CellPanel(parent, FIRST_CELL_PANEL_COMPONENT, 0);
|
||||
|
||||
initializeFirstCellButton(firstCellPanel);
|
||||
initializeSecondCellButton(firstCellPanel);
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(firstCellPanel);
|
||||
|
||||
layout.setMarginHeight(0);
|
||||
layout.setMarginWidth(2);
|
||||
firstCellPanel.setLayout(layout);
|
||||
firstCellPanel.setTabOrder(new com.foundation.view.swt.cell.CellComponent[] {});
|
||||
}//initializeFirstCellPanel()//
|
||||
public void initializeFirstCellProgress(com.foundation.view.swt.SimpleTable parent) {
|
||||
firstCellProgress = new com.foundation.view.swt.cell.CellProgress(parent, FIRST_CELL_PROGRESS_COMPONENT, 0);
|
||||
|
||||
firstCellProgress.setProgress(new java.math.BigDecimal("0"));
|
||||
firstCellProgress.setMinimum(new Integer(0));
|
||||
firstCellProgress.setMaximum(new Integer(100));
|
||||
firstCellProgress.setMultiplier(new java.math.BigDecimal("100"));
|
||||
firstCellProgress.setProgressAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Project.class, FIRST_CELL_PROGRESS_ASSOCIATION_PROGRESS_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Project.class, test.model.Project.PROGRESS)}, null,true)}));
|
||||
}//initializeFirstCellProgress()//
|
||||
public void initializeFirstCellCombo(com.foundation.view.swt.SimpleTable parent) {
|
||||
firstCellCombo = new com.foundation.view.swt.cell.CellComboBox(parent, FIRST_CELL_COMBO_COMPONENT, com.foundation.view.swt.cell.CellComboBox.STYLE_DROP_DOWN|com.foundation.view.swt.cell.CellComboBox.STYLE_READ_ONLY);
|
||||
|
||||
firstCellCombo.setAutoSynchronizeSelection(true);
|
||||
firstCellCombo.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TablePageViewController.class, FIRST_CELL_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TablePageViewController.class, test.local.view.controller.TablePageViewController.PRIORITIES)}, null,true)}));
|
||||
firstCellCombo.setSelectionAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Project.class, FIRST_CELL_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Project.class, test.model.Project.PRIORITY)}, null,true)}));
|
||||
firstCellCombo.setFont(com.foundation.view.JefFont.getJefFonts("arial, 8, normal"));
|
||||
firstCellCombo.setItemTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Priority.class, FIRST_CELL_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Priority.class, test.model.Priority.NAME)}, null,true)}));
|
||||
}//initializeFirstCellCombo()//
|
||||
public void initializeFirstCellText(com.foundation.view.swt.SimpleTable parent) {
|
||||
firstCellText = new com.foundation.view.swt.cell.CellTextField(parent, FIRST_CELL_TEXT_COMPONENT, 0);
|
||||
|
||||
com.foundation.view.swt.cell.CellTextField.TextFormat firstCellTextFormat = (com.foundation.view.swt.cell.CellTextField.TextFormat) firstCellText.initializeFormat(com.foundation.view.swt.cell.CellTextField.TextFormat.class);
|
||||
firstCellTextFormat.setValueAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Project.class, FIRST_CELL_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Project.class, test.model.Project.NAME)}, null,true)}));
|
||||
firstCellText.setAutoSynchronizeValue(true);
|
||||
}//initializeFirstCellText()//
|
||||
public void initializeSampleTable(com.foundation.view.swt.Container parent) {
|
||||
sampleTable = new com.foundation.view.swt.SimpleTable(parent, SAMPLE_TABLE_COMPONENT, com.foundation.view.swt.SimpleTable.STYLE_BORDER|com.foundation.view.swt.SimpleTable.STYLE_SINGLE);
|
||||
|
||||
sampleTable.showGridLines(true);
|
||||
sampleTable.setAutoFit(true);
|
||||
com.foundation.view.swt.SimpleTable.ColumnData sampleTableColumnPart0 = sampleTable.addColumn();
|
||||
sampleTableColumnPart0.setHeaderText("Name");
|
||||
sampleTableColumnPart0.setHeaderResizeable(false);
|
||||
sampleTableColumnPart0.setMinimumWidth(150);
|
||||
sampleTableColumnPart0.setHeaderImageAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TablePageViewController.class, SAMPLE_TABLE_COLUMN_PART0_ASSOCIATION_COLUMN_HEADER_IMAGE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TablePageViewController.class, test.local.view.controller.TablePageViewController.COOL_IMAGE)}, null,true)}));
|
||||
sampleTableColumnPart0.setCellTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Project.class, SAMPLE_TABLE_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Project.class, test.model.Project.NAME)}, null,true)}));
|
||||
sampleTableColumnPart0.setCellImageAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Project.class, SAMPLE_TABLE_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_IMAGE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[0],"controllerHolder",true)}));
|
||||
com.foundation.view.swt.SimpleTable.ColumnData sampleTableColumnPart1 = sampleTable.addColumn();
|
||||
sampleTableColumnPart1.setHeaderText("Button");
|
||||
sampleTableColumnPart1.setHeaderImage(new com.foundation.view.resource.ResourceReference("res://View/ProjectEditor/CoolImage"));
|
||||
initializeFirstCellPanel(sampleTable);
|
||||
sampleTableColumnPart1.addCellComponent(test.model.Project.class, firstCellPanel);
|
||||
com.foundation.view.swt.SimpleTable.ColumnData sampleTableColumnPart2 = sampleTable.addColumn();
|
||||
sampleTableColumnPart2.setHeaderText("Progress");
|
||||
initializeFirstCellProgress(sampleTable);
|
||||
sampleTableColumnPart2.addCellComponent(test.model.Project.class, firstCellProgress);
|
||||
com.foundation.view.swt.SimpleTable.ColumnData sampleTableColumnPart3 = sampleTable.addColumn();
|
||||
sampleTableColumnPart3.setHeaderText("Combo");
|
||||
initializeFirstCellCombo(sampleTable);
|
||||
sampleTableColumnPart3.addCellComponent(test.model.Project.class, firstCellCombo);
|
||||
com.foundation.view.swt.SimpleTable.ColumnData sampleTableColumnPart4 = sampleTable.addColumn();
|
||||
sampleTableColumnPart4.setHeaderText("Text");
|
||||
initializeFirstCellText(sampleTable);
|
||||
sampleTableColumnPart4.addCellComponent(test.model.Project.class, firstCellText);
|
||||
sampleTable.setDecorateItems(true);
|
||||
sampleTable.setRowForegroundColor(new com.foundation.view.JefColor("red"));
|
||||
sampleTable.setRowSelectionGradient(new com.foundation.view.JefGradient("(255,0,255,255),(255,69,208,159),diagonal"));
|
||||
sampleTable.setAutoSynchronizeSelection(true);
|
||||
sampleTable.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TablePageViewController.class, SAMPLE_TABLE_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TablePageViewController.class, test.local.view.controller.TablePageViewController.PROJECTS)}, null,true)}));
|
||||
sampleTable.setSelectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TablePageViewController.class, SAMPLE_TABLE_ASSOCIATION_SELECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TablePageViewController.class, test.local.view.controller.TablePageViewController.SELECTION)}, null,true)}));
|
||||
sampleTableHiddenDataPart0 = sampleTable.addHiddenBoolean();
|
||||
sampleTableHiddenDataPart0.setDataAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Project.class, SAMPLE_TABLE_ASSOCIATION_DATA_0_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Project.class, test.model.Project.FLAG)}, null,true)}));
|
||||
sampleTableHiddenDataPart1 = sampleTable.addHiddenColor();
|
||||
sampleTableHiddenDataPart1.setData(new com.foundation.view.JefColor("(255,255,0,0)"));
|
||||
sampleTableHiddenDataPart1.setDataAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(java.lang.Object.class, SAMPLE_TABLE_ASSOCIATION_DATA_1_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[0],"controllerHolder",true)}));
|
||||
sampleTable.addKeyBinding(new com.foundation.view.KeyBinding(this, SAMPLE_TABLE_KEY_BINDING_8_0, sampleTable, "controllerHolder", null, null, 0, new Integer(8)));
|
||||
}//initializeSampleTable()//
|
||||
public void initializeInnerView(com.foundation.view.swt.Container parent) {
|
||||
innerView = new com.foundation.view.swt.PanelViewer(parent, INNER_VIEW_COMPONENT, com.foundation.view.swt.PanelViewer.STYLE_BORDER);
|
||||
|
||||
innerView.setControllerAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TablePageViewController.class, INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TablePageViewController.class, test.local.view.controller.TablePageViewController.EDITOR)}, null,true)}));
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(innerView);
|
||||
|
||||
innerView.setLayout(layout);
|
||||
innerView.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
innerView.setDefaultIsVisible(false);
|
||||
innerView.setIsVisibleAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TablePageViewController.class, INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TablePageViewController.class, test.local.view.controller.TablePageViewController.EDITOR)}, null,true)}));
|
||||
}//initializeInnerView()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeTableTools(this);
|
||||
initializeTestHyperlink(this);
|
||||
initializeTestHyperlink2(this);
|
||||
initializeClearSelectionLink(this);
|
||||
initializeSampleTable1Label(this);
|
||||
initializeSampleTable(this);
|
||||
initializeInnerView(this);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(this);
|
||||
|
||||
layout.setNumColumns(1);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
this.setDefaultContainerTitle("Table");
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
case ADD_TOOL_ITEM_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.TablePageViewController) value).doAddProject();
|
||||
break;
|
||||
case REMOVE_TOOL_ITEM_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.TablePageViewController) value).doRemoveProject();
|
||||
break;
|
||||
case REMOVE_ALL_TOOL_ITEM_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.TablePageViewController) value).doRemoveAllProjects();
|
||||
break;
|
||||
case TEST_HYPERLINK_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.TablePageViewController) value).toggleFlag();
|
||||
break;
|
||||
case TEST_HYPERLINK2_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.TablePageViewController) value).toggleFlag();
|
||||
break;
|
||||
case CLEAR_SELECTION_LINK_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.TablePageViewController) value).clearSelection();
|
||||
break;
|
||||
case FIRST_CELL_BUTTON_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.TablePageViewController) value).doProjectButtonPressed((test.model.Project) parameters[0]);
|
||||
break;
|
||||
case SECOND_CELL_BUTTON_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.TablePageViewController) value).doProjectButtonPressed((test.model.Project) parameters[0]);
|
||||
break;
|
||||
case SAMPLE_TABLE_KEY_BINDING_8_0:
|
||||
((test.local.view.controller.TablePageViewController) value).doRemoveProject();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case SAMPLE_TABLE_COLUMN_PART0_ASSOCIATION_COLUMN_HEADER_IMAGE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TablePageViewController) value).getCoolImage();
|
||||
break;
|
||||
case SAMPLE_TABLE_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getName();
|
||||
break;
|
||||
case SAMPLE_TABLE_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_IMAGE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TablePageViewController) value).getCoolImage();
|
||||
break;
|
||||
case FIRST_CELL_PROGRESS_ASSOCIATION_PROGRESS_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getProgress();
|
||||
break;
|
||||
case FIRST_CELL_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TablePageViewController) value).getPriorities();
|
||||
break;
|
||||
case FIRST_CELL_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getPriority();
|
||||
break;
|
||||
case FIRST_CELL_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Priority) value).getName();
|
||||
break;
|
||||
case FIRST_CELL_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getName();
|
||||
break;
|
||||
case SAMPLE_TABLE_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TablePageViewController) value).getProjects();
|
||||
break;
|
||||
case SAMPLE_TABLE_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TablePageViewController) value).getSelection();
|
||||
break;
|
||||
case SAMPLE_TABLE_ASSOCIATION_DATA_0_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getFlag();
|
||||
break;
|
||||
case SAMPLE_TABLE_ASSOCIATION_DATA_1_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TablePageViewController) value).getObjectColor((java.lang.Object) parameters[0]);
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TablePageViewController) value).getEditor();
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TablePageViewController) value).getEditor();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case SAMPLE_TABLE_COLUMN_PART0_ASSOCIATION_COLUMN_HEADER_IMAGE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TablePageViewController) value).getOldAttributeValue(test.local.view.controller.TablePageViewController.COOL_IMAGE);
|
||||
break;
|
||||
case SAMPLE_TABLE_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getOldAttributeValue(test.model.Project.NAME);
|
||||
break;
|
||||
case FIRST_CELL_PROGRESS_ASSOCIATION_PROGRESS_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getOldAttributeValue(test.model.Project.PROGRESS);
|
||||
break;
|
||||
case FIRST_CELL_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TablePageViewController) value).getOldAttributeValue(test.local.view.controller.TablePageViewController.PRIORITIES);
|
||||
break;
|
||||
case FIRST_CELL_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getOldAttributeValue(test.model.Project.PRIORITY);
|
||||
break;
|
||||
case FIRST_CELL_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Priority) value).getOldAttributeValue(test.model.Priority.NAME);
|
||||
break;
|
||||
case FIRST_CELL_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getOldAttributeValue(test.model.Project.NAME);
|
||||
break;
|
||||
case SAMPLE_TABLE_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TablePageViewController) value).getOldAttributeValue(test.local.view.controller.TablePageViewController.PROJECTS);
|
||||
break;
|
||||
case SAMPLE_TABLE_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TablePageViewController) value).getOldAttributeValue(test.local.view.controller.TablePageViewController.SELECTION);
|
||||
break;
|
||||
case SAMPLE_TABLE_ASSOCIATION_DATA_0_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getOldAttributeValue(test.model.Project.FLAG);
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TablePageViewController) value).getOldAttributeValue(test.local.view.controller.TablePageViewController.EDITOR);
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TablePageViewController) value).getOldAttributeValue(test.local.view.controller.TablePageViewController.EDITOR);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
case FIRST_CELL_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
((test.model.Project) value).setPriority((test.model.Priority) parameters[0]);
|
||||
break;
|
||||
case FIRST_CELL_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
((test.model.Project) value).setName((java.lang.String) parameters[0]);
|
||||
break;
|
||||
case SAMPLE_TABLE_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
((test.local.view.controller.TablePageViewController) value).setSelection((java.lang.Object) parameters[0]);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
{ //sampleTable//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.verticalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
layoutData.grabExcessVerticalSpace = true;
|
||||
sampleTable.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //innerView//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
innerView.setLayoutData(layoutData);
|
||||
}//block//
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
sampleTableHiddenDataPart0.addSelectionLink(new com.foundation.view.LinkData(sampleTable1Label, com.foundation.view.swt.Label.LINK_TARGET_IS_VISIBLE, null, false, false));
|
||||
sampleTableHiddenDataPart0.addSelectionLink(new com.foundation.view.LinkData(testHyperlink, com.foundation.view.swt.Link.LINK_TARGET_IS_VISIBLE, null, false, false));
|
||||
sampleTableHiddenDataPart0.addSelectionLink(new com.foundation.view.LinkData(testHyperlink2, com.foundation.view.swt.Link.LINK_TARGET_IS_VISIBLE, null, true, true));
|
||||
sampleTableHiddenDataPart1.addSelectionLink(new com.foundation.view.LinkData(sampleTable1Label, com.foundation.view.swt.Label.LINK_TARGET_BACKGROUND_COLOR, null, false, false));
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar getVpTableTools() {
|
||||
return tableTools;
|
||||
}//getVpTableTools()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpAddToolItem() {
|
||||
return addToolItem;
|
||||
}//getVpAddToolItem()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpRemoveToolItem() {
|
||||
return removeToolItem;
|
||||
}//getVpRemoveToolItem()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpRemoveAllToolItem() {
|
||||
return removeAllToolItem;
|
||||
}//getVpRemoveAllToolItem()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Link getVpTestHyperlink() {
|
||||
return testHyperlink;
|
||||
}//getVpTestHyperlink()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Link getVpTestHyperlink2() {
|
||||
return testHyperlink2;
|
||||
}//getVpTestHyperlink2()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Link getVpClearSelectionLink() {
|
||||
return clearSelectionLink;
|
||||
}//getVpClearSelectionLink()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpSampleTable1Label() {
|
||||
return sampleTable1Label;
|
||||
}//getVpSampleTable1Label()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.SimpleTable getVpSampleTable() {
|
||||
return sampleTable;
|
||||
}//getVpSampleTable()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellPanel getVpFirstCellPanel() {
|
||||
return firstCellPanel;
|
||||
}//getVpFirstCellPanel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellButton getVpFirstCellButton() {
|
||||
return firstCellButton;
|
||||
}//getVpFirstCellButton()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellButton getVpSecondCellButton() {
|
||||
return secondCellButton;
|
||||
}//getVpSecondCellButton()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellProgress getVpFirstCellProgress() {
|
||||
return firstCellProgress;
|
||||
}//getVpFirstCellProgress()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellComboBox getVpFirstCellCombo() {
|
||||
return firstCellCombo;
|
||||
}//getVpFirstCellCombo()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellTextField getVpFirstCellText() {
|
||||
return firstCellText;
|
||||
}//getVpFirstCellText()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.SimpleTable.IHiddenBoolean getVpSampleTableHiddenDataPart0() {
|
||||
return sampleTableHiddenDataPart0;
|
||||
}//getVpSampleTableHiddenDataPart0()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.SimpleTable.IHiddenColor getVpSampleTableHiddenDataPart1() {
|
||||
return sampleTableHiddenDataPart1;
|
||||
}//getVpSampleTableHiddenDataPart1()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.PanelViewer getVpInnerView() {
|
||||
return innerView;
|
||||
}//getVpInnerView()//
|
||||
}//TablePageView//
|
||||
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0"?>
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name='thick:swt'/>
|
||||
</metadata>
|
||||
<panel style='' name='TablePageView' container-title='Table'>
|
||||
<grid-layout column-count='1'/>
|
||||
<value-holder type='test.local.view.controller.TablePageViewController' name='controllerHolder'/>
|
||||
<tool-bar style='horizontal' name='tableTools'>
|
||||
<tool-item style='push' name='addToolItem' text='Add'>
|
||||
<method function='selection' name='doAddProject' value-holder='controllerHolder'/>
|
||||
</tool-item>
|
||||
<tool-item style='push' name='removeToolItem' text='Remove'>
|
||||
<method function='selection' name='doRemoveProject' value-holder='controllerHolder'/>
|
||||
</tool-item>
|
||||
<tool-item style='push' name='removeAllToolItem' text='Remove All'>
|
||||
<method function='selection' name='doRemoveAllProjects' value-holder='controllerHolder'/>
|
||||
</tool-item>
|
||||
</tool-bar>
|
||||
<hyperlink name="testHyperlink" text="<a>Turn OFF the label.</a>" is-visible="false">
|
||||
<method function="selection" name="toggleFlag" value-holder="controllerHolder"/>
|
||||
</hyperlink>
|
||||
<hyperlink name="testHyperlink2" text="<a>Turn ON the label.</a>" is-visible="false">
|
||||
<method function="selection" name="toggleFlag" value-holder="controllerHolder"/>
|
||||
</hyperlink>
|
||||
<hyperlink name="clearSelectionLink" text="<a>Clear selection.</a>" is-visible="true">
|
||||
<method function="selection" name="clearSelection" value-holder="controllerHolder"/>
|
||||
</hyperlink>
|
||||
<label style='' name='sampleTable1Label' text='Table of projects:'/>
|
||||
<simple-table auto-synchronize-selection='true' style='single selection | border' auto-fit='true' name='sampleTable' row-selection-gradient="#FF00FFFF,#FF45D09F,diagonal" row-foreground-color="red" decorate-items="true" show-grid-lines="true">
|
||||
<grid-layout-data horizontal-alignment='fill' vertical-fill='true' horizontal-fill='true' vertical-alignment='fill'/>
|
||||
<association attribute='projects' function='collection' value-holder='controllerHolder'/>
|
||||
<association attribute='selection' function='selection' value-holder='controllerHolder'/>
|
||||
<key character='0x08' method='doRemoveProject' value-holder='controllerHolder'/>
|
||||
|
||||
<columns>
|
||||
<column header-text='Name' resizable='false' minimum-width="150">
|
||||
<association function='header-image' attribute='coolImage' value-holder='controllerHolder'/>
|
||||
<association function='cell-text' attribute='name' row-type='test.model.Project'/>
|
||||
<association function='cell-image' getter='getCoolImage' row-type='test.model.Project' value-holder='controllerHolder'/>
|
||||
</column>
|
||||
<column header-image='res://View/ProjectEditor/CoolImage' header-text='Button'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Project'>
|
||||
<cell-panel name='firstCellPanel'>
|
||||
<fill-layout margin-width='2' margin-height='0'/>
|
||||
<cell-button text='...' name='firstCellButton'>
|
||||
<method value-holder='controllerHolder' function='selection' signature='Ltest.model.Project;' name='doProjectButtonPressed'/>
|
||||
</cell-button>
|
||||
<cell-button text='...' name='secondCellButton'>
|
||||
<method value-holder='controllerHolder' function='selection' signature='Ltest.model.Project;' name='doProjectButtonPressed'/>
|
||||
</cell-button>
|
||||
</cell-panel>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<column header-text='Progress'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Project'>
|
||||
<cell-progress minimum='0' name='firstCellProgress' maximum='100' multiplier="100">
|
||||
<association attribute='progress' function='progress' row-type='test.model.Project'/>
|
||||
</cell-progress>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<column header-text='Combo'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Project'>
|
||||
<cell-combo style='drop down | read only' auto-synchronize-selection='true' name='firstCellCombo' font='arial,8,normal'>
|
||||
<association attribute='priorities' function='collection' value-holder='controllerHolder'/>
|
||||
<association attribute='priority' function='selection' row-type='test.model.Project'/>
|
||||
<association attribute='name' function='item-text' row-type='test.model.Priority'/>
|
||||
</cell-combo>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<column header-text='Text'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Project'>
|
||||
<cell-text auto-synchronize-text='true' style='' name='firstCellText'>
|
||||
<text-format>
|
||||
<association attribute='name' function='value' row-type='test.model.Project'/>
|
||||
</text-format>
|
||||
</cell-text>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
</columns>
|
||||
<hidden-boolean>
|
||||
<association function='data' attribute='flag' row-type='test.model.Project'/>
|
||||
<!--
|
||||
<association function='data' value-holder='controllerHolder' getter='getFlag' getter-signature='Ltest.model.Project;' row-type='test.model.Project'>
|
||||
<association-event event="flag"/>
|
||||
</association>
|
||||
-->
|
||||
<link function='selection' component='sampleTable1Label' target='is-visible'/>
|
||||
<link function='selection' component='testHyperlink' target='is-visible'/>
|
||||
<link function='selection' component='testHyperlink2' target='is-visible' invert-logic="true" null-value="true"/>
|
||||
</hidden-boolean>
|
||||
<hidden-color data='#FFFF00'>
|
||||
<association value-holder='controllerHolder' function='data' getter='getObjectColor' row-type='java.lang.Object' getter-signature='Ljava.lang.Object;'/>
|
||||
<link function='selection' component='sampleTable1Label' target='background-color'/>
|
||||
</hidden-color>
|
||||
</simple-table>
|
||||
<panel-viewer is-visible='false' style='border' name='innerView'>
|
||||
<fill-layout/>
|
||||
<grid-layout-data horizontal-fill='true' horizontal-alignment='fill'/>
|
||||
<association attribute='editor' function='is-visible' value-holder='controllerHolder'/>
|
||||
<association attribute='editor' function='controller' value-holder='controllerHolder'/>
|
||||
</panel-viewer>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,172 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* TablePerformanceTestView
|
||||
*/
|
||||
public class TablePerformanceTestView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String TABLE_PERFORMANCE_TEST_VIEW_COMPONENT = "TablePerformanceTestView";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int UNNAMED_COMPONENT0_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0 = 0;
|
||||
protected static final int UNNAMED_COMPONENT0_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 1;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.SimpleTable unnamedComponent0 = null;
|
||||
/**
|
||||
* TablePerformanceTestView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public TablePerformanceTestView() {
|
||||
}//TablePerformanceTestView()//
|
||||
/**
|
||||
* TablePerformanceTestView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public TablePerformanceTestView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, TABLE_PERFORMANCE_TEST_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//TablePerformanceTestView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.TablePerformanceTestViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeUnnamedComponent0(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent0 = new com.foundation.view.swt.SimpleTable(parent, null, com.foundation.view.swt.SimpleTable.STYLE_BORDER);
|
||||
|
||||
com.foundation.view.swt.SimpleTable.ColumnData unnamedComponent0ColumnPart0 = unnamedComponent0.addColumn();
|
||||
unnamedComponent0ColumnPart0.setHeaderText("toString");
|
||||
unnamedComponent0ColumnPart0.setCellTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Project.class, UNNAMED_COMPONENT0_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Project.class, test.model.Project.NAME)}, null,true)}));
|
||||
unnamedComponent0.setDecorateItems(true);
|
||||
unnamedComponent0.setRowBackgroundColor(new com.foundation.view.JefColor("(255,255,255,0)"));
|
||||
unnamedComponent0.setRowForegroundColor(new com.foundation.view.JefColor("(255,47,47,0)"));
|
||||
unnamedComponent0.setRowBackgroundColorAlt(new com.foundation.view.JefColor("(223,223,223,0)"));
|
||||
unnamedComponent0.setRowForegroundColorAlt(new com.foundation.view.JefColor("(15,15,15,0)"));
|
||||
unnamedComponent0.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TablePerformanceTestViewController.class, UNNAMED_COMPONENT0_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TablePerformanceTestViewController.class, test.local.view.controller.TablePerformanceTestViewController.COLLECTION)}, null,true)}));
|
||||
}//initializeUnnamedComponent0()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeUnnamedComponent0(this);
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(this);
|
||||
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case UNNAMED_COMPONENT0_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getName();
|
||||
break;
|
||||
case UNNAMED_COMPONENT0_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TablePerformanceTestViewController) value).getCollection();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case UNNAMED_COMPONENT0_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getOldAttributeValue(test.model.Project.NAME);
|
||||
break;
|
||||
case UNNAMED_COMPONENT0_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TablePerformanceTestViewController) value).getOldAttributeValue(test.local.view.controller.TablePerformanceTestViewController.COLLECTION);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.SimpleTable getVpUnnamedComponent0() {
|
||||
return unnamedComponent0;
|
||||
}//getVpUnnamedComponent0()//
|
||||
}//TablePerformanceTestView//
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0"?>
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<panel name="TablePerformanceTestView" style="" container-image="" container-title="">
|
||||
<fill-layout/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.TablePerformanceTestViewController"/>
|
||||
|
||||
<simple-table style="border" row-background-color="#FFF" row-foreground-color="#F22" row-background-color-alt="#DDD" row-foreground-color-alt="#000" decorate-items="true">
|
||||
<association function="collection" attribute="collection" value-holder="controllerHolder"/>
|
||||
|
||||
<columns>
|
||||
<column header-text="toString">
|
||||
<!--<association function="cell-text" getter="toString" row-type="java.lang.Object"/>-->
|
||||
<association function="cell-text" attribute="name" row-type="test.model.Project"/>
|
||||
</column>
|
||||
</columns>
|
||||
</simple-table>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,249 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* TeamView
|
||||
*/
|
||||
public class TeamView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String SAMPLE_TREE1_COMPONENT = "sampleTree1";
|
||||
public static final String TEAM_VIEW_COMPONENT = "TeamView";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int SAMPLE_TREE1_ASSOCIATION_CHILDREN_ASSOCIATION = 0;
|
||||
protected static final int SAMPLE_TREE1_ASSOCIATION_GROUPING_ASSOCIATION = 1;
|
||||
protected static final int SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0 = 2;
|
||||
protected static final int SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_1 = 3;
|
||||
protected static final int SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_2 = 4;
|
||||
protected static final int SAMPLE_TREE1_COLUMN_PART1_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0 = 5;
|
||||
protected static final int SAMPLE_TREE1_COLUMN_PART1_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_1 = 6;
|
||||
protected static final int SAMPLE_TREE1_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 7;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.Label unnamedComponent0 = null;
|
||||
private com.foundation.view.swt.SimpleTreeTable sampleTree1 = null;
|
||||
/**
|
||||
* TeamView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public TeamView() {
|
||||
}//TeamView()//
|
||||
/**
|
||||
* TeamView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public TeamView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, TEAM_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//TeamView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.TeamViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeUnnamedComponent0(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent0 = new com.foundation.view.swt.Label(parent, null, 0);
|
||||
|
||||
unnamedComponent0.setText("Tests groupings of items in a tree. (Model: Team -> Project -> Priority) The Project instances are grouped by their priority.");
|
||||
}//initializeUnnamedComponent0()//
|
||||
public void initializeSampleTree1(com.foundation.view.swt.Container parent) {
|
||||
sampleTree1 = new com.foundation.view.swt.SimpleTreeTable(parent, SAMPLE_TREE1_COMPONENT, com.foundation.view.swt.SimpleTreeTable.STYLE_BORDER|com.foundation.view.swt.SimpleTreeTable.STYLE_SINGLE);
|
||||
|
||||
sampleTree1.setAutoFit(true);
|
||||
sampleTree1.setRowHeight(new Integer(20));
|
||||
sampleTree1.setChildAssociation(new com.foundation.view.CollectingMultiAssociationContainer(new com.foundation.view.CollectingMultiAssociation[] {new com.foundation.view.CollectingMultiAssociation(test.model.Team.class, SAMPLE_TREE1_ASSOCIATION_CHILDREN_ASSOCIATION, this, false, null, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(sampleTree1, null, null, test.model.Team.class, test.model.Team.PROJECTS)}, null)}));
|
||||
sampleTree1.setGroupAssociation(new com.foundation.view.CollectingMultiAssociationContainer(new com.foundation.view.CollectingMultiAssociation[] {new com.foundation.view.CollectingMultiAssociation(test.model.Project.class, SAMPLE_TREE1_ASSOCIATION_GROUPING_ASSOCIATION, this, false, null, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(sampleTree1, null, null, test.model.Project.class, test.model.Project.PRIORITY)}, null)}));
|
||||
com.foundation.view.swt.SimpleTreeTable.ColumnData sampleTree1ColumnPart0 = sampleTree1.addColumn();
|
||||
sampleTree1ColumnPart0.setHeaderText("Name");
|
||||
sampleTree1ColumnPart0.setWidth(200);
|
||||
sampleTree1ColumnPart0.setCellTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Project.class, SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Project.class, test.model.Project.NAME)}, null,true), new com.foundation.view.MultiAssociation(test.model.Team.class, SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_1, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Team.class, test.model.Team.NAME)}, null,true), new com.foundation.view.MultiAssociation(test.model.Priority.class, SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_2, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Priority.class, test.model.Priority.NAME)}, null,true)}));
|
||||
com.foundation.view.swt.SimpleTreeTable.ColumnData sampleTree1ColumnPart1 = sampleTree1.addColumn();
|
||||
sampleTree1ColumnPart1.setHeaderText("Priority Name");
|
||||
sampleTree1ColumnPart1.setWidth(200);
|
||||
sampleTree1ColumnPart1.setCellTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Project.class, SAMPLE_TREE1_COLUMN_PART1_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Project.class, test.model.Project.PRIORITY)}, null,false), new com.foundation.view.MultiAssociation(test.model.Priority.class, SAMPLE_TREE1_COLUMN_PART1_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_1, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Priority.class, test.model.Priority.NAME)}, null,true)}));
|
||||
sampleTree1.setAutoSynchronizeSelection(true);
|
||||
sampleTree1.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TeamViewController.class, SAMPLE_TREE1_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TeamViewController.class, test.local.view.controller.TeamViewController.TEAMS)}, null,true)}));
|
||||
}//initializeSampleTree1()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeUnnamedComponent0(this);
|
||||
initializeSampleTree1(this);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(this);
|
||||
|
||||
layout.setNumColumns(1);
|
||||
layout.setMakeColumnsEqualWidth(false);
|
||||
layout.setMarginHeight(2);
|
||||
layout.setMarginWidth(2);
|
||||
layout.setHorizontalSpacing(2);
|
||||
layout.setVerticalSpacing(2);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {sampleTree1}));
|
||||
this.setDefaultContainerTitle("Tree Groupings");
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case SAMPLE_TREE1_ASSOCIATION_CHILDREN_ASSOCIATION:
|
||||
result = ((test.model.Team) value).getProjects();
|
||||
break;
|
||||
case SAMPLE_TREE1_ASSOCIATION_GROUPING_ASSOCIATION:
|
||||
result = ((test.model.Project) value).getPriority();
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getName();
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_1:
|
||||
result = ((test.model.Team) value).getName();
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_2:
|
||||
result = ((test.model.Priority) value).getName();
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART1_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getPriority();
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART1_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_1:
|
||||
result = ((test.model.Priority) value).getName();
|
||||
break;
|
||||
case SAMPLE_TREE1_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TeamViewController) value).getTeams();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getOldAttributeValue(test.model.Project.NAME);
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_1:
|
||||
result = ((test.model.Team) value).getOldAttributeValue(test.model.Team.NAME);
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_2:
|
||||
result = ((test.model.Priority) value).getOldAttributeValue(test.model.Priority.NAME);
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART1_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_1:
|
||||
result = ((test.model.Priority) value).getOldAttributeValue(test.model.Priority.NAME);
|
||||
break;
|
||||
case SAMPLE_TREE1_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TeamViewController) value).getOldAttributeValue(test.local.view.controller.TeamViewController.TEAMS);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
{ //null//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
unnamedComponent0.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //sampleTree1//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.verticalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
layoutData.grabExcessVerticalSpace = true;
|
||||
sampleTree1.setLayoutData(layoutData);
|
||||
}//block//
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpUnnamedComponent0() {
|
||||
return unnamedComponent0;
|
||||
}//getVpUnnamedComponent0()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.SimpleTreeTable getVpSampleTree1() {
|
||||
return sampleTree1;
|
||||
}//getVpSampleTree1()//
|
||||
}//TeamView//
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2009 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<panel name="TeamView" style="" container-image="" container-title="Tree Groupings">
|
||||
<grid-layout column-count="1" margin-height="2" margin-width="2" equal-width-columns="false" vertical-spacing="2" horizontal-spacing="2"/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.TeamViewController"/>
|
||||
|
||||
<label text="Tests groupings of items in a tree. (Model: Team -> Project -> Priority) The Project instances are grouped by their priority.">
|
||||
<grid-layout-data horizontal-alignment="fill" horizontal-fill="true"/>
|
||||
</label>
|
||||
<simple-tree-table style='single selection | border' auto-fit='true' auto-synchronize-selection='true' row-height='20' name='sampleTree1' tab-order='1'>
|
||||
<grid-layout-data horizontal-alignment='fill' vertical-fill='true' horizontal-fill='true' vertical-alignment='fill'/>
|
||||
<association function='collection' attribute='teams' value-holder='controllerHolder'/>
|
||||
<association function='grouping' attribute='priority' row-type='test.model.Project'/>
|
||||
<association function='children' attribute='projects' row-type='test.model.Team'/>
|
||||
|
||||
<columns>
|
||||
<column header-text='Name' width="200">
|
||||
<association-group function='cell-text'>
|
||||
<association-target-attribute attribute='name' row-type='test.model.Project'/>
|
||||
<association-target-attribute attribute='name' row-type='test.model.Team'/>
|
||||
<association-target-attribute attribute='name' row-type='test.model.Priority'/>
|
||||
</association-group>
|
||||
</column>
|
||||
<column header-text='Priority Name' width="200">
|
||||
<association-group function='cell-text'>
|
||||
<association-link attribute='priority' row-type='test.model.Project'/>
|
||||
<association-target-attribute attribute='name' row-type='test.model.Priority'/>
|
||||
</association-group>
|
||||
</column>
|
||||
</columns>
|
||||
</simple-tree-table>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,258 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* TestDialog1View
|
||||
*/
|
||||
public class TestDialog1View extends com.foundation.view.swt.Window implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String ITEM_LIST_COMPONENT = "itemList";
|
||||
public static final String POP_OUT_PANEL_COMPONENT = "popOutPanel";
|
||||
public static final String PROJECT_COMBO_LABEL_COMPONENT = "projectComboLabel";
|
||||
public static final String TEST_DIALOG1_VIEW_COMPONENT = "TestDialog1View";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int ITEM_LIST_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 0;
|
||||
protected static final int ITEM_LIST_ASSOCIATION_SELECTION_ASSOCIATION_0 = 1;
|
||||
protected static final int PROJECT_COMBO_LABEL_ASSOCIATION_TEXT_ASSOCIATION_0 = 2;
|
||||
protected static final int POP_OUT_PANEL_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0 = 3;
|
||||
|
||||
//Method Association Identifiers//
|
||||
protected static final int THIS_CLOSED_METHOD_ASSOCIATION = 0;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.ListBox itemList = null;
|
||||
private com.foundation.view.swt.Panel popOutPanel = null;
|
||||
private com.foundation.view.swt.Label projectComboLabel = null;
|
||||
/**
|
||||
* TestDialog1View default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public TestDialog1View() {
|
||||
}//TestDialog1View()//
|
||||
/**
|
||||
* TestDialog1View constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
*/
|
||||
public TestDialog1View(com.foundation.controller.ViewController controller) {
|
||||
super((com.foundation.controller.ViewController) controller.getParent(), TEST_DIALOG1_VIEW_COMPONENT, com.foundation.view.swt.Window.STYLE_DIALOG_TRIM, controller.getContext(), controller);
|
||||
|
||||
}//TestDialog1View()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.TestDialog1ViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeItemList(com.foundation.view.swt.Container parent) {
|
||||
itemList = new com.foundation.view.swt.ListBox(parent, ITEM_LIST_COMPONENT, com.foundation.view.swt.ListBox.STYLE_BORDER);
|
||||
|
||||
itemList.setAutoSynchronizeSelection(true);
|
||||
itemList.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TestDialog1ViewController.class, ITEM_LIST_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TestDialog1ViewController.class, test.local.view.controller.TestDialog1ViewController.ITEMS)}, null,true)}));
|
||||
itemList.setSelectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TestDialog1ViewController.class, ITEM_LIST_ASSOCIATION_SELECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TestDialog1ViewController.class, test.local.view.controller.TestDialog1ViewController.SELECTED)}, null,true)}));
|
||||
}//initializeItemList()//
|
||||
public void initializeProjectComboLabel(com.foundation.view.swt.Container parent) {
|
||||
projectComboLabel = new com.foundation.view.swt.Label(parent, PROJECT_COMBO_LABEL_COMPONENT, 0);
|
||||
|
||||
projectComboLabel.setTextAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TestDialog1ViewController.class, PROJECT_COMBO_LABEL_ASSOCIATION_TEXT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TestDialog1ViewController.class, test.local.view.controller.TestDialog1ViewController.SELECTED)}, null,true)}));
|
||||
}//initializeProjectComboLabel()//
|
||||
public void initializePopOutPanel(com.foundation.view.swt.Container parent) {
|
||||
popOutPanel = new com.foundation.view.swt.Panel(parent, POP_OUT_PANEL_COMPONENT, 0);
|
||||
|
||||
initializeProjectComboLabel(popOutPanel);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(popOutPanel);
|
||||
|
||||
layout.setNumColumns(1);
|
||||
layout.setMarginHeight(0);
|
||||
layout.setMarginWidth(0);
|
||||
popOutPanel.setLayout(layout);
|
||||
popOutPanel.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
popOutPanel.setDefaultIsVisible(false);
|
||||
popOutPanel.setIsVisibleAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TestDialog1ViewController.class, POP_OUT_PANEL_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TestDialog1ViewController.class, test.local.view.controller.TestDialog1ViewController.SELECTED)}, null,true)}));
|
||||
}//initializePopOutPanel()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
this.setClosedMethod(new com.foundation.view.MethodAssociation(this, THIS_CLOSED_METHOD_ASSOCIATION, this, "controllerHolder", null, null));
|
||||
initializeControllerHolder(this);
|
||||
initializeItemList(this);
|
||||
initializePopOutPanel(this);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(this);
|
||||
|
||||
layout.setNumColumns(2);
|
||||
layout.setMakeColumnsEqualWidth(true);
|
||||
layout.setMarginHeight(5);
|
||||
layout.setMarginWidth(5);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
this.setSize(200, 100);
|
||||
this.setDefaultContainerTitle("Test Dialog 1");
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#pack()
|
||||
*/
|
||||
public void pack() {
|
||||
//Don't pack since a custom size was specified.
|
||||
}//pack()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
case THIS_CLOSED_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.TestDialog1ViewController) value).doClose();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case ITEM_LIST_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TestDialog1ViewController) value).getItems();
|
||||
break;
|
||||
case ITEM_LIST_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TestDialog1ViewController) value).getSelected();
|
||||
break;
|
||||
case PROJECT_COMBO_LABEL_ASSOCIATION_TEXT_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TestDialog1ViewController) value).getSelected();
|
||||
break;
|
||||
case POP_OUT_PANEL_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TestDialog1ViewController) value).getSelected();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case ITEM_LIST_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TestDialog1ViewController) value).getOldAttributeValue(test.local.view.controller.TestDialog1ViewController.ITEMS);
|
||||
break;
|
||||
case ITEM_LIST_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TestDialog1ViewController) value).getOldAttributeValue(test.local.view.controller.TestDialog1ViewController.SELECTED);
|
||||
break;
|
||||
case PROJECT_COMBO_LABEL_ASSOCIATION_TEXT_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TestDialog1ViewController) value).getOldAttributeValue(test.local.view.controller.TestDialog1ViewController.SELECTED);
|
||||
break;
|
||||
case POP_OUT_PANEL_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TestDialog1ViewController) value).getOldAttributeValue(test.local.view.controller.TestDialog1ViewController.SELECTED);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
case ITEM_LIST_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
((test.local.view.controller.TestDialog1ViewController) value).setSelected((java.lang.Object) parameters[0]);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
{ //itemList//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.verticalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
layoutData.grabExcessVerticalSpace = true;
|
||||
itemList.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //popOutPanel//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.verticalAlignment = com.foundation.view.swt.layout.GridData.BEGINNING;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
layoutData.grabExcessVerticalSpace = true;
|
||||
popOutPanel.setLayoutData(layoutData);
|
||||
}//block//
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ListBox getVpItemList() {
|
||||
return itemList;
|
||||
}//getVpItemList()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Panel getVpPopOutPanel() {
|
||||
return popOutPanel;
|
||||
}//getVpPopOutPanel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpProjectComboLabel() {
|
||||
return projectComboLabel;
|
||||
}//getVpProjectComboLabel()//
|
||||
}//TestDialog1View//
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0"?>
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<!--
|
||||
- Tests that the panel will properly display when an item in the list is selected.
|
||||
- Tests that the window will not pack since a size is provided.
|
||||
-->
|
||||
<window name="TestDialog1View" style="dialog trim" container-title="Test Dialog 1" width="200" height="100">
|
||||
<grid-layout column-count="2" equal-width-columns="true" margin-width="5" margin-height="5"/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.TestDialog1ViewController"/>
|
||||
|
||||
<method function="closed" name="doClose" value-holder="controllerHolder"/>
|
||||
|
||||
<list name="itemList" style="border" auto-synchronize-selection="true">
|
||||
<association function="collection" attribute="items" value-holder="controllerHolder"/>
|
||||
<association function="selection" attribute="selected" value-holder="controllerHolder"/>
|
||||
<grid-layout-data horizontal-fill="true" horizontal-alignment="fill" vertical-fill="true" vertical-alignment="fill"/>
|
||||
</list>
|
||||
<panel name="popOutPanel" is-visible="false">
|
||||
<grid-layout column-count="1" margin-width="0" margin-height="0"/>
|
||||
<grid-layout-data horizontal-fill="true" vertical-fill="true" vertical-alignment="beginning"/>
|
||||
|
||||
<association function="is-visible" attribute="selected" value-holder="controllerHolder"/>
|
||||
<grid-layout-data horizontal-fill="true" horizontal-alignment="fill" vertical-fill="true" vertical-alignment="fill"/>
|
||||
|
||||
<label name="projectComboLabel" style="" text="">
|
||||
<association function="text" attribute="selected" value-holder="controllerHolder"/>
|
||||
</label>
|
||||
</panel>
|
||||
</window>
|
||||
</vml>
|
||||
@@ -0,0 +1,255 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* TestDialog2View
|
||||
*/
|
||||
public class TestDialog2View extends com.foundation.view.swt.Window implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String ITEM_LIST_COMPONENT = "itemList";
|
||||
public static final String PROJECT_COMBO_LABEL_COMPONENT = "projectComboLabel";
|
||||
public static final String DOES_NOTHING_BUTTON_COMPONENT = "doesNothingButton";
|
||||
public static final String DOES_NOTHING_BUTTON2_COMPONENT = "doesNothingButton2";
|
||||
public static final String TEST_DIALOG2_VIEW_COMPONENT = "TestDialog2View";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int UNNAMED_COMPONENT0_FORMAT_FORMAT_ASSOCIATION_TEXT_ASSOCIATION_0 = 0;
|
||||
protected static final int ITEM_LIST_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 1;
|
||||
|
||||
//Method Association Identifiers//
|
||||
protected static final int THIS_CLOSED_METHOD_ASSOCIATION = 0;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.TextField unnamedComponent0 = null;
|
||||
private com.foundation.view.swt.ListBox itemList = null;
|
||||
private com.foundation.view.swt.Label projectComboLabel = null;
|
||||
private com.foundation.view.swt.Button doesNothingButton = null;
|
||||
private com.foundation.view.swt.Button doesNothingButton2 = null;
|
||||
/**
|
||||
* TestDialog2View default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public TestDialog2View() {
|
||||
}//TestDialog2View()//
|
||||
/**
|
||||
* TestDialog2View constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
*/
|
||||
public TestDialog2View(com.foundation.controller.ViewController controller) {
|
||||
super((com.foundation.controller.ViewController) controller.getParent(), TEST_DIALOG2_VIEW_COMPONENT, com.foundation.view.swt.Window.STYLE_DIALOG_TRIM, controller.getContext(), controller);
|
||||
|
||||
}//TestDialog2View()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.TestDialog2ViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeUnnamedComponent0(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent0 = new com.foundation.view.swt.TextField(parent, null, com.foundation.view.swt.TextField.STYLE_BORDER);
|
||||
|
||||
com.foundation.view.swt.TextField.TextFormat unnamedComponent0Format = (com.foundation.view.swt.TextField.TextFormat) unnamedComponent0.initializeFormat(com.foundation.view.swt.TextField.TextFormat.class);
|
||||
unnamedComponent0Format.setValueAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TestDialog2ViewController.class, UNNAMED_COMPONENT0_FORMAT_FORMAT_ASSOCIATION_TEXT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TestDialog2ViewController.class, test.local.view.controller.TestDialog2ViewController.TEXT)}, null,true,test.local.view.controller.TestDialog2ViewController.TEXT)}));
|
||||
unnamedComponent0.setAutoSynchronizeValue(true);
|
||||
unnamedComponent0.setAutoValidate(true);
|
||||
}//initializeUnnamedComponent0()//
|
||||
public void initializeItemList(com.foundation.view.swt.Container parent) {
|
||||
itemList = new com.foundation.view.swt.ListBox(parent, ITEM_LIST_COMPONENT, com.foundation.view.swt.ListBox.STYLE_BORDER);
|
||||
|
||||
itemList.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TestDialog2ViewController.class, ITEM_LIST_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TestDialog2ViewController.class, test.local.view.controller.TestDialog2ViewController.ITEMS)}, null,true)}));
|
||||
}//initializeItemList()//
|
||||
public void initializeProjectComboLabel(com.foundation.view.swt.Container parent) {
|
||||
projectComboLabel = new com.foundation.view.swt.Label(parent, PROJECT_COMBO_LABEL_COMPONENT, 0);
|
||||
|
||||
projectComboLabel.setText("This is a test label.");
|
||||
}//initializeProjectComboLabel()//
|
||||
public void initializeDoesNothingButton(com.foundation.view.swt.Container parent) {
|
||||
doesNothingButton = new com.foundation.view.swt.Button(parent, DOES_NOTHING_BUTTON_COMPONENT, 0);
|
||||
|
||||
doesNothingButton.setText("Does Nothing");
|
||||
}//initializeDoesNothingButton()//
|
||||
public void initializeDoesNothingButton2(com.foundation.view.swt.Container parent) {
|
||||
doesNothingButton2 = new com.foundation.view.swt.Button(parent, DOES_NOTHING_BUTTON2_COMPONENT, com.foundation.view.swt.Button.STYLE_CHECK);
|
||||
|
||||
doesNothingButton2.setText("Does Nothing");
|
||||
doesNothingButton2.setIsSelected(Boolean.TRUE);
|
||||
}//initializeDoesNothingButton2()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
this.setClosedMethod(new com.foundation.view.MethodAssociation(this, THIS_CLOSED_METHOD_ASSOCIATION, this, "controllerHolder", null, null));
|
||||
initializeControllerHolder(this);
|
||||
initializeUnnamedComponent0(this);
|
||||
initializeItemList(this);
|
||||
initializeProjectComboLabel(this);
|
||||
initializeDoesNothingButton(this);
|
||||
initializeDoesNothingButton2(this);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(this);
|
||||
|
||||
layout.setNumColumns(2);
|
||||
layout.setMakeColumnsEqualWidth(true);
|
||||
layout.setMarginHeight(5);
|
||||
layout.setMarginWidth(5);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
this.setDefaultContainerTitle("Test Dialog 2");
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
case THIS_CLOSED_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.TestDialog2ViewController) value).doClose();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case UNNAMED_COMPONENT0_FORMAT_FORMAT_ASSOCIATION_TEXT_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TestDialog2ViewController) value).getText();
|
||||
break;
|
||||
case ITEM_LIST_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TestDialog2ViewController) value).getItems();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case UNNAMED_COMPONENT0_FORMAT_FORMAT_ASSOCIATION_TEXT_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TestDialog2ViewController) value).getOldAttributeValue(test.local.view.controller.TestDialog2ViewController.TEXT);
|
||||
break;
|
||||
case ITEM_LIST_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TestDialog2ViewController) value).getOldAttributeValue(test.local.view.controller.TestDialog2ViewController.ITEMS);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
case UNNAMED_COMPONENT0_FORMAT_FORMAT_ASSOCIATION_TEXT_ASSOCIATION_0:
|
||||
((test.local.view.controller.TestDialog2ViewController) value).setText((java.lang.String) parameters[0]);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
{ //null//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.minimumWidth = 150;
|
||||
layoutData.widthHint = 150;
|
||||
layoutData.horizontalSpan = 2;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
unnamedComponent0.setLayoutData(layoutData);
|
||||
}//block//
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.TextField getVpUnnamedComponent0() {
|
||||
return unnamedComponent0;
|
||||
}//getVpUnnamedComponent0()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ListBox getVpItemList() {
|
||||
return itemList;
|
||||
}//getVpItemList()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpProjectComboLabel() {
|
||||
return projectComboLabel;
|
||||
}//getVpProjectComboLabel()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpDoesNothingButton() {
|
||||
return doesNothingButton;
|
||||
}//getVpDoesNothingButton()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpDoesNothingButton2() {
|
||||
return doesNothingButton2;
|
||||
}//getVpDoesNothingButton2()//
|
||||
}//TestDialog2View//
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0"?>
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<!--
|
||||
- Test that the window will properly pack when opened since no size is provided.
|
||||
- Displays 2 rows and 2 columns of controls that do nothing.
|
||||
-->
|
||||
<window name="TestDialog2View" style="dialog trim" container-title="Test Dialog 2">
|
||||
<grid-layout column-count="2" equal-width-columns="true" margin-width="5" margin-height="5"/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.TestDialog2ViewController"/>
|
||||
|
||||
<method function="closed" name="doClose" value-holder="controllerHolder"/>
|
||||
|
||||
<text style="border" auto-synchronize-text="true" auto-validate="true">
|
||||
<grid-layout-data horizontal-alignment="fill" horizontal-fill="true" minimum-width="150" horizontal-span="2"/>
|
||||
<text-format>
|
||||
<association function="text" attribute="text" value-holder="controllerHolder" decorate="true"/>
|
||||
</text-format>
|
||||
</text>
|
||||
<list name="itemList" style="border">
|
||||
<association function="collection" attribute="items" value-holder="controllerHolder"/>
|
||||
</list>
|
||||
<label name="projectComboLabel" style="" text="This is a test label.">
|
||||
</label>
|
||||
<button name="doesNothingButton" style="" text="Does Nothing">
|
||||
</button>
|
||||
<button-toggle name="doesNothingButton2" style="check" text="Does Nothing" is-selected="true">
|
||||
</button-toggle>
|
||||
</window>
|
||||
</vml>
|
||||
@@ -0,0 +1,217 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2009,2008 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<panel name="TextPageView" container-title="Text" tab-order="1">
|
||||
<fill-layout/>
|
||||
<panel name="scrolledPanel" style="vertical scroll | horizontal scroll" background-color="yellow" inherit-background="all" tab-order="1">
|
||||
<grid-layout column-count="3" equal-width-columns="false" margin-width="5" margin-height="5" horizontal-spacing="4"/>
|
||||
<grid-layout-data horizontal-fill="true" vertical-fill="true" horizontal-alignment="fill" vertical-alignment="fill"/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.TextPageViewController"/>
|
||||
|
||||
<label text="Control Type" style="center">
|
||||
<grid-layout-data horizontal-alignment="fill" minimum-width="100"/>
|
||||
</label>
|
||||
<label text="Control" style="center" tab-order="1" background-color="#00FF00">
|
||||
<grid-layout-data horizontal-alignment="fill" horizontal-fill="true" minimum-width="240"/>
|
||||
</label>
|
||||
<label text="Model Value" style="center">
|
||||
<grid-layout-data horizontal-alignment="fill" minimum-width="100"/>
|
||||
</label>
|
||||
|
||||
<label text="Text: "/>
|
||||
<text style="border" auto-synchronize-text="true" auto-validate="true" tab-order="1">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<text-format>
|
||||
<association function="value" attribute="text" value-holder="controllerHolder" decorate="true"/>
|
||||
</text-format>
|
||||
</text>
|
||||
<label>
|
||||
<association function="text" attribute="text" value-holder="controllerHolder"/>
|
||||
</label>
|
||||
|
||||
<label text="Byte: "/>
|
||||
<text style="border" auto-synchronize-text="true" tab-order="1">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<integer-format model-type="byte">
|
||||
<association function="value" attribute="byte" value-holder="controllerHolder"/>
|
||||
</integer-format>
|
||||
</text>
|
||||
<label>
|
||||
<association function="text" attribute="byte" value-holder="controllerHolder"/>
|
||||
</label>
|
||||
|
||||
<label text="Short: "/>
|
||||
<text style="border" auto-synchronize-text="true" tab-order="1">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<integer-format model-type="short">
|
||||
<association function="value" attribute="short" value-holder="controllerHolder"/>
|
||||
</integer-format>
|
||||
</text>
|
||||
<label>
|
||||
<association function="text" attribute="short" value-holder="controllerHolder"/>
|
||||
</label>
|
||||
|
||||
<label text="Integer: "/>
|
||||
<text style="border" auto-synchronize-text="true" tab-order="1" select-on-focus="true">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<integer-format model-type="integer" negative-color="blue">
|
||||
<association function="value" attribute="integer" value-holder="controllerHolder"/>
|
||||
</integer-format>
|
||||
</text>
|
||||
<label>
|
||||
<association function="text" attribute="integer" value-holder="controllerHolder"/>
|
||||
</label>
|
||||
|
||||
<label text="Long: "/>
|
||||
<text style="border" auto-synchronize-text="true" tab-order="1">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<integer-format model-type="long">
|
||||
<association function="value" attribute="long" value-holder="controllerHolder"/>
|
||||
</integer-format>
|
||||
</text>
|
||||
<label>
|
||||
<association function="text" attribute="long" value-holder="controllerHolder"/>
|
||||
</label>
|
||||
|
||||
<label text="Float: "/>
|
||||
<text style="border" auto-synchronize-text="true" tab-order="1">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<decimal-format model-type="float" max-fraction-digits="4">
|
||||
<association function="value" attribute="float" value-holder="controllerHolder"/>
|
||||
</decimal-format>
|
||||
</text>
|
||||
<label>
|
||||
<association function="text" attribute="float" value-holder="controllerHolder"/>
|
||||
</label>
|
||||
|
||||
<label text="Double: "/>
|
||||
<text style="border" auto-synchronize-text="true" tab-order="1">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<decimal-format model-type="double" max-fraction-digits="8">
|
||||
<association function="value" attribute="double" value-holder="controllerHolder"/>
|
||||
</decimal-format>
|
||||
</text>
|
||||
<label>
|
||||
<association function="text" attribute="double" value-holder="controllerHolder"/>
|
||||
</label>
|
||||
|
||||
<label text="BigDecimal: (uses a multiplier of 10)"/>
|
||||
<text style="border" auto-synchronize-text="true" tab-order="1">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<decimal-format model-type="big-decimal" max-fraction-digits="10" multiplier="10">
|
||||
<association function="value" attribute="bigDecimal" value-holder="controllerHolder"/>
|
||||
</decimal-format>
|
||||
</text>
|
||||
<label>
|
||||
<association function="text" attribute="bigDecimal" value-holder="controllerHolder"/>
|
||||
</label>
|
||||
|
||||
<label text="Currency: "/>
|
||||
<text style="border" auto-synchronize-text="true" tab-order="1">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<currency-format model-type="big-decimal">
|
||||
<association function="value" attribute="currency" value-holder="controllerHolder"/>
|
||||
</currency-format>
|
||||
</text>
|
||||
<label>
|
||||
<association function="text" attribute="currency" value-holder="controllerHolder"/>
|
||||
</label>
|
||||
|
||||
<label text="Percent: "/>
|
||||
<text style="border" auto-synchronize-text="true" tab-order="1" ghost-text="enter a number">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<percent-format model-type="big-decimal" max-fraction-digits="2" min-fraction-digits="1">
|
||||
<association function="value" attribute="percent" value-holder="controllerHolder"/>
|
||||
</percent-format>
|
||||
</text>
|
||||
<label>
|
||||
<association function="text" attribute="percent" value-holder="controllerHolder"/>
|
||||
</label>
|
||||
|
||||
<label text="Custom BigDecimal: " tool-tip-text="A custom big decimal using the format: ##.##E0 m/s;(##.##E0 m/s)"/>
|
||||
<text name="customBigDecimal" style="border" auto-synchronize-text="true" tab-order="1" ghost-text="enter a number" ghost-text-color="blue">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<decimal-format model-type="big-decimal" max-fraction-digits="10" multiplier="1" format="##.##E0 m/s;(##.##E0 m/s)" realtime="false" negative-color="blue">
|
||||
<association function="value" attribute="custom" value-holder="controllerHolder"/>
|
||||
</decimal-format>
|
||||
</text>
|
||||
<label>
|
||||
<association function="text" attribute="custom" value-holder="controllerHolder"/>
|
||||
</label>
|
||||
|
||||
<label text="Short Time: "/>
|
||||
<date-time style="short | time | border" auto-synchronize-selection="true" tab-order="1">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<association function="selection" attribute="time" value-holder="controllerHolder"/>
|
||||
</date-time>
|
||||
<label/>
|
||||
|
||||
<label text="Medium Time: (disabled)"/>
|
||||
<date-time style="medium | time | border" auto-synchronize-selection="true" tab-order="1" is-enabled="false" foreground-color="#FFF">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<association function="selection" attribute="time" value-holder="controllerHolder"/>
|
||||
</date-time>
|
||||
<label/>
|
||||
|
||||
<label text="Long Time: "/>
|
||||
<date-time style="long | time | border" auto-synchronize-selection="true" tab-order="1">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<association function="selection" attribute="time" value-holder="controllerHolder"/>
|
||||
</date-time>
|
||||
<label/>
|
||||
|
||||
<label text="Short Date: "/>
|
||||
<date-time style="short | date | border" auto-synchronize-selection="true" tab-order="1">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<association function="selection" attribute="date" value-holder="controllerHolder"/>
|
||||
</date-time>
|
||||
<label/>
|
||||
|
||||
<label text="Medium Date: "/>
|
||||
<date-time style="medium | date | border" auto-synchronize-selection="true" tab-order="1">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<association function="selection" attribute="date" value-holder="controllerHolder"/>
|
||||
</date-time>
|
||||
<label/>
|
||||
|
||||
<label text="Long Date: "/>
|
||||
<date-time style="long | date | border" auto-synchronize-selection="true" tab-order="1">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<association function="selection" attribute="date" value-holder="controllerHolder"/>
|
||||
</date-time>
|
||||
<label/>
|
||||
|
||||
<label text="Short Calendar: "/>
|
||||
<date-time style="short | calendar | border" auto-synchronize-selection="true" tab-order="1">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<association function="selection" attribute="calendar" value-holder="controllerHolder"/>
|
||||
</date-time>
|
||||
<label/>
|
||||
|
||||
<label text="Medium Calendar: "/>
|
||||
<date-time style="medium | calendar | border" auto-synchronize-selection="true" tab-order="1">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<association function="selection" attribute="calendar" value-holder="controllerHolder"/>
|
||||
</date-time>
|
||||
<label/>
|
||||
|
||||
<label text="Long Calendar: "/>
|
||||
<date-time style="long | calendar | border" auto-synchronize-selection="true" tab-order="1">
|
||||
<grid-layout-data horizontal-alignment="fill"/>
|
||||
<association function="selection" attribute="calendar" value-holder="controllerHolder"/>
|
||||
</date-time>
|
||||
<label/>
|
||||
</panel>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,620 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* ToolBarPageView
|
||||
*/
|
||||
public class ToolBarPageView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String TEST_COOL_BAR_COMPONENT = "testCoolBar";
|
||||
public static final String SAMPLE_PUSH_BUTTON_COMPONENT = "samplePushButton";
|
||||
public static final String SAMPLE_UP_ARROW_BUTTON_COMPONENT = "sampleUpArrowButton";
|
||||
public static final String SAMPLE_TOOL_BAR_COMPONENT = "sampleToolBar";
|
||||
public static final String TOOL_ITEM_COMPONENT = "toolItem";
|
||||
public static final String SAMPLE_TOGGLE_TOOL_ITEM_COMPONENT = "sampleToggleToolItem";
|
||||
public static final String DROP_MENU_COMPONENT = "dropMenu";
|
||||
public static final String CUSTOM_COMPONENT = "Custom";
|
||||
public static final String TOOL_ITEM_COMBO_COMPONENT = "toolItemCombo";
|
||||
public static final String TOOL_ITEM2_COMPONENT = "toolItem2";
|
||||
public static final String SAMPLE_TOOL_BAR2_COMPONENT = "sampleToolBar2";
|
||||
public static final String DROP_COLOR_TOOL_COMPONENT = "dropColorTool";
|
||||
public static final String SAMPLE_COMBO_COMPONENT = "sampleCombo";
|
||||
public static final String PLACEHOLDER_COMPONENT = "placeholder";
|
||||
public static final String TOOL_BAR_PAGE_VIEW_COMPONENT = "ToolBarPageView";
|
||||
|
||||
//Method Association Identifiers//
|
||||
protected static final int TOOL_ITEM2_SELECTION_METHOD_ASSOCIATION = 0;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.CoolBar testCoolBar = null;
|
||||
private com.foundation.view.swt.CoolBar.CoolItem unnamedComponent0 = null;
|
||||
private com.foundation.view.swt.Button samplePushButton = null;
|
||||
private com.foundation.view.swt.CoolBar.CoolItem unnamedComponent1 = null;
|
||||
private com.foundation.view.swt.Button sampleUpArrowButton = null;
|
||||
private com.foundation.view.swt.CoolBar.CoolItem unnamedComponent2 = null;
|
||||
private com.foundation.view.swt.ToolBar sampleToolBar = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem toolItem = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem sampleToggleToolItem = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem unnamedComponent3 = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem unnamedComponent4 = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem unnamedComponent5 = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem dropMenu = null;
|
||||
private com.foundation.view.swt.Menu unnamedComponent6 = null;
|
||||
private com.foundation.view.swt.Menu unnamedComponent7 = null;
|
||||
private com.foundation.view.swt.Menu unnamedComponent8 = null;
|
||||
private com.foundation.view.swt.Menu unnamedComponent9 = null;
|
||||
private com.foundation.view.swt.Menu unnamedComponent10 = null;
|
||||
private com.foundation.view.swt.Menu unnamedComponent11 = null;
|
||||
private com.foundation.view.swt.Menu unnamedComponent12 = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem unnamedComponent13 = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem unnamedComponent14 = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem Custom = null;
|
||||
private com.foundation.view.swt.ComboBox toolItemCombo = null;
|
||||
private com.foundation.view.swt.ToolBar.ToolItem toolItem2 = null;
|
||||
private com.foundation.view.swt.CoolBar.CoolItem unnamedComponent15 = null;
|
||||
private com.foundation.view.swt.ToolBar sampleToolBar2 = null;
|
||||
private com.foundation.view.swt.ToolItemDropColor dropColorTool = null;
|
||||
private com.foundation.view.swt.CoolBar.CoolItem unnamedComponent16 = null;
|
||||
private com.foundation.view.swt.ComboBox sampleCombo = null;
|
||||
private com.foundation.view.swt.Label placeholder = null;
|
||||
/**
|
||||
* ToolBarPageView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public ToolBarPageView() {
|
||||
}//ToolBarPageView()//
|
||||
/**
|
||||
* ToolBarPageView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public ToolBarPageView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, TOOL_BAR_PAGE_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//ToolBarPageView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.ToolBarPageViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeSamplePushButton(com.foundation.view.swt.Container parent) {
|
||||
samplePushButton = new com.foundation.view.swt.Button(parent, SAMPLE_PUSH_BUTTON_COMPONENT, com.foundation.view.swt.Button.STYLE_PUSH);
|
||||
|
||||
samplePushButton.setText("Sample Push");
|
||||
}//initializeSamplePushButton()//
|
||||
public void initializeUnnamedComponent0(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent0 = new com.foundation.view.swt.CoolBar.CoolItem(parent, null, 0);
|
||||
|
||||
initializeSamplePushButton(testCoolBar);
|
||||
unnamedComponent0.setControl(samplePushButton);
|
||||
}//initializeUnnamedComponent0()//
|
||||
public void initializeSampleUpArrowButton(com.foundation.view.swt.Container parent) {
|
||||
sampleUpArrowButton = new com.foundation.view.swt.Button(parent, SAMPLE_UP_ARROW_BUTTON_COMPONENT, com.foundation.view.swt.Button.STYLE_ARROW|com.foundation.view.swt.Button.STYLE_UP);
|
||||
|
||||
sampleUpArrowButton.setText("Sample Up Arrow Button");
|
||||
}//initializeSampleUpArrowButton()//
|
||||
public void initializeUnnamedComponent1(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent1 = new com.foundation.view.swt.CoolBar.CoolItem(parent, null, 0);
|
||||
|
||||
initializeSampleUpArrowButton(testCoolBar);
|
||||
unnamedComponent1.setControl(sampleUpArrowButton);
|
||||
}//initializeUnnamedComponent1()//
|
||||
public void initializeToolItem(com.foundation.view.swt.Container parent) {
|
||||
toolItem = new com.foundation.view.swt.ToolBar.ToolItem(parent, TOOL_ITEM_COMPONENT, com.foundation.view.swt.ToolBar.ToolItem.STYLE_PUSH);
|
||||
|
||||
toolItem.setText("Push");
|
||||
toolItem.setIsEnabled(false);
|
||||
}//initializeToolItem()//
|
||||
public void initializeSampleToggleToolItem(com.foundation.view.swt.Container parent) {
|
||||
sampleToggleToolItem = new com.foundation.view.swt.ToolBar.ToolItem(parent, SAMPLE_TOGGLE_TOOL_ITEM_COMPONENT, com.foundation.view.swt.ToolBar.ToolItem.STYLE_CHECK);
|
||||
|
||||
sampleToggleToolItem.setText("Check");
|
||||
}//initializeSampleToggleToolItem()//
|
||||
public void initializeUnnamedComponent3(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent3 = new com.foundation.view.swt.ToolBar.ToolItem(parent, null, com.foundation.view.swt.ToolBar.ToolItem.STYLE_SEPARATOR);
|
||||
|
||||
unnamedComponent3.setWidth(4);
|
||||
}//initializeUnnamedComponent3()//
|
||||
public void initializeUnnamedComponent4(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent4 = new com.foundation.view.swt.ToolBar.ToolItem(parent, null, com.foundation.view.swt.ToolBar.ToolItem.STYLE_RADIO);
|
||||
|
||||
unnamedComponent4.setText("Radio1");
|
||||
}//initializeUnnamedComponent4()//
|
||||
public void initializeUnnamedComponent5(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent5 = new com.foundation.view.swt.ToolBar.ToolItem(parent, null, com.foundation.view.swt.ToolBar.ToolItem.STYLE_RADIO);
|
||||
|
||||
unnamedComponent5.setText("Radio2");
|
||||
}//initializeUnnamedComponent5()//
|
||||
public void initializeDropMenuDropDownMenu(com.foundation.view.IAbstractComponent parent) {
|
||||
unnamedComponent6 = new com.foundation.view.swt.Menu(sampleToolBar, null, com.foundation.view.swt.Menu.STYLE_POPUP);
|
||||
|
||||
unnamedComponent7 = new com.foundation.view.swt.Menu(unnamedComponent6, null, com.foundation.view.swt.Menu.STYLE_PUSH);
|
||||
|
||||
unnamedComponent7.setText("item 1");
|
||||
unnamedComponent8 = new com.foundation.view.swt.Menu(unnamedComponent6, null, com.foundation.view.swt.Menu.STYLE_PUSH);
|
||||
|
||||
unnamedComponent8.setText("item 2");
|
||||
unnamedComponent9 = new com.foundation.view.swt.Menu(unnamedComponent6, null, com.foundation.view.swt.Menu.STYLE_CASCADE);
|
||||
|
||||
unnamedComponent9.setText("cascade 1");
|
||||
unnamedComponent10 = new com.foundation.view.swt.Menu(unnamedComponent9, null, com.foundation.view.swt.Menu.STYLE_PUSH);
|
||||
|
||||
unnamedComponent10.setText("item 1");
|
||||
unnamedComponent11 = new com.foundation.view.swt.Menu(unnamedComponent9, null, com.foundation.view.swt.Menu.STYLE_PUSH);
|
||||
|
||||
unnamedComponent11.setText("item 2");
|
||||
unnamedComponent12 = new com.foundation.view.swt.Menu(unnamedComponent6, null, com.foundation.view.swt.Menu.STYLE_PUSH);
|
||||
|
||||
unnamedComponent12.setText("item 3");
|
||||
}//initializeDropMenuDropDownMenu()//
|
||||
public void initializeDropMenu(com.foundation.view.swt.Container parent) {
|
||||
dropMenu = new com.foundation.view.swt.ToolBar.ToolItem(parent, DROP_MENU_COMPONENT, com.foundation.view.swt.ToolBar.ToolItem.STYLE_DROP_DOWN);
|
||||
|
||||
initializeDropMenuDropDownMenu(sampleToolBar);
|
||||
dropMenu.setMenu(unnamedComponent6);
|
||||
dropMenu.setText("DropMenu");
|
||||
}//initializeDropMenu()//
|
||||
public void initializeUnnamedComponent13(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent13 = new com.foundation.view.swt.ToolBar.ToolItem(parent, null, com.foundation.view.swt.ToolBar.ToolItem.STYLE_RADIO);
|
||||
|
||||
unnamedComponent13.setText("Radio3");
|
||||
}//initializeUnnamedComponent13()//
|
||||
public void initializeUnnamedComponent14(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent14 = new com.foundation.view.swt.ToolBar.ToolItem(parent, null, com.foundation.view.swt.ToolBar.ToolItem.STYLE_RADIO);
|
||||
|
||||
unnamedComponent14.setText("Radio4");
|
||||
}//initializeUnnamedComponent14()//
|
||||
public void initializeToolItemCombo(com.foundation.view.swt.Container parent) {
|
||||
toolItemCombo = new com.foundation.view.swt.ComboBox(parent, TOOL_ITEM_COMBO_COMPONENT, com.foundation.view.swt.ComboBox.STYLE_BORDER);
|
||||
|
||||
}//initializeToolItemCombo()//
|
||||
public void initializeCustom(com.foundation.view.swt.Container parent) {
|
||||
Custom = new com.foundation.view.swt.ToolBar.ToolItem(parent, CUSTOM_COMPONENT, com.foundation.view.swt.ToolBar.ToolItem.STYLE_SEPARATOR);
|
||||
|
||||
initializeToolItemCombo(sampleToolBar);
|
||||
Custom.setControl(toolItemCombo);
|
||||
Custom.setWidth(100);
|
||||
}//initializeCustom()//
|
||||
public void initializeToolItem2(com.foundation.view.swt.Container parent) {
|
||||
toolItem2 = new com.foundation.view.swt.ToolBar.ToolItem(parent, TOOL_ITEM2_COMPONENT, com.foundation.view.swt.ToolBar.ToolItem.STYLE_PUSH);
|
||||
|
||||
toolItem2.setText("Push2");
|
||||
toolItem2.setSelectionMethod(new com.foundation.view.MethodAssociation(this, TOOL_ITEM2_SELECTION_METHOD_ASSOCIATION, toolItem2, "controllerHolder", null, null));
|
||||
}//initializeToolItem2()//
|
||||
public void initializeSampleToolBar(com.foundation.view.swt.Container parent) {
|
||||
sampleToolBar = new com.foundation.view.swt.ToolBar(parent, SAMPLE_TOOL_BAR_COMPONENT, 0);
|
||||
|
||||
initializeToolItem(sampleToolBar);
|
||||
initializeSampleToggleToolItem(sampleToolBar);
|
||||
initializeUnnamedComponent3(sampleToolBar);
|
||||
initializeUnnamedComponent4(sampleToolBar);
|
||||
initializeUnnamedComponent5(sampleToolBar);
|
||||
initializeDropMenu(sampleToolBar);
|
||||
initializeUnnamedComponent13(sampleToolBar);
|
||||
initializeUnnamedComponent14(sampleToolBar);
|
||||
initializeCustom(sampleToolBar);
|
||||
initializeToolItem2(sampleToolBar);
|
||||
sampleToolBar.setDefaultBackgroundColor(new com.foundation.view.JefGradient("red"));
|
||||
}//initializeSampleToolBar()//
|
||||
public void initializeUnnamedComponent2(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent2 = new com.foundation.view.swt.CoolBar.CoolItem(parent, null, 0);
|
||||
|
||||
initializeSampleToolBar(testCoolBar);
|
||||
unnamedComponent2.setControl(sampleToolBar);
|
||||
}//initializeUnnamedComponent2()//
|
||||
public void initializeDropColorTool(com.foundation.view.swt.Container parent) {
|
||||
dropColorTool = new com.foundation.view.swt.ToolItemDropColor(parent, DROP_COLOR_TOOL_COMPONENT, com.foundation.view.swt.ToolItemDropColor.STYLE_DROP_DOWN);
|
||||
dropColorTool.setToolTipText("This is a tool tip. Hope it was helpful.");
|
||||
}//initializeDropColorTool()//
|
||||
public void initializeSampleToolBar2(com.foundation.view.swt.Container parent) {
|
||||
sampleToolBar2 = new com.foundation.view.swt.ToolBar(parent, SAMPLE_TOOL_BAR2_COMPONENT, 0);
|
||||
|
||||
initializeDropColorTool(sampleToolBar2);
|
||||
}//initializeSampleToolBar2()//
|
||||
public void initializeUnnamedComponent15(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent15 = new com.foundation.view.swt.CoolBar.CoolItem(parent, null, 0);
|
||||
|
||||
initializeSampleToolBar2(testCoolBar);
|
||||
unnamedComponent15.setControl(sampleToolBar2);
|
||||
}//initializeUnnamedComponent15()//
|
||||
public void initializeSampleCombo(com.foundation.view.swt.Container parent) {
|
||||
sampleCombo = new com.foundation.view.swt.ComboBox(parent, SAMPLE_COMBO_COMPONENT, com.foundation.view.swt.ComboBox.STYLE_BORDER);
|
||||
|
||||
}//initializeSampleCombo()//
|
||||
public void initializeUnnamedComponent16(com.foundation.view.swt.Container parent) {
|
||||
unnamedComponent16 = new com.foundation.view.swt.CoolBar.CoolItem(parent, null, 0);
|
||||
|
||||
initializeSampleCombo(testCoolBar);
|
||||
unnamedComponent16.setControl(sampleCombo);
|
||||
}//initializeUnnamedComponent16()//
|
||||
public void initializeTestCoolBar(com.foundation.view.swt.Container parent) {
|
||||
testCoolBar = new com.foundation.view.swt.CoolBar(parent, TEST_COOL_BAR_COMPONENT, 0);
|
||||
|
||||
initializeUnnamedComponent0(testCoolBar);
|
||||
initializeUnnamedComponent1(testCoolBar);
|
||||
initializeUnnamedComponent2(testCoolBar);
|
||||
initializeUnnamedComponent15(testCoolBar);
|
||||
initializeUnnamedComponent16(testCoolBar);
|
||||
testCoolBar.setDefaultBackgroundColor(new com.foundation.view.JefGradient("(136,255,153,0)"));
|
||||
}//initializeTestCoolBar()//
|
||||
public void initializePlaceholder(com.foundation.view.swt.Container parent) {
|
||||
placeholder = new com.foundation.view.swt.Label(parent, PLACEHOLDER_COMPONENT, 0);
|
||||
|
||||
placeholder.setText("Test Tab Page View");
|
||||
placeholder.setDefaultBackgroundColor(new com.foundation.view.JefGradient("(255,255,102,0)"));
|
||||
}//initializePlaceholder()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeTestCoolBar(this);
|
||||
initializePlaceholder(this);
|
||||
com.foundation.view.swt.FormLayout layout = new com.foundation.view.swt.FormLayout(this);
|
||||
|
||||
layout.setSpacing(4);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
this.setDefaultContainerTitle("ToolBar");
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
case TOOL_ITEM2_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.ToolBarPageViewController) value).doPush2Pressed();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
{ //testCoolBar//
|
||||
com.foundation.view.swt.layout.FormData layoutData = new com.foundation.view.swt.layout.FormData();
|
||||
|
||||
layoutData.left = new com.foundation.view.swt.layout.FormAttachment(0, 0);
|
||||
layoutData.top = new com.foundation.view.swt.layout.FormAttachment(0, 0);
|
||||
layoutData.right = new com.foundation.view.swt.layout.FormAttachment(100, 0);
|
||||
testCoolBar.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //placeholder//
|
||||
com.foundation.view.swt.layout.FormData layoutData = new com.foundation.view.swt.layout.FormData();
|
||||
|
||||
layoutData.left = new com.foundation.view.swt.layout.FormAttachment(0, 0);
|
||||
layoutData.top = new com.foundation.view.swt.layout.FormAttachment(testCoolBar.getSwtControl(), 0, org.eclipse.swt.SWT.DEFAULT);
|
||||
layoutData.right = new com.foundation.view.swt.layout.FormAttachment(100, 0);
|
||||
layoutData.bottom = new com.foundation.view.swt.layout.FormAttachment(100, 0);
|
||||
placeholder.setLayoutData(layoutData);
|
||||
}//block//
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
sampleToggleToolItem.addSelectionLink(new com.foundation.view.LinkData(dropColorTool, com.foundation.view.swt.ToolItemDropColor.LINK_TARGET_IS_ENABLED, null, true, true));
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.CoolBar getVpTestCoolBar() {
|
||||
return testCoolBar;
|
||||
}//getVpTestCoolBar()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.CoolBar.CoolItem getVpUnnamedComponent0() {
|
||||
return unnamedComponent0;
|
||||
}//getVpUnnamedComponent0()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpSamplePushButton() {
|
||||
return samplePushButton;
|
||||
}//getVpSamplePushButton()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.CoolBar.CoolItem getVpUnnamedComponent1() {
|
||||
return unnamedComponent1;
|
||||
}//getVpUnnamedComponent1()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Button getVpSampleUpArrowButton() {
|
||||
return sampleUpArrowButton;
|
||||
}//getVpSampleUpArrowButton()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.CoolBar.CoolItem getVpUnnamedComponent2() {
|
||||
return unnamedComponent2;
|
||||
}//getVpUnnamedComponent2()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar getVpSampleToolBar() {
|
||||
return sampleToolBar;
|
||||
}//getVpSampleToolBar()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpToolItem() {
|
||||
return toolItem;
|
||||
}//getVpToolItem()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpSampleToggleToolItem() {
|
||||
return sampleToggleToolItem;
|
||||
}//getVpSampleToggleToolItem()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpUnnamedComponent3() {
|
||||
return unnamedComponent3;
|
||||
}//getVpUnnamedComponent3()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpUnnamedComponent4() {
|
||||
return unnamedComponent4;
|
||||
}//getVpUnnamedComponent4()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpUnnamedComponent5() {
|
||||
return unnamedComponent5;
|
||||
}//getVpUnnamedComponent5()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpDropMenu() {
|
||||
return dropMenu;
|
||||
}//getVpDropMenu()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Menu getVpUnnamedComponent6() {
|
||||
return unnamedComponent6;
|
||||
}//getVpUnnamedComponent6()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Menu getVpUnnamedComponent7() {
|
||||
return unnamedComponent7;
|
||||
}//getVpUnnamedComponent7()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Menu getVpUnnamedComponent8() {
|
||||
return unnamedComponent8;
|
||||
}//getVpUnnamedComponent8()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Menu getVpUnnamedComponent9() {
|
||||
return unnamedComponent9;
|
||||
}//getVpUnnamedComponent9()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Menu getVpUnnamedComponent10() {
|
||||
return unnamedComponent10;
|
||||
}//getVpUnnamedComponent10()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Menu getVpUnnamedComponent11() {
|
||||
return unnamedComponent11;
|
||||
}//getVpUnnamedComponent11()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Menu getVpUnnamedComponent12() {
|
||||
return unnamedComponent12;
|
||||
}//getVpUnnamedComponent12()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpUnnamedComponent13() {
|
||||
return unnamedComponent13;
|
||||
}//getVpUnnamedComponent13()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpUnnamedComponent14() {
|
||||
return unnamedComponent14;
|
||||
}//getVpUnnamedComponent14()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpCustom() {
|
||||
return Custom;
|
||||
}//getVpCustom()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ComboBox getVpToolItemCombo() {
|
||||
return toolItemCombo;
|
||||
}//getVpToolItemCombo()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar.ToolItem getVpToolItem2() {
|
||||
return toolItem2;
|
||||
}//getVpToolItem2()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.CoolBar.CoolItem getVpUnnamedComponent15() {
|
||||
return unnamedComponent15;
|
||||
}//getVpUnnamedComponent15()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolBar getVpSampleToolBar2() {
|
||||
return sampleToolBar2;
|
||||
}//getVpSampleToolBar2()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ToolItemDropColor getVpDropColorTool() {
|
||||
return dropColorTool;
|
||||
}//getVpDropColorTool()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.CoolBar.CoolItem getVpUnnamedComponent16() {
|
||||
return unnamedComponent16;
|
||||
}//getVpUnnamedComponent16()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ComboBox getVpSampleCombo() {
|
||||
return sampleCombo;
|
||||
}//getVpSampleCombo()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpPlaceholder() {
|
||||
return placeholder;
|
||||
}//getVpPlaceholder()//
|
||||
}//ToolBarPageView//
|
||||
@@ -0,0 +1,111 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2009,2008 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<panel name="ToolBarPageView" style="" container-title="ToolBar">
|
||||
<form-layout spacing="4"/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.ToolBarPageViewController"/>
|
||||
|
||||
<cool-bar name="testCoolBar" style="" background-color="#88FF99">
|
||||
<form-layout-data>
|
||||
<attachment side="left" percent="0"/>
|
||||
<attachment side="right" percent="100"/>
|
||||
<attachment side="top" percent="0"/>
|
||||
</form-layout-data>
|
||||
<cool-item style="">
|
||||
<button name="samplePushButton" style="push" text="Sample Push">
|
||||
</button>
|
||||
|
||||
<menu-floating>
|
||||
<menu text="item 1"/>
|
||||
<menu text="item 2"/>
|
||||
<menu-cascade text="cascade 1">
|
||||
<menu text="item 1"/>
|
||||
<menu text="item 2"/>
|
||||
</menu-cascade>
|
||||
<menu text="item 3"/>
|
||||
</menu-floating>
|
||||
</cool-item>
|
||||
<cool-item style="">
|
||||
<button name="sampleUpArrowButton" style="up-arrow" text="Sample Up Arrow Button">
|
||||
</button>
|
||||
</cool-item>
|
||||
<cool-item style="">
|
||||
<tool-bar name="sampleToolBar" style="" background-color="red">
|
||||
<tool-item name="toolItem" style="push" text="Push" is-enabled="false">
|
||||
</tool-item>
|
||||
<tool-item-toggle style="check" text="Check" name="sampleToggleToolItem">
|
||||
<link function="selection" component="dropColorTool" target="is-enabled" invert-logic="true"/>
|
||||
</tool-item-toggle>
|
||||
<tool-item-separator style="separator" width="4">
|
||||
</tool-item-separator>
|
||||
<tool-item-toggle style="radio" text="Radio1">
|
||||
</tool-item-toggle>
|
||||
<tool-item-toggle style="radio" text="Radio2">
|
||||
</tool-item-toggle>
|
||||
<tool-item-drop-menu style="drop down" text="DropMenu" name="dropMenu">
|
||||
<menu-floating>
|
||||
<menu text="item 1"/>
|
||||
<menu text="item 2"/>
|
||||
<menu-cascade text="cascade 1">
|
||||
<menu text="item 1"/>
|
||||
<menu text="item 2"/>
|
||||
</menu-cascade>
|
||||
<menu text="item 3"/>
|
||||
</menu-floating>
|
||||
</tool-item-drop-menu>
|
||||
<tool-item-toggle style="radio" text="Radio3">
|
||||
</tool-item-toggle>
|
||||
<tool-item-toggle style="radio" text="Radio4">
|
||||
</tool-item-toggle>
|
||||
<tool-item-custom style="separator" name="Custom" width="100">
|
||||
<combo name="toolItemCombo" style="border">
|
||||
</combo>
|
||||
</tool-item-custom>
|
||||
<tool-item name="toolItem2" style="push" text="Push2">
|
||||
<method function="selection" name="doPush2Pressed" value-holder="controllerHolder"/>
|
||||
</tool-item>
|
||||
</tool-bar>
|
||||
|
||||
<menu-floating>
|
||||
<menu text="item 1"/>
|
||||
<menu text="item 2"/>
|
||||
<menu-cascade text="cascade 1">
|
||||
<menu text="item 1"/>
|
||||
<menu text="item 2"/>
|
||||
</menu-cascade>
|
||||
<menu text="item 3"/>
|
||||
</menu-floating>
|
||||
</cool-item>
|
||||
<cool-item style="">
|
||||
<tool-bar name="sampleToolBar2" style="">
|
||||
<tool-item-drop-color style="" name="dropColorTool" tool-tip-text="This is a tool tip. Hope it was helpful.">
|
||||
</tool-item-drop-color>
|
||||
</tool-bar>
|
||||
</cool-item>
|
||||
<cool-item style="">
|
||||
<combo name="sampleCombo" style="border">
|
||||
</combo>
|
||||
</cool-item>
|
||||
</cool-bar>
|
||||
|
||||
<label name="placeholder" style="" text="Test Tab Page View" background-color="#FFFF66">
|
||||
<form-layout-data>
|
||||
<attachment side="left" percent="0"/>
|
||||
<attachment side="right" percent="100"/>
|
||||
<attachment side="top" component="testCoolBar"/>
|
||||
<attachment side="bottom" percent="100"/>
|
||||
</form-layout-data>
|
||||
</label>
|
||||
</panel>
|
||||
</vml>
|
||||
268
Foundation Widget Test Application/src/test/local/view/Tray.java
Normal file
@@ -0,0 +1,268 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* Tray
|
||||
*/
|
||||
public class Tray extends com.foundation.view.swt.TrayItem implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String DYNAMIC_MENU_COMPONENT = "dynamicMenu";
|
||||
public static final String TRAY_COMPONENT = "Tray";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int DYNAMIC_MENU_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 0;
|
||||
protected static final int DYNAMIC_MENU_MENU0_ASSOCIATION_TEXT0_ASSOCIATION_0 = 1;
|
||||
protected static final int DYNAMIC_MENU_MENU0_ASSOCIATION_COLLECTION0_ASSOCIATION_0 = 2;
|
||||
protected static final int DYNAMIC_MENU_MENU1_ASSOCIATION_TEXT1_ASSOCIATION_0 = 3;
|
||||
protected static final int DYNAMIC_MENU_MENU2_ASSOCIATION_TEXT2_ASSOCIATION_0 = 4;
|
||||
protected static final int DYNAMIC_MENU_MENU2_ASSOCIATION_SELECTION2_ASSOCIATION_0 = 5;
|
||||
protected static final int DYNAMIC_MENU_MENU3_ASSOCIATION_TEXT3_ASSOCIATION_0 = 6;
|
||||
protected static final int DYNAMIC_MENU_MENU3_ASSOCIATION_SELECTION3_ASSOCIATION_0 = 7;
|
||||
|
||||
//Method Association Identifiers//
|
||||
protected static final int UNNAMED_COMPONENT1_SELECTION_METHOD_ASSOCIATION = 0;
|
||||
protected static final int DYNAMIC_MENU_MENU1_SELECTION_METHOD_ASSOCIATION = 1;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.Menu unnamedComponent0 = null;
|
||||
private com.foundation.view.swt.Menu unnamedComponent1 = null;
|
||||
private com.foundation.view.swt.DynamicMenu dynamicMenu = null;
|
||||
/**
|
||||
* Tray default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public Tray() {
|
||||
}//Tray()//
|
||||
/**
|
||||
* Tray constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
*/
|
||||
public Tray(com.foundation.controller.ViewController controller) {
|
||||
super(controller.getContext(), TRAY_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//Tray()//
|
||||
public void initializeControllerHolder(com.foundation.view.IAbstractContainer parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.TrayController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeThisPopupMenu(com.foundation.view.IAbstractComponent parent) {
|
||||
unnamedComponent0 = new com.foundation.view.swt.Menu(this, null, com.foundation.view.swt.Menu.STYLE_POPUP);
|
||||
|
||||
unnamedComponent1 = new com.foundation.view.swt.Menu(unnamedComponent0, null, com.foundation.view.swt.Menu.STYLE_PUSH);
|
||||
|
||||
unnamedComponent1.setText("Test Menu Item");
|
||||
unnamedComponent1.setSelectionMethod(new com.foundation.view.MethodAssociation(this, UNNAMED_COMPONENT1_SELECTION_METHOD_ASSOCIATION, unnamedComponent1, "controllerHolder", null, null));
|
||||
//begin dmb//
|
||||
dynamicMenu = new com.foundation.view.swt.DynamicMenu(unnamedComponent0, DYNAMIC_MENU_COMPONENT, 0);
|
||||
|
||||
dynamicMenu.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TrayController.class, DYNAMIC_MENU_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TrayController.class, test.local.view.controller.TrayController.COLLECTION)}, null,true)}));
|
||||
com.foundation.view.swt.DynamicMenu.CascadeMenuDefinition dynamicMenuMenu0 = (com.foundation.view.swt.DynamicMenu.CascadeMenuDefinition) dynamicMenu.createMenuDefinition(com.foundation.view.swt.DynamicMenu.CascadeMenuDefinition.class);
|
||||
dynamicMenuMenu0.setType(test.model.MenuContainer.class);
|
||||
dynamicMenuMenu0.setTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.MenuContainer.class, DYNAMIC_MENU_MENU0_ASSOCIATION_TEXT0_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.MenuContainer.class, test.model.MenuContainer.NAME)}, null,true)}));
|
||||
dynamicMenuMenu0.setCollectionAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.MenuContainer.class, DYNAMIC_MENU_MENU0_ASSOCIATION_COLLECTION0_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.MenuContainer.class, test.model.MenuContainer.CHILDREN)}, null,true)}));
|
||||
com.foundation.view.swt.DynamicMenu.PushMenuDefinition dynamicMenuMenu1 = (com.foundation.view.swt.DynamicMenu.PushMenuDefinition) dynamicMenu.createMenuDefinition(com.foundation.view.swt.DynamicMenu.PushMenuDefinition.class);
|
||||
dynamicMenuMenu1.setType(test.model.PushMenu.class);
|
||||
dynamicMenuMenu1.setTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.PushMenu.class, DYNAMIC_MENU_MENU1_ASSOCIATION_TEXT1_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.PushMenu.class, test.model.PushMenu.NAME)}, null,true)}));
|
||||
dynamicMenuMenu1.setSelectionMethod(new com.foundation.view.MethodAssociation(this, DYNAMIC_MENU_MENU1_SELECTION_METHOD_ASSOCIATION, dynamicMenuMenu1, "controllerHolder", null, test.model.PushMenu.class));
|
||||
com.foundation.view.swt.DynamicMenu.RadioMenuDefinition dynamicMenuMenu2 = (com.foundation.view.swt.DynamicMenu.RadioMenuDefinition) dynamicMenu.createMenuDefinition(com.foundation.view.swt.DynamicMenu.RadioMenuDefinition.class);
|
||||
dynamicMenuMenu2.setType(test.model.RadioMenu.class);
|
||||
dynamicMenuMenu2.setTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.RadioMenu.class, DYNAMIC_MENU_MENU2_ASSOCIATION_TEXT2_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.RadioMenu.class, test.model.RadioMenu.NAME)}, null,true)}));
|
||||
dynamicMenuMenu2.setSelectionAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.RadioMenu.class, DYNAMIC_MENU_MENU2_ASSOCIATION_SELECTION2_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.RadioMenu.class, test.model.RadioMenu.IS_CHECKED)}, null,true)}));
|
||||
com.foundation.view.swt.DynamicMenu.CheckMenuDefinition dynamicMenuMenu3 = (com.foundation.view.swt.DynamicMenu.CheckMenuDefinition) dynamicMenu.createMenuDefinition(com.foundation.view.swt.DynamicMenu.CheckMenuDefinition.class);
|
||||
dynamicMenuMenu3.setType(test.model.CheckMenu.class);
|
||||
dynamicMenuMenu3.setTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.CheckMenu.class, DYNAMIC_MENU_MENU3_ASSOCIATION_TEXT3_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.CheckMenu.class, test.model.CheckMenu.NAME)}, null,true)}));
|
||||
dynamicMenuMenu3.setSelectionAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.CheckMenu.class, DYNAMIC_MENU_MENU3_ASSOCIATION_SELECTION3_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.CheckMenu.class, test.model.CheckMenu.IS_CHECKED)}, null,true)}));
|
||||
//end dmb//
|
||||
}//initializeThisPopupMenu()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
this.setDefaultToolTipText("Test Tooltip (Thick Client)");
|
||||
this.setDefaultImage(new com.foundation.view.resource.ResourceReference("res://View/ProjectEditor/CoolImage"));
|
||||
initializeThisPopupMenu(this);
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#pack()
|
||||
*/
|
||||
public void pack() {
|
||||
//Don't pack since a custom size was specified.
|
||||
}//pack()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
case UNNAMED_COMPONENT1_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.TrayController) value).doSomething();
|
||||
break;
|
||||
case DYNAMIC_MENU_MENU1_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.TrayController) value).doMenuPressed((test.model.PushMenu) parameters[0]);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case DYNAMIC_MENU_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TrayController) value).getCollection();
|
||||
break;
|
||||
case DYNAMIC_MENU_MENU0_ASSOCIATION_TEXT0_ASSOCIATION_0:
|
||||
result = ((test.model.MenuContainer) value).getName();
|
||||
break;
|
||||
case DYNAMIC_MENU_MENU0_ASSOCIATION_COLLECTION0_ASSOCIATION_0:
|
||||
result = ((test.model.MenuContainer) value).getChildren();
|
||||
break;
|
||||
case DYNAMIC_MENU_MENU1_ASSOCIATION_TEXT1_ASSOCIATION_0:
|
||||
result = ((test.model.PushMenu) value).getName();
|
||||
break;
|
||||
case DYNAMIC_MENU_MENU2_ASSOCIATION_TEXT2_ASSOCIATION_0:
|
||||
result = ((test.model.RadioMenu) value).getName();
|
||||
break;
|
||||
case DYNAMIC_MENU_MENU2_ASSOCIATION_SELECTION2_ASSOCIATION_0:
|
||||
result = ((test.model.RadioMenu) value).getIsChecked();
|
||||
break;
|
||||
case DYNAMIC_MENU_MENU3_ASSOCIATION_TEXT3_ASSOCIATION_0:
|
||||
result = ((test.model.CheckMenu) value).getName();
|
||||
break;
|
||||
case DYNAMIC_MENU_MENU3_ASSOCIATION_SELECTION3_ASSOCIATION_0:
|
||||
result = ((test.model.CheckMenu) value).getIsChecked();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case DYNAMIC_MENU_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TrayController) value).getOldAttributeValue(test.local.view.controller.TrayController.COLLECTION);
|
||||
break;
|
||||
case DYNAMIC_MENU_MENU0_ASSOCIATION_TEXT0_ASSOCIATION_0:
|
||||
result = ((test.model.MenuContainer) value).getOldAttributeValue(test.model.MenuContainer.NAME);
|
||||
break;
|
||||
case DYNAMIC_MENU_MENU0_ASSOCIATION_COLLECTION0_ASSOCIATION_0:
|
||||
result = ((test.model.MenuContainer) value).getOldAttributeValue(test.model.MenuContainer.CHILDREN);
|
||||
break;
|
||||
case DYNAMIC_MENU_MENU1_ASSOCIATION_TEXT1_ASSOCIATION_0:
|
||||
result = ((test.model.PushMenu) value).getOldAttributeValue(test.model.PushMenu.NAME);
|
||||
break;
|
||||
case DYNAMIC_MENU_MENU2_ASSOCIATION_TEXT2_ASSOCIATION_0:
|
||||
result = ((test.model.RadioMenu) value).getOldAttributeValue(test.model.RadioMenu.NAME);
|
||||
break;
|
||||
case DYNAMIC_MENU_MENU2_ASSOCIATION_SELECTION2_ASSOCIATION_0:
|
||||
result = ((test.model.RadioMenu) value).getOldAttributeValue(test.model.RadioMenu.IS_CHECKED);
|
||||
break;
|
||||
case DYNAMIC_MENU_MENU3_ASSOCIATION_TEXT3_ASSOCIATION_0:
|
||||
result = ((test.model.CheckMenu) value).getOldAttributeValue(test.model.CheckMenu.NAME);
|
||||
break;
|
||||
case DYNAMIC_MENU_MENU3_ASSOCIATION_SELECTION3_ASSOCIATION_0:
|
||||
result = ((test.model.CheckMenu) value).getOldAttributeValue(test.model.CheckMenu.IS_CHECKED);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
case DYNAMIC_MENU_MENU2_ASSOCIATION_SELECTION2_ASSOCIATION_0:
|
||||
((test.model.RadioMenu) value).setIsChecked((java.lang.Boolean) parameters[0]);
|
||||
break;
|
||||
case DYNAMIC_MENU_MENU3_ASSOCIATION_SELECTION3_ASSOCIATION_0:
|
||||
((test.model.CheckMenu) value).setIsChecked((java.lang.Boolean) parameters[0]);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Menu getVpUnnamedComponent0() {
|
||||
return unnamedComponent0;
|
||||
}//getVpUnnamedComponent0()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Menu getVpUnnamedComponent1() {
|
||||
return unnamedComponent1;
|
||||
}//getVpUnnamedComponent1()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.DynamicMenu getVpDynamicMenu() {
|
||||
return dynamicMenu;
|
||||
}//getVpDynamicMenu()//
|
||||
}//Tray//
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2009,2008 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<tray-item name="Tray" tool-tip-text="Test Tooltip (Thick Client)" image="res://View/ProjectEditor/CoolImage">
|
||||
<value-holder name="controllerHolder" type="test.local.view.controller.TrayController"/>
|
||||
|
||||
<menu-floating>
|
||||
<menu text="Test Menu Item">
|
||||
<method function="selection" name="doSomething" value-holder="controllerHolder"/>
|
||||
</menu>
|
||||
<menu-dynamic name="dynamicMenu">
|
||||
<association function="collection" attribute="collection" value-holder="controllerHolder"/>
|
||||
|
||||
<dynamic-cascade-menu class="test.model.MenuContainer">
|
||||
<association function="text" attribute="name" row-type="test.model.MenuContainer"/>
|
||||
<association function="collection" attribute="children" row-type="test.model.MenuContainer"/>
|
||||
</dynamic-cascade-menu>
|
||||
<dynamic-push-menu class="test.model.PushMenu">
|
||||
<association function="text" attribute="name" row-type="test.model.PushMenu"/>
|
||||
<method function="selection" name="doMenuPressed" signature="Ltest.model.PushMenu;" row-type="test.model.PushMenu" value-holder="controllerHolder"/>
|
||||
</dynamic-push-menu>
|
||||
<dynamic-radio-menu class="test.model.RadioMenu">
|
||||
<association function="text" attribute="name" row-type="test.model.RadioMenu"/>
|
||||
<association function="selection" attribute="isChecked" row-type="test.model.RadioMenu"/>
|
||||
</dynamic-radio-menu>
|
||||
<dynamic-check-menu class="test.model.CheckMenu">
|
||||
<association function="text" attribute="name" row-type="test.model.CheckMenu"/>
|
||||
<association function="selection" attribute="isChecked" row-type="test.model.CheckMenu"/>
|
||||
</dynamic-check-menu>
|
||||
</menu-dynamic>
|
||||
</menu-floating>
|
||||
</tray-item>
|
||||
</vml>
|
||||
@@ -0,0 +1,454 @@
|
||||
package test.local.view;
|
||||
|
||||
/**
|
||||
* TreePageView
|
||||
*/
|
||||
public class TreePageView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String SAMPLE_TREE1_LABEL_COMPONENT = "sampleTree1Label";
|
||||
public static final String SAMPLE_TREE1_COMPONENT = "sampleTree1";
|
||||
public static final String FIRST_CELL_BUTTON_COMPONENT = "firstCellButton";
|
||||
public static final String FIRST_CELL_PROGRESS_COMPONENT = "firstCellProgress";
|
||||
public static final String FIRST_CELL_COMBO_COMPONENT = "firstCellCombo";
|
||||
public static final String FIRST_CELL_TEXT_COMPONENT = "firstCellText";
|
||||
public static final String INNER_VIEW_COMPONENT = "innerView";
|
||||
public static final String TREE_PAGE_VIEW_COMPONENT = "TreePageView";
|
||||
|
||||
//Association Identifiers//
|
||||
protected static final int SAMPLE_TREE1_ASSOCIATION_CHILDREN_ASSOCIATION = 0;
|
||||
protected static final int SAMPLE_TREE1_ASSOCIATION_CHILDREN1_ASSOCIATION = 1;
|
||||
protected static final int SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_HEADER_IMAGE_ASSOCIATION_0 = 2;
|
||||
protected static final int SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0 = 3;
|
||||
protected static final int SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_1 = 4;
|
||||
protected static final int SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_2 = 5;
|
||||
protected static final int SAMPLE_TREE1_COLUMN_PART1_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0 = 6;
|
||||
protected static final int SAMPLE_TREE1_COLUMN_PART1_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_1 = 7;
|
||||
protected static final int FIRST_CELL_PROGRESS_ASSOCIATION_PROGRESS_ASSOCIATION_0 = 8;
|
||||
protected static final int FIRST_CELL_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 9;
|
||||
protected static final int FIRST_CELL_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0 = 10;
|
||||
protected static final int FIRST_CELL_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0 = 11;
|
||||
protected static final int FIRST_CELL_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 12;
|
||||
protected static final int SAMPLE_TREE1_ASSOCIATION_COLLECTION_ASSOCIATION_0 = 13;
|
||||
protected static final int SAMPLE_TREE1_ASSOCIATION_SELECTION_ASSOCIATION_0 = 14;
|
||||
protected static final int SAMPLE_TREE1_ASSOCIATION_DATA_0_ASSOCIATION_0 = 15;
|
||||
protected static final int INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0 = 16;
|
||||
protected static final int INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0 = 17;
|
||||
|
||||
//Method Association Identifiers//
|
||||
protected static final int FIRST_CELL_BUTTON_SELECTION_METHOD_ASSOCIATION = 0;
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.Label sampleTree1Label = null;
|
||||
private com.foundation.view.swt.SimpleTreeTable sampleTree1 = null;
|
||||
private com.foundation.view.swt.cell.CellButton firstCellButton = null;
|
||||
private com.foundation.view.swt.cell.CellProgress firstCellProgress = null;
|
||||
private com.foundation.view.swt.cell.CellComboBox firstCellCombo = null;
|
||||
private com.foundation.view.swt.cell.CellTextField firstCellText = null;
|
||||
private com.foundation.view.swt.SimpleTreeTable.IHiddenColor sampleTree1HiddenDataPart0 = null;
|
||||
private com.foundation.view.swt.PanelViewer innerView = null;
|
||||
/**
|
||||
* TreePageView default constructor.
|
||||
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
|
||||
*/
|
||||
public TreePageView() {
|
||||
}//TreePageView()//
|
||||
/**
|
||||
* TreePageView constructor.
|
||||
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public TreePageView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, TREE_PAGE_VIEW_COMPONENT, 0);
|
||||
|
||||
setController(controller);
|
||||
}//TreePageView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.local.view.controller.TreePageViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeSampleTree1Label(com.foundation.view.swt.Container parent) {
|
||||
sampleTree1Label = new com.foundation.view.swt.Label(parent, SAMPLE_TREE1_LABEL_COMPONENT, 0);
|
||||
|
||||
sampleTree1Label.setText("Top down model representation:");
|
||||
}//initializeSampleTree1Label()//
|
||||
public void initializeFirstCellButton(com.foundation.view.swt.SimpleTreeTable parent) {
|
||||
firstCellButton = new com.foundation.view.swt.cell.CellButton(parent, FIRST_CELL_BUTTON_COMPONENT, 0);
|
||||
|
||||
firstCellButton.setText("...");
|
||||
firstCellButton.setSelectionMethod(new com.foundation.view.MethodAssociation(this, FIRST_CELL_BUTTON_SELECTION_METHOD_ASSOCIATION, firstCellButton, "controllerHolder", null, null));
|
||||
}//initializeFirstCellButton()//
|
||||
public void initializeFirstCellProgress(com.foundation.view.swt.SimpleTreeTable parent) {
|
||||
firstCellProgress = new com.foundation.view.swt.cell.CellProgress(parent, FIRST_CELL_PROGRESS_COMPONENT, 0);
|
||||
|
||||
firstCellProgress.setProgress(new java.math.BigDecimal("0"));
|
||||
firstCellProgress.setMinimum(new Integer(0));
|
||||
firstCellProgress.setMaximum(new Integer(100));
|
||||
firstCellProgress.setMultiplier(new java.math.BigDecimal("100"));
|
||||
firstCellProgress.setProgressAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Project.class, FIRST_CELL_PROGRESS_ASSOCIATION_PROGRESS_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Project.class, test.model.Project.PROGRESS)}, null,true)}));
|
||||
}//initializeFirstCellProgress()//
|
||||
public void initializeFirstCellCombo(com.foundation.view.swt.SimpleTreeTable parent) {
|
||||
firstCellCombo = new com.foundation.view.swt.cell.CellComboBox(parent, FIRST_CELL_COMBO_COMPONENT, com.foundation.view.swt.cell.CellComboBox.STYLE_DROP_DOWN|com.foundation.view.swt.cell.CellComboBox.STYLE_READ_ONLY);
|
||||
|
||||
firstCellCombo.setAutoSynchronizeSelection(true);
|
||||
firstCellCombo.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TreePageViewController.class, FIRST_CELL_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TreePageViewController.class, test.local.view.controller.TreePageViewController.PRIORITIES)}, null,true)}));
|
||||
firstCellCombo.setSelectionAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Project.class, FIRST_CELL_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Project.class, test.model.Project.PRIORITY)}, null,true)}));
|
||||
firstCellCombo.setFont(com.foundation.view.JefFont.getJefFonts("arial, 8, normal"));
|
||||
firstCellCombo.setItemTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Priority.class, FIRST_CELL_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Priority.class, test.model.Priority.NAME)}, null,true)}));
|
||||
}//initializeFirstCellCombo()//
|
||||
public void initializeFirstCellText(com.foundation.view.swt.SimpleTreeTable parent) {
|
||||
firstCellText = new com.foundation.view.swt.cell.CellTextField(parent, FIRST_CELL_TEXT_COMPONENT, 0);
|
||||
|
||||
com.foundation.view.swt.cell.CellTextField.TextFormat firstCellTextFormat = (com.foundation.view.swt.cell.CellTextField.TextFormat) firstCellText.initializeFormat(com.foundation.view.swt.cell.CellTextField.TextFormat.class);
|
||||
firstCellTextFormat.setValueAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Project.class, FIRST_CELL_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Project.class, test.model.Project.NAME)}, null,true)}));
|
||||
firstCellText.setAutoSynchronizeValue(true);
|
||||
}//initializeFirstCellText()//
|
||||
public void initializeSampleTree1(com.foundation.view.swt.Container parent) {
|
||||
sampleTree1 = new com.foundation.view.swt.SimpleTreeTable(parent, SAMPLE_TREE1_COMPONENT, com.foundation.view.swt.SimpleTreeTable.STYLE_BORDER|com.foundation.view.swt.SimpleTreeTable.STYLE_SINGLE);
|
||||
|
||||
sampleTree1.setAutoFit(true);
|
||||
sampleTree1.setChildAssociation(new com.foundation.view.CollectingMultiAssociationContainer(new com.foundation.view.CollectingMultiAssociation[] {new com.foundation.view.CollectingMultiAssociation(test.model.Project.class, SAMPLE_TREE1_ASSOCIATION_CHILDREN_ASSOCIATION, this, false, null, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(sampleTree1, null, null, test.model.Project.class, test.model.Project.CONTACTS)}, null), new com.foundation.view.CollectingMultiAssociation(test.model.Contact.class, SAMPLE_TREE1_ASSOCIATION_CHILDREN1_ASSOCIATION, this, false, null, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(sampleTree1, null, null, test.model.Contact.class, test.model.Contact.ADDRESSES)}, null)}));
|
||||
com.foundation.view.swt.SimpleTreeTable.ColumnData sampleTree1ColumnPart0 = sampleTree1.addColumn();
|
||||
sampleTree1ColumnPart0.setHeaderText("Name");
|
||||
sampleTree1ColumnPart0.setHeaderImageAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TreePageViewController.class, SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_HEADER_IMAGE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TreePageViewController.class, test.local.view.controller.TreePageViewController.COOL_IMAGE)}, null,true)}));
|
||||
sampleTree1ColumnPart0.setCellTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.Project.class, SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Project.class, test.model.Project.NAME)}, null,true), new com.foundation.view.MultiAssociation(test.model.Contact.class, SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_1, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Contact.class, test.model.Contact.NAME)}, null,true), new com.foundation.view.MultiAssociation(test.model.Address.class, SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_2, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.Address.class, test.model.Address.NAME)}, null,true)}));
|
||||
com.foundation.view.swt.SimpleTreeTable.ColumnData sampleTree1ColumnPart1 = sampleTree1.addColumn();
|
||||
sampleTree1ColumnPart1.setHeaderText("Address Data");
|
||||
sampleTree1ColumnPart1.setHeaderImage(new com.foundation.view.resource.ResourceReference("res://View/ProjectEditor/CoolImage"));
|
||||
sampleTree1ColumnPart1.setCellTextAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(test.model.EmailAddress.class, SAMPLE_TREE1_COLUMN_PART1_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.EmailAddress.class, test.model.EmailAddress.EMAIL)}, null,true), new com.foundation.view.MultiAssociation(test.model.StreetAddress.class, SAMPLE_TREE1_COLUMN_PART1_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_1, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.model.StreetAddress.class, test.model.StreetAddress.LINE)}, null,true)}));
|
||||
com.foundation.view.swt.SimpleTreeTable.ColumnData sampleTree1ColumnPart2 = sampleTree1.addColumn();
|
||||
sampleTree1ColumnPart2.setHeaderText("Button");
|
||||
initializeFirstCellButton(sampleTree1);
|
||||
sampleTree1ColumnPart2.addCellComponent(test.model.Project.class, firstCellButton);
|
||||
com.foundation.view.swt.SimpleTreeTable.ColumnData sampleTree1ColumnPart3 = sampleTree1.addColumn();
|
||||
sampleTree1ColumnPart3.setHeaderText("Progress");
|
||||
initializeFirstCellProgress(sampleTree1);
|
||||
sampleTree1ColumnPart3.addCellComponent(test.model.Project.class, firstCellProgress);
|
||||
com.foundation.view.swt.SimpleTreeTable.ColumnData sampleTree1ColumnPart4 = sampleTree1.addColumn();
|
||||
sampleTree1ColumnPart4.setHeaderText("Combo");
|
||||
initializeFirstCellCombo(sampleTree1);
|
||||
sampleTree1ColumnPart4.addCellComponent(test.model.Project.class, firstCellCombo);
|
||||
com.foundation.view.swt.SimpleTreeTable.ColumnData sampleTree1ColumnPart5 = sampleTree1.addColumn();
|
||||
sampleTree1ColumnPart5.setHeaderText("Text");
|
||||
initializeFirstCellText(sampleTree1);
|
||||
sampleTree1ColumnPart5.addCellComponent(test.model.Project.class, firstCellText);
|
||||
sampleTree1.setAutoSynchronizeSelection(true);
|
||||
sampleTree1.setCollectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TreePageViewController.class, SAMPLE_TREE1_ASSOCIATION_COLLECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TreePageViewController.class, test.local.view.controller.TreePageViewController.PROJECTS)}, null,true)}));
|
||||
sampleTree1.setSelectionAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TreePageViewController.class, SAMPLE_TREE1_ASSOCIATION_SELECTION_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TreePageViewController.class, test.local.view.controller.TreePageViewController.SELECTION)}, null,true)}));
|
||||
sampleTree1HiddenDataPart0 = sampleTree1.addHiddenColor();
|
||||
sampleTree1HiddenDataPart0.setData(new com.foundation.view.JefColor("(255,255,0,0)"));
|
||||
sampleTree1HiddenDataPart0.setDataAssociation(new com.foundation.view.MultiAssociationContainer(new com.foundation.view.MultiAssociation[] {new com.foundation.view.MultiAssociation(java.lang.Object.class, SAMPLE_TREE1_ASSOCIATION_DATA_0_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[0],"controllerHolder",true)}));
|
||||
}//initializeSampleTree1()//
|
||||
public void initializeInnerView(com.foundation.view.swt.Container parent) {
|
||||
innerView = new com.foundation.view.swt.PanelViewer(parent, INNER_VIEW_COMPONENT, com.foundation.view.swt.PanelViewer.STYLE_BORDER);
|
||||
|
||||
innerView.setChangeFocus(false);
|
||||
innerView.setControllerAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TreePageViewController.class, INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TreePageViewController.class, test.local.view.controller.TreePageViewController.EDITOR)}, null,true)}));
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(innerView);
|
||||
|
||||
innerView.setLayout(layout);
|
||||
innerView.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
innerView.setDefaultIsVisible(false);
|
||||
innerView.setIsVisibleAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(test.local.view.controller.TreePageViewController.class, INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, test.local.view.controller.TreePageViewController.class, test.local.view.controller.TreePageViewController.EDITOR)}, null,true)}));
|
||||
}//initializeInnerView()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeSampleTree1Label(this);
|
||||
initializeSampleTree1(this);
|
||||
initializeInnerView(this);
|
||||
com.foundation.view.swt.GridLayout layout = new com.foundation.view.swt.GridLayout(this);
|
||||
|
||||
layout.setNumColumns(1);
|
||||
layout.setMarginHeight(5);
|
||||
layout.setMarginWidth(5);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {sampleTree1, innerView}));
|
||||
this.setDefaultContainerTitle("Tree");
|
||||
layoutComponents();
|
||||
super.internalViewInitialize();
|
||||
setupLinkages();
|
||||
}//internalViewInitialize()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
|
||||
*/
|
||||
public Object invokeGetMethod(int associationNumber, Object value) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeGetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
|
||||
*/
|
||||
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
|
||||
switch(associationNumber) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Attribute association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
}//invokeSetMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
|
||||
Object retVal = null;
|
||||
|
||||
switch(associationNumber) {
|
||||
case FIRST_CELL_BUTTON_SELECTION_METHOD_ASSOCIATION:
|
||||
((test.local.view.controller.TreePageViewController) value).doProjectButtonPressed((test.model.Project) parameters[0]);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Method association broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
return retVal;
|
||||
}//invokeMethod()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
|
||||
*/
|
||||
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
|
||||
Object result = null;
|
||||
|
||||
if(flags == INVOKE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case SAMPLE_TREE1_ASSOCIATION_CHILDREN_ASSOCIATION:
|
||||
result = ((test.model.Project) value).getContacts();
|
||||
break;
|
||||
case SAMPLE_TREE1_ASSOCIATION_CHILDREN1_ASSOCIATION:
|
||||
result = ((test.model.Contact) value).getAddresses();
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_HEADER_IMAGE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TreePageViewController) value).getCoolImage();
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getName();
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_1:
|
||||
result = ((test.model.Contact) value).getName();
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_2:
|
||||
result = ((test.model.Address) value).getName();
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART1_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.EmailAddress) value).getEmail();
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART1_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_1:
|
||||
result = ((test.model.StreetAddress) value).getLine();
|
||||
break;
|
||||
case FIRST_CELL_PROGRESS_ASSOCIATION_PROGRESS_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getProgress();
|
||||
break;
|
||||
case FIRST_CELL_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TreePageViewController) value).getPriorities();
|
||||
break;
|
||||
case FIRST_CELL_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getPriority();
|
||||
break;
|
||||
case FIRST_CELL_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Priority) value).getName();
|
||||
break;
|
||||
case FIRST_CELL_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getName();
|
||||
break;
|
||||
case SAMPLE_TREE1_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TreePageViewController) value).getProjects();
|
||||
break;
|
||||
case SAMPLE_TREE1_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TreePageViewController) value).getSelection();
|
||||
break;
|
||||
case SAMPLE_TREE1_ASSOCIATION_DATA_0_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TreePageViewController) value).getObjectColor((java.lang.Object) parameters[0]);
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TreePageViewController) value).getEditor();
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TreePageViewController) value).getEditor();
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
case SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_HEADER_IMAGE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TreePageViewController) value).getOldAttributeValue(test.local.view.controller.TreePageViewController.COOL_IMAGE);
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getOldAttributeValue(test.model.Project.NAME);
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_1:
|
||||
result = ((test.model.Contact) value).getOldAttributeValue(test.model.Contact.NAME);
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART0_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_2:
|
||||
result = ((test.model.Address) value).getOldAttributeValue(test.model.Address.NAME);
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART1_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.EmailAddress) value).getOldAttributeValue(test.model.EmailAddress.EMAIL);
|
||||
break;
|
||||
case SAMPLE_TREE1_COLUMN_PART1_ASSOCIATION_COLUMN_CELL_TEXT_ASSOCIATION_1:
|
||||
result = ((test.model.StreetAddress) value).getOldAttributeValue(test.model.StreetAddress.LINE);
|
||||
break;
|
||||
case FIRST_CELL_PROGRESS_ASSOCIATION_PROGRESS_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getOldAttributeValue(test.model.Project.PROGRESS);
|
||||
break;
|
||||
case FIRST_CELL_COMBO_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TreePageViewController) value).getOldAttributeValue(test.local.view.controller.TreePageViewController.PRIORITIES);
|
||||
break;
|
||||
case FIRST_CELL_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getOldAttributeValue(test.model.Project.PRIORITY);
|
||||
break;
|
||||
case FIRST_CELL_COMBO_ASSOCIATION_ITEM_TEXT_ASSOCIATION_0:
|
||||
result = ((test.model.Priority) value).getOldAttributeValue(test.model.Priority.NAME);
|
||||
break;
|
||||
case FIRST_CELL_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
result = ((test.model.Project) value).getOldAttributeValue(test.model.Project.NAME);
|
||||
break;
|
||||
case SAMPLE_TREE1_ASSOCIATION_COLLECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TreePageViewController) value).getOldAttributeValue(test.local.view.controller.TreePageViewController.PROJECTS);
|
||||
break;
|
||||
case SAMPLE_TREE1_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TreePageViewController) value).getOldAttributeValue(test.local.view.controller.TreePageViewController.SELECTION);
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_CONTROLLER_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TreePageViewController) value).getOldAttributeValue(test.local.view.controller.TreePageViewController.EDITOR);
|
||||
break;
|
||||
case INNER_VIEW_ASSOCIATION_IS_VISIBLE_ASSOCIATION_0:
|
||||
result = ((test.local.view.controller.TreePageViewController) value).getOldAttributeValue(test.local.view.controller.TreePageViewController.EDITOR);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (original value getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else {
|
||||
switch(associationNumber) {
|
||||
case FIRST_CELL_COMBO_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
((test.model.Project) value).setPriority((test.model.Priority) parameters[0]);
|
||||
break;
|
||||
case FIRST_CELL_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
|
||||
((test.model.Project) value).setName((java.lang.String) parameters[0]);
|
||||
break;
|
||||
case SAMPLE_TREE1_ASSOCIATION_SELECTION_ASSOCIATION_0:
|
||||
((test.local.view.controller.TreePageViewController) value).setSelection((java.lang.Object) parameters[0]);
|
||||
break;
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (setter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//else//
|
||||
return result;
|
||||
}//invokeMethod()//
|
||||
/**
|
||||
* Lays out the components.
|
||||
*/
|
||||
public void layoutComponents() {
|
||||
{ //sampleTree1//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.verticalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
layoutData.grabExcessVerticalSpace = true;
|
||||
sampleTree1.setLayoutData(layoutData);
|
||||
}//block//
|
||||
{ //innerView//
|
||||
com.foundation.view.swt.layout.GridData layoutData = new com.foundation.view.swt.layout.GridData();
|
||||
|
||||
layoutData.horizontalAlignment = com.foundation.view.swt.layout.GridData.FILL;
|
||||
layoutData.grabExcessHorizontalSpace = true;
|
||||
innerView.setLayoutData(layoutData);
|
||||
}//block//
|
||||
}//layoutComponents()//
|
||||
/**
|
||||
* Initializes the direct linkages between the components.
|
||||
*/
|
||||
public void setupLinkages() {
|
||||
sampleTree1HiddenDataPart0.addSelectionLink(new com.foundation.view.LinkData(sampleTree1Label, com.foundation.view.swt.Label.LINK_TARGET_BACKGROUND_COLOR, null, false, false));
|
||||
}//setupLinkages()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.ValueHolder getVpControllerHolder() {
|
||||
return controllerHolder;
|
||||
}//getVpControllerHolder()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.Label getVpSampleTree1Label() {
|
||||
return sampleTree1Label;
|
||||
}//getVpSampleTree1Label()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.SimpleTreeTable getVpSampleTree1() {
|
||||
return sampleTree1;
|
||||
}//getVpSampleTree1()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellButton getVpFirstCellButton() {
|
||||
return firstCellButton;
|
||||
}//getVpFirstCellButton()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellProgress getVpFirstCellProgress() {
|
||||
return firstCellProgress;
|
||||
}//getVpFirstCellProgress()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellComboBox getVpFirstCellCombo() {
|
||||
return firstCellCombo;
|
||||
}//getVpFirstCellCombo()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.cell.CellTextField getVpFirstCellText() {
|
||||
return firstCellText;
|
||||
}//getVpFirstCellText()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.SimpleTreeTable.IHiddenColor getVpSampleTree1HiddenDataPart0() {
|
||||
return sampleTree1HiddenDataPart0;
|
||||
}//getVpSampleTree1HiddenDataPart0()//
|
||||
/**
|
||||
* Gets the view component.
|
||||
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
|
||||
* @return The view component.
|
||||
*/
|
||||
protected com.foundation.view.swt.PanelViewer getVpInnerView() {
|
||||
return innerView;
|
||||
}//getVpInnerView()//
|
||||
}//TreePageView//
|
||||
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0"?>
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name='thick:swt'/>
|
||||
</metadata>
|
||||
<panel style='' name='TreePageView' container-title='Tree'>
|
||||
<grid-layout margin-height='5' margin-width='5' column-count='1'/>
|
||||
|
||||
<value-holder type='test.local.view.controller.TreePageViewController' name='controllerHolder'/>
|
||||
|
||||
<label style='' name='sampleTree1Label' text='Top down model representation:'/>
|
||||
|
||||
<simple-tree-table style='single selection | border' auto-fit='true' auto-synchronize-selection='true' name='sampleTree1' tab-order='1'>
|
||||
<grid-layout-data horizontal-alignment='fill' vertical-fill='true' horizontal-fill='true' vertical-alignment='fill'/>
|
||||
|
||||
<association function='collection' attribute='projects' value-holder='controllerHolder'/>
|
||||
<association function='selection' attribute='selection' value-holder='controllerHolder'/>
|
||||
<association function='children' attribute='contacts' row-type='test.model.Project'/>
|
||||
<association function='children' attribute='addresses' row-type='test.model.Contact'/>
|
||||
|
||||
<hidden-color data='#FFFF00'>
|
||||
<association value-holder='controllerHolder' function='data' getter='getObjectColor' row-type='java.lang.Object' getter-signature='Ljava.lang.Object;'/>
|
||||
<link function='selection' component='sampleTree1Label' target='background-color'/>
|
||||
</hidden-color>
|
||||
|
||||
<columns>
|
||||
<column header-text='Name'>
|
||||
<association attribute='coolImage' function='header-image' value-holder='controllerHolder'/>
|
||||
<association-group function='cell-text'>
|
||||
<association-target-attribute row-type='test.model.Project' attribute='name'/>
|
||||
<association-target-attribute row-type='test.model.Contact' attribute='name'/>
|
||||
<association-target-attribute row-type='test.model.Address' attribute='name'/>
|
||||
</association-group>
|
||||
<!-- Causes the +/- icons to be overly small. This appears to be an SWT bug.
|
||||
<association-group function='cell-image'>
|
||||
<association-target-method row-type='test.model.Project' getter='getCoolImage' value-holder='controllerHolder'/>
|
||||
<association-target-method row-type='test.model.Contact' getter='getCoolImage' value-holder='controllerHolder'/>
|
||||
<association-target-method row-type='test.model.Address' getter='getCoolImage' value-holder='controllerHolder'/>
|
||||
</association-group>
|
||||
-->
|
||||
</column>
|
||||
<column header-image='res://View/ProjectEditor/CoolImage' header-text='Address Data'>
|
||||
<association-group function='cell-text'>
|
||||
<association-target-attribute row-type='test.model.EmailAddress' attribute='email'/>
|
||||
<association-target-attribute row-type='test.model.StreetAddress' attribute='line'/>
|
||||
</association-group>
|
||||
</column>
|
||||
<column header-text='Button'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Project'>
|
||||
<cell-button text='...' name='firstCellButton'>
|
||||
<method value-holder='controllerHolder' function='selection' signature='Ltest.model.Project;' name='doProjectButtonPressed'/>
|
||||
</cell-button>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<column header-text='Progress'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Project'>
|
||||
<cell-progress minimum='0' name='firstCellProgress' maximum='100' multiplier="100">
|
||||
<association attribute='progress' function='progress' row-type='test.model.Project'/>
|
||||
</cell-progress>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<column header-text='Combo'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Project'>
|
||||
<cell-combo style='drop down | read only' auto-synchronize-selection='true' name='firstCellCombo' font='arial,8,normal'>
|
||||
<association attribute='priorities' function='collection' value-holder='controllerHolder'/>
|
||||
<association attribute='priority' function='selection' row-type='test.model.Project'/>
|
||||
<association attribute='name' function='item-text' row-type='test.model.Priority'/>
|
||||
</cell-combo>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
<column header-text='Text'>
|
||||
<display-set>
|
||||
<display-component row-type='test.model.Project'>
|
||||
<cell-text auto-synchronize-text='true' style='' name='firstCellText'>
|
||||
<text-format>
|
||||
<association attribute='name' function='value' row-type='test.model.Project'/>
|
||||
</text-format>
|
||||
</cell-text>
|
||||
</display-component>
|
||||
</display-set>
|
||||
</column>
|
||||
</columns>
|
||||
</simple-tree-table>
|
||||
<panel-viewer style='border' change-focus='false' name='innerView' tab-order='1' is-visible='false'>
|
||||
<fill-layout/>
|
||||
<grid-layout-data horizontal-fill='true' horizontal-alignment='fill'/>
|
||||
<association attribute='editor' function='is-visible' value-holder='controllerHolder'/>
|
||||
<association attribute='editor' function='controller' value-holder='controllerHolder'/>
|
||||
</panel-viewer>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (c) 2006,2009 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.application.TestViewApplication;
|
||||
|
||||
import com.foundation.application.IApplication;
|
||||
import com.foundation.attribute.ReflectionContext;
|
||||
import com.foundation.controller.ViewController;
|
||||
import com.foundation.view.IViewContext;
|
||||
|
||||
public abstract class AbstractViewController extends ViewController {
|
||||
/**
|
||||
* AbstractViewController constructor.
|
||||
* @param context The context underwhich the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
*/
|
||||
public AbstractViewController(IViewContext context) {
|
||||
super(context);
|
||||
}//AbstractViewController()//
|
||||
/**
|
||||
* AbstractViewController constructor.
|
||||
* @param context The context underwhich the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
* @param reflectionContext The reflection context to be used by the view.
|
||||
*/
|
||||
public AbstractViewController(IViewContext context, ReflectionContext reflectionContext) {
|
||||
super(context, reflectionContext);
|
||||
}//AbstractViewController()//
|
||||
/**
|
||||
* AbstractViewController constructor.
|
||||
* @param context
|
||||
* @param validateOnOpen
|
||||
*/
|
||||
public AbstractViewController(IViewContext context, boolean validateOnOpen) {
|
||||
super(context, validateOnOpen);
|
||||
}
|
||||
/**
|
||||
* AbstractViewController constructor.
|
||||
* @param context
|
||||
* @param reflectionContext
|
||||
* @param validateOnOpen
|
||||
*/
|
||||
public AbstractViewController(IViewContext context, ReflectionContext reflectionContext, boolean validateOnOpen) {
|
||||
super(context, reflectionContext, validateOnOpen);
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#validate()
|
||||
*/
|
||||
public boolean validate() {
|
||||
return true;
|
||||
}//validate()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.common.IEntity#getApplication()
|
||||
*/
|
||||
public IApplication getApplication() {
|
||||
return TestViewApplication.getSingleton();
|
||||
}//getApplication()//
|
||||
}//AbstractViewController//
|
||||
@@ -0,0 +1,189 @@
|
||||
/*
|
||||
* Copyright (c) 2005,2007 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.ComboPageView;
|
||||
import test.model.EmailAddress;
|
||||
import test.model.Project;
|
||||
import test.model.StreetAddress;
|
||||
|
||||
import com.foundation.controller.ViewController;
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.util.IManagedList;
|
||||
import com.foundation.view.IViewContext;
|
||||
import com.foundation.view.JefColor;
|
||||
|
||||
public class ComboPageViewController extends AbstractViewController {
|
||||
public static final Attribute PROJECTS = registerCollection(ComboPageViewController.class, "projects", AO_REFERENCED);
|
||||
public static final Attribute EDITOR = registerAttribute(ComboPageViewController.class, "editor", AO_REFERENCED);
|
||||
public static final Attribute SELECTED_PROJECT = registerAttribute(ComboPageViewController.class, "selectedProject", AO_REFERENCED);
|
||||
public static final Attribute SELECTED_CONTACT = registerAttribute(ComboPageViewController.class, "selectedContact", AO_REFERENCED);
|
||||
public static final Attribute SELECTED_ADDRESS = registerAttribute(ComboPageViewController.class, "selectedAddress", AO_REFERENCED);
|
||||
public static final Attribute EDITABLE_CONTACT_NAME = registerAttribute(ComboPageViewController.class, "editableContactName", AO_REFERENCED);
|
||||
/**
|
||||
* ComboPageViewController constructor.
|
||||
* @param context The context underwhich the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
* @param projects The collection of displayed projects.
|
||||
*/
|
||||
public ComboPageViewController(IViewContext context, IManagedList projects) {
|
||||
super(context);
|
||||
|
||||
setProjects((IManagedList) getReflectionManager().createReflection(projects));
|
||||
}//ComboPageViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.common.Entity#lazyLoadAttribute(com.foundation.metadata.Attribute)
|
||||
*/
|
||||
protected Object lazyLoadAttribute(Attribute attribute) {
|
||||
Object result = null;
|
||||
|
||||
result = super.lazyLoadAttribute(attribute);
|
||||
|
||||
return result;
|
||||
}//lazyLoadAttribute()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return ComboPageView.class;
|
||||
}//getViewClass()//
|
||||
/**
|
||||
* Gets the collection of projects displayed in the collection.
|
||||
* @return The projects.
|
||||
*/
|
||||
public IManagedList getProjects() {
|
||||
return (IManagedList) getAttributeValue(PROJECTS);
|
||||
}//getProjects()//
|
||||
/**
|
||||
* Sets the collection of projects displayed in the collection.
|
||||
* @param projects The projects.
|
||||
*/
|
||||
private void setProjects(IManagedList projects) {
|
||||
setAttributeValue(PROJECTS, projects);
|
||||
}//setProjects()//
|
||||
/**
|
||||
* Gets the editor displayed under the collection.
|
||||
* @return The editor or null if no editor is visible.
|
||||
*/
|
||||
public ViewController getEditor() {
|
||||
return (ViewController) getAttributeValue(EDITOR);
|
||||
}//getEditor()//
|
||||
/**
|
||||
* Sets the editor displayed under the collection.
|
||||
* @param editor The editor or null if no editor is visible.
|
||||
*/
|
||||
private void setEditor(ViewController editor) {
|
||||
setAttributeValue(EDITOR, editor);
|
||||
}//setEditor()//
|
||||
/**
|
||||
* Gets the collection selected project.
|
||||
* @return The selected object in the collection.
|
||||
*/
|
||||
public Object getSelectedProject() {
|
||||
return (Object) getAttributeValue(SELECTED_PROJECT);
|
||||
}//getSelectedProject()//
|
||||
/**
|
||||
* Sets the collection selected project.
|
||||
* @param selectedProject The selected object in the collection.
|
||||
*/
|
||||
public void setSelectedProject(Object selectedProject) {
|
||||
if(getSelectedProject() != selectedProject) {
|
||||
setAttributeValue(SELECTED_PROJECT, selectedProject);
|
||||
setSelectedContact(null);
|
||||
setupEditor(selectedProject);
|
||||
}//if//
|
||||
}//setSelectedProject()//
|
||||
public String getProjectName() {
|
||||
return (String) ((Project) getSelectedProject()).getName();
|
||||
}
|
||||
public void setProjectName(String name) {
|
||||
if(getSelectedProject() != null) {
|
||||
((Project) getSelectedProject()).setName(name);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Gets the collection selected contact.
|
||||
* @return The selected object in the collection.
|
||||
*/
|
||||
public Object getSelectedContact() {
|
||||
return (Object) getAttributeValue(SELECTED_CONTACT);
|
||||
}//getSelectedContact()//
|
||||
/**
|
||||
* Sets the collection selected contact.
|
||||
* @param selectedContact The selected object in the collection.
|
||||
*/
|
||||
public void setSelectedContact(Object selectedContact) {
|
||||
if(getSelectedContact() != selectedContact) {
|
||||
setAttributeValue(SELECTED_CONTACT, selectedContact);
|
||||
setSelectedAddress(null);
|
||||
setupEditor(selectedContact);
|
||||
}//if//
|
||||
}//setSelectedContact()//
|
||||
/**
|
||||
* Gets the editable contact name which is used for testing the editable combo box.
|
||||
* @return The contact name.
|
||||
*/
|
||||
public Object getEditableContactName() {
|
||||
return (Object) getAttributeValue(EDITABLE_CONTACT_NAME);
|
||||
}//getEditableContactName()//
|
||||
/**
|
||||
* Sets the editable contact name which is used for testing the editable combo box.
|
||||
* @param editableContactName The contact name.
|
||||
*/
|
||||
public void setEditableContactName(Object editableContactName) {
|
||||
setAttributeValue(EDITABLE_CONTACT_NAME, editableContactName);
|
||||
}//setEditableContactName()//
|
||||
/**
|
||||
* Gets the collection selected address.
|
||||
* @return The selected object in the collection.
|
||||
*/
|
||||
public Object getSelectedAddress() {
|
||||
return (Object) getAttributeValue(SELECTED_ADDRESS);
|
||||
}//getSelectedAddress()//
|
||||
/**
|
||||
* Sets the collection selected address.
|
||||
* @param selectedAddress The selected object in the collection.
|
||||
*/
|
||||
public void setSelectedAddress(Object selectedAddress) {
|
||||
if(getSelectedAddress() != selectedAddress) {
|
||||
setAttributeValue(SELECTED_ADDRESS, selectedAddress);
|
||||
setupEditor(selectedAddress);
|
||||
}//if//
|
||||
}//setSelectedAddress()//
|
||||
/**
|
||||
* Sets up the editor for the given selection.
|
||||
* @param selection The selection whose editor must be setup.
|
||||
*/
|
||||
private void setupEditor(Object selection) {
|
||||
ViewController editor = null;
|
||||
|
||||
if(selection instanceof EmailAddress) {
|
||||
editor = new EmailAddressEditorViewController(getContext(), new Runnable() {
|
||||
public void run() {
|
||||
getReflectionManager().synchronizeAll();
|
||||
}//run()//
|
||||
}, (EmailAddress) selection);
|
||||
}//if//
|
||||
else if(selection instanceof StreetAddress) {
|
||||
editor = new StreetAddressEditorViewController(getContext(), new Runnable() {
|
||||
public void run() {
|
||||
getReflectionManager().synchronizeAll();
|
||||
}//run()//
|
||||
}, (StreetAddress) selection);
|
||||
}//else if//
|
||||
|
||||
setEditor(editor);
|
||||
}//setupEditor()//
|
||||
/**
|
||||
* Gets the color associated with the given object.
|
||||
* @param object The object for which a color will be generated.
|
||||
* @return The object's color.
|
||||
*/
|
||||
public JefColor getObjectColor(Object object) {
|
||||
return new JefColor((object.hashCode() & 0xFF), (object.hashCode() & 0xFF00) >> 8, 255 - ((object.hashCode() & 0xFF00) >> 8));
|
||||
}//getObjectColor()//
|
||||
}//ComboPageViewController//
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.ContactEditorView;
|
||||
import test.model.Contact;
|
||||
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.view.IViewContext;
|
||||
|
||||
public class ContactEditorViewController extends AbstractViewController {
|
||||
public static final Attribute CONTACT = registerAttribute(ContactEditorViewController.class, "contact");
|
||||
private Runnable changeListener;
|
||||
/**
|
||||
* ContactEditorViewController constructor.
|
||||
* @param context The context underwhich the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
* @param changeListener The optional listener called when changes are applied to the contact.
|
||||
* @param contact The edited contact.
|
||||
*/
|
||||
public ContactEditorViewController(IViewContext context, Runnable changeListener, Contact contact) {
|
||||
super(context);
|
||||
this.changeListener = changeListener;
|
||||
setContact((Contact) getReflectionManager().createReflection(contact));
|
||||
}//ContactEditorViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return ContactEditorView.class;
|
||||
}//getViewClass()//
|
||||
/**
|
||||
* Applies changes to the contact.
|
||||
*/
|
||||
public void doApply() {
|
||||
synchronize();
|
||||
getReflectionManager().synchronizeAll();
|
||||
|
||||
if(changeListener != null) {
|
||||
changeListener.run();
|
||||
}//if//
|
||||
}//doApply()//
|
||||
/**
|
||||
* Rejects changes to the contact.
|
||||
*/
|
||||
public void doCancel() {
|
||||
synchronize();
|
||||
getContact().reverseObjectChanges();
|
||||
}//doCancel()//
|
||||
/**
|
||||
* Gets the contact being edited.
|
||||
* @return The edited contact.
|
||||
*/
|
||||
public Contact getContact() {
|
||||
return (Contact) getAttributeValue(CONTACT);
|
||||
}//getContact()//
|
||||
/**
|
||||
* Sets the contact being edited.
|
||||
* @param contact The edited contact.
|
||||
*/
|
||||
private void setContact(Contact contact) {
|
||||
setAttributeValue(CONTACT, contact);
|
||||
}//getContact()//
|
||||
}//ContactEditorViewController//
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.EmailAddressEditorView;
|
||||
import test.model.EmailAddress;
|
||||
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.view.IViewContext;
|
||||
|
||||
public class EmailAddressEditorViewController extends AbstractViewController {
|
||||
public static final Attribute EMAIL_ADDRESS = registerAttribute(EmailAddressEditorViewController.class, "emailAddress");
|
||||
private Runnable changeListener;
|
||||
/**
|
||||
* EmailAddressEditorViewController constructor.
|
||||
* @param context The context underwhich the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
* @param changeListener The optional listener called when changes are applied to the email address.
|
||||
* @param emailAddress The edited email address.
|
||||
*/
|
||||
public EmailAddressEditorViewController(IViewContext context, Runnable changeListener, EmailAddress emailAddress) {
|
||||
super(context);
|
||||
this.changeListener = changeListener;
|
||||
setEmailAddress((EmailAddress) getReflectionManager().createReflection(emailAddress));
|
||||
}//EmailAddressEditorViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return EmailAddressEditorView.class;
|
||||
}//getViewClass()//
|
||||
/**
|
||||
* Applies changes to the email address.
|
||||
*/
|
||||
public void doApply() {
|
||||
synchronize();
|
||||
getReflectionManager().synchronizeAll();
|
||||
|
||||
if(changeListener != null) {
|
||||
changeListener.run();
|
||||
}//if//
|
||||
}//doApply()//
|
||||
/**
|
||||
* Rejects changes to the email address.
|
||||
*/
|
||||
public void doCancel() {
|
||||
synchronize();
|
||||
getEmailAddress().reverseObjectChanges();
|
||||
}//doCancel()//
|
||||
/**
|
||||
* Gets the emailAddress being edited.
|
||||
* @return The edited emailAddress.
|
||||
*/
|
||||
public EmailAddress getEmailAddress() {
|
||||
return (EmailAddress) getAttributeValue(EMAIL_ADDRESS);
|
||||
}//getEmailAddress()//
|
||||
/**
|
||||
* Sets the emailAddress being edited.
|
||||
* @param emailAddress The edited emailAddress.
|
||||
*/
|
||||
private void setEmailAddress(EmailAddress emailAddress) {
|
||||
setAttributeValue(EMAIL_ADDRESS, emailAddress);
|
||||
}//getEmailAddress()//
|
||||
}//EmailAddressEditorViewController//
|
||||
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* Copyright (c) 2005,2009 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.EnhancedListPageView;
|
||||
import test.model.Project;
|
||||
|
||||
import com.common.debug.Debug;
|
||||
import com.foundation.controller.ViewController;
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.util.IManagedList;
|
||||
import com.foundation.view.IViewContext;
|
||||
import com.foundation.view.ImageDecoration;
|
||||
import com.foundation.view.JefColor;
|
||||
import com.foundation.view.resource.ResourceReference;
|
||||
|
||||
public class EnhancedListPageViewController extends AbstractViewController {
|
||||
public static final ResourceReference[] IMAGES = new ResourceReference[] {new ResourceReference("res://package/group/accept"), new ResourceReference("res://package/group/reject")};
|
||||
|
||||
public static final Attribute PROJECTS = registerCollection(EnhancedListPageViewController.class, "projects", AO_REFERENCED);
|
||||
public static final Attribute EDITOR = registerAttribute(EnhancedListPageViewController.class, "editor", AO_REFERENCED);
|
||||
public static final Attribute SELECTION = registerAttribute(EnhancedListPageViewController.class, "selection", AO_REFERENCED);
|
||||
/**
|
||||
* ListPageViewController constructor.
|
||||
* @param context The context underwhich the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
* @param projects The collection of displayed projects.
|
||||
*/
|
||||
public EnhancedListPageViewController(IViewContext context, IManagedList projects) {
|
||||
super(context);
|
||||
|
||||
setProjects((IManagedList) getReflectionManager().createReflection(projects));
|
||||
}//ListPageViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.common.Entity#lazyLoadAttribute(com.foundation.metadata.Attribute)
|
||||
*/
|
||||
protected Object lazyLoadAttribute(Attribute attribute) {
|
||||
Object result = null;
|
||||
|
||||
result = super.lazyLoadAttribute(attribute);
|
||||
|
||||
return result;
|
||||
}//lazyLoadAttribute()//
|
||||
/* (non-Javadoc)
|
||||
* @see test.local.view.controller.AbstractViewController#validate()
|
||||
*/
|
||||
public boolean validate() {
|
||||
getDecorationManager().clearDecorations(null, null);
|
||||
Project project = (Project) getProjects().getFirst();
|
||||
|
||||
if(project != null) {
|
||||
getDecorationManager().addDecoration(project, null, new ImageDecoration(new ResourceReference("res://View/ProjectEditor/ErrorOverlay")));
|
||||
}//if//
|
||||
|
||||
getDecorationManager().applyDecorationChanges();
|
||||
|
||||
return super.validate();
|
||||
}//validate()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return EnhancedListPageView.class;
|
||||
}//getViewClass()//
|
||||
public void doSomething() {
|
||||
Debug.log("EnhancedList Menu Selected");
|
||||
}//doSomething()//
|
||||
/**
|
||||
* Gets the collection of projects displayed in the collection.
|
||||
* @return The projects.
|
||||
*/
|
||||
public IManagedList getProjects() {
|
||||
return (IManagedList) getAttributeValue(PROJECTS);
|
||||
}//getProjects()//
|
||||
/**
|
||||
* Sets the collection of projects displayed in the collection.
|
||||
* @param projects The projects.
|
||||
*/
|
||||
private void setProjects(IManagedList projects) {
|
||||
setAttributeValue(PROJECTS, projects);
|
||||
}//setProjects()//
|
||||
/**
|
||||
* Gets an image to display for the given project.
|
||||
* @param project The project whose image is to be found.
|
||||
* @return The project's image or resource to the image.
|
||||
*/
|
||||
public Object getImage(Project project) {
|
||||
return IMAGES[project.hashCode() % IMAGES.length];
|
||||
}//getImage()//
|
||||
/**
|
||||
* Gets the editor displayed under the collection.
|
||||
* @return The editor or null if no editor is visible.
|
||||
*/
|
||||
public ViewController getEditor() {
|
||||
return (ViewController) getAttributeValue(EDITOR);
|
||||
}//getEditor()//
|
||||
/**
|
||||
* Sets the editor displayed under the collection.
|
||||
* @param editor The editor or null if no editor is visible.
|
||||
*/
|
||||
private void setEditor(ViewController editor) {
|
||||
setAttributeValue(EDITOR, editor);
|
||||
}//setEditor()//
|
||||
/**
|
||||
* Gets the collection selection.
|
||||
* @return The selected object in the collection.
|
||||
*/
|
||||
public Object getSelection() {
|
||||
return (Object) getAttributeValue(SELECTION);
|
||||
}//getSelection()//
|
||||
/**
|
||||
* Sets the collection selection.
|
||||
* @param selection The selected object in the collection.
|
||||
*/
|
||||
public void setSelection(Object selection) {
|
||||
if(getSelection() != selection) {
|
||||
setAttributeValue(SELECTION, selection);
|
||||
setupEditor(selection);
|
||||
}//if//
|
||||
}//setSelection()//
|
||||
/**
|
||||
* Sets up the editor for the given selection.
|
||||
* @param selection The selection whose editor must be setup.
|
||||
*/
|
||||
private void setupEditor(Object selection) {
|
||||
ViewController editor = null;
|
||||
|
||||
if(selection != null) {
|
||||
editor = new ProjectEditorViewController(getContext(), new Runnable() {
|
||||
public void run() {
|
||||
getReflectionManager().synchronizeAll();
|
||||
}//run()//
|
||||
}, (Project) selection);
|
||||
}//if//
|
||||
|
||||
setEditor(editor);
|
||||
}//setupEditor()//
|
||||
/**
|
||||
* Gets the color associated with the given object.
|
||||
* @param object The object for which a color will be generated.
|
||||
* @return The object's color.
|
||||
*/
|
||||
public JefColor getObjectColor(Object object) {
|
||||
return new JefColor((object.hashCode() & 0xFF), (object.hashCode() & 0xFF00) >> 8, 255 - (object.hashCode() & 0xFF));
|
||||
}//getObjectColor()//
|
||||
}//ListPageViewController//
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (c) 2009 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.EnhancedListPerformanceTestView;
|
||||
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.util.IManagedList;
|
||||
import com.foundation.view.IViewContext;
|
||||
import com.foundation.view.ImageDecoration;
|
||||
|
||||
public class EnhancedListPerformanceTestViewController extends AbstractViewController {
|
||||
public static final Attribute COLLECTION = registerCollection(EnhancedListPerformanceTestViewController.class, "collection", AO_REFERENCED);
|
||||
/**
|
||||
* EnhancedListPerformanceTestViewController constructor.
|
||||
* @param context The context under which the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
*/
|
||||
public EnhancedListPerformanceTestViewController(IViewContext context, IManagedList collection, boolean reflect) {
|
||||
super(context, true);
|
||||
|
||||
if(reflect) {
|
||||
setCollection((IManagedList) getReflectionManager().createReflection(collection));
|
||||
}//if//
|
||||
else {
|
||||
setCollection(collection);
|
||||
}//else//
|
||||
}//EnhancedListPerformanceTestViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return EnhancedListPerformanceTestView.class;
|
||||
}//getViewClass()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.declarativeengineering.jetson.view.controller.AbstractViewController#validate()
|
||||
*/
|
||||
public boolean validate() {
|
||||
getDecorationManager().clearDecorations();
|
||||
|
||||
if(getCollection().getSize() > 0) {
|
||||
getDecorationManager().addDecoration(getCollection().getFirst(), null, new ImageDecoration("res://View/ProjectEditor/ErrorOverlay"));
|
||||
}//if//
|
||||
|
||||
getDecorationManager().applyDecorationChanges();
|
||||
|
||||
return false;
|
||||
}//validate()//
|
||||
/**
|
||||
* Gets the collection value.
|
||||
* @return The collection value.
|
||||
*/
|
||||
public IManagedList getCollection() {
|
||||
return (IManagedList) getAttributeValue(COLLECTION);
|
||||
}//getCollection()//
|
||||
/**
|
||||
* Sets the collection value.
|
||||
* @param collection The collection value.
|
||||
*/
|
||||
private void setCollection(IManagedList collection) {
|
||||
setAttributeValue(COLLECTION, collection);
|
||||
}//setCollection()//
|
||||
}//EnhancedListPerformanceTestViewController//
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2005,2007 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.ExpandBarPageView;
|
||||
import com.foundation.view.IViewContext;
|
||||
|
||||
public class ExpandBarPageViewController extends AbstractViewController {
|
||||
/**
|
||||
* ExpandBarPageViewController constructor.
|
||||
* @param context
|
||||
*/
|
||||
public ExpandBarPageViewController(IViewContext context) {
|
||||
super(context);
|
||||
}//ExpandBarPageViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return ExpandBarPageView.class;
|
||||
}//getViewClass()//
|
||||
}//ExpandBarPageViewController//
|
||||
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* Copyright (c) 2005,2006 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
|
||||
import test.local.view.ImagePageView;
|
||||
|
||||
import com.common.debug.Debug;
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.view.IViewContext;
|
||||
import com.foundation.view.JefImage;
|
||||
import com.foundation.view.swt.FileDialog;
|
||||
import com.foundation.view.swt.SwtViewContext;
|
||||
import com.foundation.view.swt.util.SwtUtilities;
|
||||
|
||||
public class ImagePageViewController extends AbstractViewController {
|
||||
public static final Attribute TEST_IMAGE = registerAttribute(ImagePageViewController.class, "testImage");
|
||||
/**
|
||||
* TestViewController constructor.
|
||||
* @param context
|
||||
*/
|
||||
public ImagePageViewController(IViewContext context) {
|
||||
super(context);
|
||||
}//TestViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.common.Entity#lazyLoadAttribute(com.foundation.metadata.Attribute)
|
||||
*/
|
||||
protected Object lazyLoadAttribute(Attribute attribute) {
|
||||
Object result = null;
|
||||
|
||||
result = super.lazyLoadAttribute(attribute);
|
||||
|
||||
return result;
|
||||
}//lazyLoadAttribute()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return ImagePageView.class;
|
||||
}//getViewClass()//
|
||||
/**
|
||||
* Uploads an image.
|
||||
*/
|
||||
public void doUploadImage() {
|
||||
FileDialog dialog = new FileDialog(getView(), FileDialog.STYLE_OPEN);
|
||||
String fileName = null;
|
||||
|
||||
dialog.setFilterExtensions(new String[] {"*.jpg", "*.jpeg", "*.gif", "*.bmp", "*.tiff", "*.png", "*.ico"});
|
||||
fileName = dialog.open();
|
||||
|
||||
if(fileName != null) {
|
||||
File file = new File(fileName);
|
||||
|
||||
if(file.exists() && file.canRead()) {
|
||||
try {
|
||||
FileInputStream fin = new FileInputStream(file);
|
||||
byte[] bytes = new byte[fin.available()];
|
||||
int readCount = 0;
|
||||
|
||||
while(readCount < bytes.length) {
|
||||
readCount += fin.read(bytes, readCount, bytes.length - readCount);
|
||||
}//while//
|
||||
|
||||
setTestImage(new JefImage(bytes));
|
||||
}//try//
|
||||
catch(Throwable e) {
|
||||
Debug.log(e);
|
||||
}//catch//
|
||||
}//if//
|
||||
else {
|
||||
//TODO: Report the error.
|
||||
}//else//
|
||||
}//if//
|
||||
}//doUploadImage()//
|
||||
/**
|
||||
* Downloads an image.
|
||||
*/
|
||||
public void doDownloadImage() {
|
||||
if(getTestImage() != null) {
|
||||
String extension = null;
|
||||
Image image = SwtUtilities.getImage(SwtViewContext.getSingleton().getDisplay(), getTestImage());
|
||||
FileDialog dialog = new FileDialog(getView(), FileDialog.STYLE_SAVE);
|
||||
String fileName = null;
|
||||
|
||||
//Determine the correct extension for the image.//
|
||||
switch(image.getImageData().type) {
|
||||
case SWT.IMAGE_BMP:
|
||||
case SWT.IMAGE_OS2_BMP:
|
||||
case SWT.IMAGE_BMP_RLE:
|
||||
extension = ".bmp";
|
||||
break;
|
||||
case SWT.IMAGE_GIF:
|
||||
extension = ".gif";
|
||||
break;
|
||||
case SWT.IMAGE_ICO:
|
||||
extension = ".ico";
|
||||
break;
|
||||
case SWT.IMAGE_JPEG:
|
||||
extension = ".jpg";
|
||||
break;
|
||||
case SWT.IMAGE_PNG:
|
||||
extension = ".png";
|
||||
break;
|
||||
case SWT.IMAGE_TIFF:
|
||||
extension = ".tiff";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
//Dispose of the image so we regain the resources.//
|
||||
image.dispose();
|
||||
dialog.setFileName("image" + extension);
|
||||
fileName = dialog.open();
|
||||
|
||||
if(fileName != null) {
|
||||
File file = new File(fileName);
|
||||
|
||||
if(file.exists()) {
|
||||
//TODO: Request confirmation.
|
||||
|
||||
if(!file.delete()) {
|
||||
//TODO: Report error.
|
||||
}//if//
|
||||
}//if//
|
||||
|
||||
if(!file.mkdirs()) {
|
||||
//TODO: Report error.
|
||||
}//if//
|
||||
|
||||
if(!file.exists() && file.canWrite()) {
|
||||
try {
|
||||
FileOutputStream fout = new FileOutputStream(file);
|
||||
|
||||
fout.write(getTestImage().getImageData());
|
||||
}//try//
|
||||
catch(Throwable e) {
|
||||
Debug.log(e);
|
||||
}//catch//
|
||||
}//if//
|
||||
else {
|
||||
//TODO: Report the error.
|
||||
}//else//
|
||||
}//if//
|
||||
}//if//
|
||||
}//doDownloadImage()//
|
||||
/**
|
||||
* Gets a test image.
|
||||
* @return The image.
|
||||
*/
|
||||
public JefImage getTestImage() {
|
||||
return (JefImage) getAttributeValue(TEST_IMAGE);
|
||||
}//getTestImage()//
|
||||
/**
|
||||
* Sets a test image.
|
||||
* @param testImage The image.
|
||||
*/
|
||||
public void setTestImage(JefImage testImage) {
|
||||
setAttributeValue(TEST_IMAGE, testImage);
|
||||
}//setTestImage()//
|
||||
}//TestViewController//
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2005,2006 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.InnerViewPageView;
|
||||
|
||||
import com.foundation.controller.ViewController;
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.view.IViewContext;
|
||||
|
||||
public class InnerViewPageViewController extends AbstractViewController {
|
||||
public static final Attribute INNER_VIEW = registerAttribute(InnerViewPageViewController.class, "innerView", AO_LAZY);
|
||||
/**
|
||||
* InnerViewPageViewController constructor.
|
||||
* @param context
|
||||
*/
|
||||
public InnerViewPageViewController(IViewContext context) {
|
||||
super(context);
|
||||
}//InnerViewPageViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.common.Entity#lazyLoadAttribute(com.foundation.metadata.Attribute)
|
||||
*/
|
||||
protected Object lazyLoadAttribute(Attribute attribute) {
|
||||
Object result = null;
|
||||
|
||||
if(attribute == INNER_VIEW) {
|
||||
result = new SampleInnerViewController(getContext());
|
||||
}//if//
|
||||
else {
|
||||
result = super.lazyLoadAttribute(attribute);
|
||||
}//else//
|
||||
|
||||
return result;
|
||||
}//lazyLoadAttribute()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return InnerViewPageView.class;
|
||||
}//getViewClass()//
|
||||
/**
|
||||
* Gets the inner view's controller.
|
||||
* @return The controller for the inner view.
|
||||
*/
|
||||
public ViewController getInnerView() {
|
||||
return (ViewController) getAttributeValue(INNER_VIEW);
|
||||
}//getInnerView()//
|
||||
}//InnerViewPageViewController//
|
||||
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* Copyright (c) 2005,2006 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.ListPageView;
|
||||
import test.model.Project;
|
||||
|
||||
import com.foundation.controller.ViewController;
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.util.IManagedList;
|
||||
import com.foundation.view.IViewContext;
|
||||
import com.foundation.view.JefColor;
|
||||
|
||||
public class ListPageViewController extends AbstractViewController {
|
||||
public static final Attribute PROJECTS = registerCollection(ListPageViewController.class, "projects", AO_REFERENCED);
|
||||
public static final Attribute EDITOR = registerAttribute(ListPageViewController.class, "editor", AO_REFERENCED);
|
||||
public static final Attribute SELECTION = registerAttribute(ListPageViewController.class, "selection", AO_REFERENCED);
|
||||
/**
|
||||
* ListPageViewController constructor.
|
||||
* @param context The context underwhich the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
* @param projects The collection of displayed projects.
|
||||
*/
|
||||
public ListPageViewController(IViewContext context, IManagedList projects) {
|
||||
super(context);
|
||||
|
||||
setProjects((IManagedList) getReflectionManager().createReflection(projects));
|
||||
}//ListPageViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.common.Entity#lazyLoadAttribute(com.foundation.metadata.Attribute)
|
||||
*/
|
||||
protected Object lazyLoadAttribute(Attribute attribute) {
|
||||
Object result = null;
|
||||
|
||||
result = super.lazyLoadAttribute(attribute);
|
||||
|
||||
return result;
|
||||
}//lazyLoadAttribute()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return ListPageView.class;
|
||||
}//getViewClass()//
|
||||
/**
|
||||
* Gets the collection of projects displayed in the collection.
|
||||
* @return The projects.
|
||||
*/
|
||||
public IManagedList getProjects() {
|
||||
return (IManagedList) getAttributeValue(PROJECTS);
|
||||
}//getProjects()//
|
||||
/**
|
||||
* Sets the collection of projects displayed in the collection.
|
||||
* @param projects The projects.
|
||||
*/
|
||||
private void setProjects(IManagedList projects) {
|
||||
setAttributeValue(PROJECTS, projects);
|
||||
}//setProjects()//
|
||||
/**
|
||||
* Gets the editor displayed under the collection.
|
||||
* @return The editor or null if no editor is visible.
|
||||
*/
|
||||
public ViewController getEditor() {
|
||||
return (ViewController) getAttributeValue(EDITOR);
|
||||
}//getEditor()//
|
||||
/**
|
||||
* Sets the editor displayed under the collection.
|
||||
* @param editor The editor or null if no editor is visible.
|
||||
*/
|
||||
private void setEditor(ViewController editor) {
|
||||
setAttributeValue(EDITOR, editor);
|
||||
}//setEditor()//
|
||||
/**
|
||||
* Gets the collection selection.
|
||||
* @return The selected object in the collection.
|
||||
*/
|
||||
public Object getSelection() {
|
||||
return (Object) getAttributeValue(SELECTION);
|
||||
}//getSelection()//
|
||||
/**
|
||||
* Sets the collection selection.
|
||||
* @param selection The selected object in the collection.
|
||||
*/
|
||||
public void setSelection(Object selection) {
|
||||
if(getSelection() != selection) {
|
||||
setAttributeValue(SELECTION, selection);
|
||||
setupEditor(selection);
|
||||
}//if//
|
||||
}//setSelection()//
|
||||
/**
|
||||
* Sets up the editor for the given selection.
|
||||
* @param selection The selection whose editor must be setup.
|
||||
*/
|
||||
private void setupEditor(Object selection) {
|
||||
ViewController editor = null;
|
||||
|
||||
if(selection != null) {
|
||||
editor = new ProjectEditorViewController(getContext(), new Runnable() {
|
||||
public void run() {
|
||||
getReflectionManager().synchronizeAll();
|
||||
}//run()//
|
||||
}, (Project) selection);
|
||||
}//if//
|
||||
|
||||
setEditor(editor);
|
||||
}//setupEditor()//
|
||||
/**
|
||||
* Gets the color associated with the given object.
|
||||
* @param object The object for which a color will be generated.
|
||||
* @return The object's color.
|
||||
*/
|
||||
public JefColor getObjectColor(Object object) {
|
||||
return new JefColor((object.hashCode() & 0xFF), (object.hashCode() & 0xFF00) >> 8, 255 - (object.hashCode() & 0xFF));
|
||||
}//getObjectColor()//
|
||||
}//ListPageViewController//
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 2009 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.ListPerformanceTestView;
|
||||
|
||||
import com.foundation.util.IManagedList;
|
||||
import com.foundation.view.IViewContext;
|
||||
import com.foundation.metadata.Attribute;
|
||||
|
||||
public class ListPerformanceTestViewController extends AbstractViewController {
|
||||
public static final Attribute COLLECTION = registerCollection(ListPerformanceTestViewController.class, "collection", AO_REFERENCED);
|
||||
/**
|
||||
* ListPerformanceTestViewController constructor.
|
||||
* @param context The context under which the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
*/
|
||||
public ListPerformanceTestViewController(IViewContext context, IManagedList collection, boolean reflect) {
|
||||
super(context, false);
|
||||
|
||||
if(reflect) {
|
||||
setCollection((IManagedList) getReflectionManager().createReflection(collection));
|
||||
}//if//
|
||||
else {
|
||||
setCollection(collection);
|
||||
}//else//
|
||||
}//ListPerformanceTestViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return ListPerformanceTestView.class;
|
||||
}//getViewClass()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.declarativeengineering.jetson.view.controller.AbstractViewController#validate()
|
||||
*/
|
||||
public boolean validate() {
|
||||
return true;
|
||||
}//validate()//
|
||||
/**
|
||||
* Gets the collection value.
|
||||
* @return The collection value.
|
||||
*/
|
||||
public IManagedList getCollection() {
|
||||
return (IManagedList) getAttributeValue(COLLECTION);
|
||||
}//getCollection()//
|
||||
/**
|
||||
* Sets the collection value.
|
||||
* @param collection The collection value.
|
||||
*/
|
||||
private void setCollection(IManagedList collection) {
|
||||
setAttributeValue(COLLECTION, collection);
|
||||
}//setCollection()//
|
||||
}//ListPerformanceTestViewController//
|
||||
@@ -0,0 +1,416 @@
|
||||
/*
|
||||
* Copyright (c) 2005,2009 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import test.application.TestViewApplication;
|
||||
import test.local.view.MainView;
|
||||
import test.model.Contact;
|
||||
import test.model.EmailAddress;
|
||||
import test.model.Priority;
|
||||
import test.model.Project;
|
||||
import test.model.StreetAddress;
|
||||
import test.model.Team;
|
||||
|
||||
import com.common.debug.Debug;
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.util.IManagedList;
|
||||
import com.foundation.util.ManagedList;
|
||||
import com.foundation.view.IView;
|
||||
import com.foundation.view.IViewContext;
|
||||
|
||||
public class MainViewController extends AbstractViewController {
|
||||
private static final String[] COLLECTION_TESTS = {"List", "EnhancedList", "Table"};
|
||||
|
||||
public static final Attribute TAB_VIEW_CONTROLLERS = registerCollection(MainViewController.class, "tabViewControllers", AO_LAZY);
|
||||
public static final Attribute CONTACTS = registerCollection(MainViewController.class, "contacts", AO_LAZY);
|
||||
public static final Attribute PROJECTS = registerCollection(MainViewController.class, "projects", AO_LAZY);
|
||||
public static final Attribute PRIORITIES = registerCollection(MainViewController.class, "priorities", AO_LAZY);
|
||||
public static final Attribute TEAMS = registerCollection(MainViewController.class, "teams", AO_LAZY);
|
||||
public static final Attribute TRAY = registerAttribute(MainViewController.class, "tray");
|
||||
public static final Attribute NULL_ATTRIBUTE = registerAttribute(MainViewController.class, "nullAttribute");
|
||||
public static final Attribute NON_NULL_ATTRIBUTE = registerAttribute(MainViewController.class, "nonNullAttribute");
|
||||
public static final Attribute TESTS = registerAttribute(MainViewController.class, "tests", COLLECTION_TESTS);
|
||||
public static final Attribute SELECTED_TEST = registerAttribute(MainViewController.class, "selectedTest");
|
||||
public static final Attribute TEST_ROW_COUNT = registerAttribute(MainViewController.class, "testRowCount", new Integer(100));
|
||||
public static final Attribute TEST_CONTROLLER = registerAttribute(MainViewController.class, "testController");
|
||||
|
||||
public static final Priority HIGH_PRIORITY = new Priority("High");
|
||||
public static final Priority MEDIUM_PRIORITY = new Priority("Medium");
|
||||
public static final Priority LOW_PRIORITY = new Priority("Low");
|
||||
/**
|
||||
* MainViewController constructor.
|
||||
* @param context
|
||||
*/
|
||||
public MainViewController(IViewContext context) {
|
||||
super(context);
|
||||
setNullAttribute(null);
|
||||
setNonNullAttribute("Bla");
|
||||
}//MainViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#postOpenInitialization(com.foundation.view.IView)
|
||||
*/
|
||||
protected void postOpenInitialization(IView view) {
|
||||
super.postOpenInitialization(view);
|
||||
setTray(new TrayController(getContext()));
|
||||
getTray().open();
|
||||
}//postOpenInitialization()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#preClose()
|
||||
*/
|
||||
protected void preClose() {
|
||||
getTray().close();
|
||||
setTray(null);
|
||||
super.preClose();
|
||||
}//preClose()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.common.Entity#lazyLoadAttribute(com.foundation.metadata.Attribute)
|
||||
*/
|
||||
protected Object lazyLoadAttribute(Attribute attribute) {
|
||||
Object result = null;
|
||||
|
||||
if(attribute == TAB_VIEW_CONTROLLERS) {
|
||||
result = new ManagedList(new Object[] {
|
||||
new TextPageViewController(getContext()),
|
||||
new ImagePageViewController(getContext()),
|
||||
new InnerViewPageViewController(getContext()),
|
||||
new StyledTextPageViewController(getContext()),
|
||||
new ToolBarPageViewController(getContext()),
|
||||
// new TablePageViewController(getContext(), getProjects(), getPriorities()),
|
||||
new TableEditorPageViewController(getContext()),
|
||||
// new TreePageViewController(getContext(), getProjects(), getPriorities()),
|
||||
// new TeamViewController(getContext(), getTeams()),
|
||||
// new ComboPageViewController(getContext(), getProjects()),
|
||||
// new ListPageViewController(getContext(), getProjects()),
|
||||
// new EnhancedListPageViewController(getContext(), getProjects()),
|
||||
new ExpandBarPageViewController(getContext())
|
||||
});
|
||||
}//if//
|
||||
else if(attribute == PRIORITIES) {
|
||||
result = new ManagedList(new Object[] {HIGH_PRIORITY, MEDIUM_PRIORITY, LOW_PRIORITY});
|
||||
}//else if//
|
||||
else if(attribute == TEAMS) {
|
||||
ManagedList list = new ManagedList(10, 20);
|
||||
Team t1 = new Team();
|
||||
Team t2 = new Team();
|
||||
IManagedList projects = getProjects();
|
||||
|
||||
t1.setName("Blue Team");
|
||||
t2.setName("Red Team");
|
||||
|
||||
//Put the first half the projects in team 1 and the other half in team 2.//
|
||||
for(int index = 0; index < projects.getSize(); index++) {
|
||||
if(index < projects.getSize() / 2) {
|
||||
t1.getProjects().add(projects.get(index));
|
||||
}//if//
|
||||
else {
|
||||
t2.getProjects().add(projects.get(index));
|
||||
}//else//
|
||||
}//for//
|
||||
|
||||
list.add(t1);
|
||||
list.add(t2);
|
||||
result = list;
|
||||
}//else if//
|
||||
else if(attribute == CONTACTS) {
|
||||
ManagedList list = new ManagedList(10);
|
||||
Contact c1 = new Contact();
|
||||
Contact c2 = new Contact();
|
||||
Contact c3 = new Contact();
|
||||
EmailAddress e1 = new EmailAddress();
|
||||
EmailAddress e2 = new EmailAddress();
|
||||
EmailAddress e3 = new EmailAddress();
|
||||
StreetAddress s1 = new StreetAddress();
|
||||
StreetAddress s2 = new StreetAddress();
|
||||
|
||||
c1.setName("Fred");
|
||||
c2.setName("Linda");
|
||||
c3.setName("George");
|
||||
|
||||
e1.setName("Home");
|
||||
e1.setEmail("fred@aol.com");
|
||||
e2.setName("Work");
|
||||
e2.setEmail("fred@cheesecakefactory.com");
|
||||
s1.setName("Home");
|
||||
s1.setLine("123 Filbert Way");
|
||||
|
||||
e3.setName("Home");
|
||||
e3.setEmail("Linda@lindas.us");
|
||||
s2.setName("Work");
|
||||
s2.setLine("14 S. Street");
|
||||
|
||||
c1.getAddresses().add(e1);
|
||||
c1.getAddresses().add(s1);
|
||||
c1.getAddresses().add(e2);
|
||||
c2.getAddresses().add(s2);
|
||||
c2.getAddresses().add(e3);
|
||||
|
||||
list.add(c1);
|
||||
list.add(c2);
|
||||
list.add(c3);
|
||||
result = list;
|
||||
}//else if//
|
||||
else if(attribute == PROJECTS) {
|
||||
ManagedList list = new ManagedList(10);
|
||||
Project p1 = new Project();
|
||||
Project p2 = new Project();
|
||||
Project p3 = new Project();
|
||||
Project p4 = new Project();
|
||||
Project p5 = new Project();
|
||||
Project p6 = new Project();
|
||||
|
||||
p1.setName("Project 1");
|
||||
p2.setName("Project 2");
|
||||
p3.setName("Project 3");
|
||||
p4.setName("Project 4");
|
||||
p5.setName("Project 5");
|
||||
p6.setName("Project 6");
|
||||
|
||||
p1.setPriority(HIGH_PRIORITY);
|
||||
p2.setPriority(MEDIUM_PRIORITY);
|
||||
p3.setPriority(HIGH_PRIORITY);
|
||||
p4.setPriority(HIGH_PRIORITY);
|
||||
p5.setPriority(LOW_PRIORITY);
|
||||
p6.setPriority(LOW_PRIORITY);
|
||||
|
||||
p1.getContacts().add(getContacts().get(0));
|
||||
p1.getContacts().add(getContacts().get(2));
|
||||
p2.getContacts().add(getContacts().get(0));
|
||||
p2.getContacts().add(getContacts().get(1));
|
||||
p3.getContacts().add(getContacts().get(1));
|
||||
p3.getContacts().add(getContacts().get(2));
|
||||
|
||||
p1.getRecentNotes().add("Note 1");
|
||||
p1.getRecentNotes().add("Note 2");
|
||||
p1.getRecentNotes().add("Note 3");
|
||||
p1.setNote("Note 1");
|
||||
p1.setProgress(new BigDecimal("0"));
|
||||
p2.getRecentNotes().add("This project stinks..");
|
||||
p2.getRecentNotes().add("This project is acceptable..");
|
||||
p2.getRecentNotes().add("This project rocks..");
|
||||
p2.setNote("A custom note.");
|
||||
p2.setProgress(new BigDecimal(".10"));
|
||||
p3.getRecentNotes().add("In Progress");
|
||||
p3.getRecentNotes().add("Idle");
|
||||
p3.getRecentNotes().add("Completed");
|
||||
p3.setNote("Completed");
|
||||
p3.setProgress(new BigDecimal("1.00"));
|
||||
p4.getRecentNotes().add("In Progress");
|
||||
p4.getRecentNotes().add("Idle");
|
||||
p4.getRecentNotes().add("In Progress");
|
||||
p4.setNote("In Progress");
|
||||
p4.setProgress(new BigDecimal(".55"));
|
||||
p5.getRecentNotes().add("In Progress");
|
||||
p5.getRecentNotes().add("Idle");
|
||||
p5.getRecentNotes().add("Completed");
|
||||
p5.setNote("Completed");
|
||||
p5.setProgress(new BigDecimal("1.00"));
|
||||
p6.getRecentNotes().add("In Progress");
|
||||
p6.setNote("In Progress");
|
||||
p6.setProgress(new BigDecimal(".20"));
|
||||
|
||||
list.add(p1);
|
||||
list.add(p2);
|
||||
list.add(p3);
|
||||
list.add(p4);
|
||||
list.add(p5);
|
||||
list.add(p6);
|
||||
result = list;
|
||||
}//else if//
|
||||
else {
|
||||
result = super.lazyLoadAttribute(attribute);
|
||||
}//else//
|
||||
|
||||
return result;
|
||||
}//lazyLoadAttribute()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return MainView.class;
|
||||
}//getViewClass()//
|
||||
/**
|
||||
* Gets the projects.
|
||||
* @return The collection of project instances.
|
||||
*/
|
||||
public IManagedList getProjects() {
|
||||
return (IManagedList) getAttributeValue(PROJECTS);
|
||||
}//getProjects()//
|
||||
/**
|
||||
* Gets the priorities possible for the projects.
|
||||
* @return The collection of priority instances.
|
||||
*/
|
||||
public IManagedList getPriorities() {
|
||||
return (IManagedList) getAttributeValue(PRIORITIES);
|
||||
}//getPriorities()//
|
||||
/**
|
||||
* Gets the contacts.
|
||||
* @return The collection of contact instances.
|
||||
*/
|
||||
public IManagedList getContacts() {
|
||||
return (IManagedList) getAttributeValue(CONTACTS);
|
||||
}//getContacts()//
|
||||
/**
|
||||
* Closes the view.
|
||||
*/
|
||||
public void doClose() {
|
||||
close();
|
||||
((TestViewApplication) getApplication()).shutdown();
|
||||
}//doClose()//
|
||||
/**
|
||||
* Opens a test dialog.
|
||||
*/
|
||||
public void doOpenDialog1() {
|
||||
TestDialog1ViewController controller = new TestDialog1ViewController(getContext());
|
||||
|
||||
controller.open(this);
|
||||
}//doOpenDialog1()//
|
||||
/**
|
||||
* Opens a test dialog.
|
||||
*/
|
||||
public void doOpenDialog2() {
|
||||
TestDialog2ViewController controller = new TestDialog2ViewController(getContext());
|
||||
|
||||
controller.open(this);
|
||||
}//doOpenDialog2()//
|
||||
/**
|
||||
* Displays the selected test type with the given number of rows.
|
||||
*/
|
||||
public void doDisplayTest() {
|
||||
if(getSelectedTest() != null) {
|
||||
String testType = getSelectedTest();
|
||||
int rowCount = getTestRowCount().intValue();
|
||||
ManagedList collection = new ManagedList(rowCount, 20);
|
||||
AbstractViewController controller = null;
|
||||
|
||||
for(int index = 0; index < rowCount; index++) {
|
||||
collection.add(new Project("Test " + index));
|
||||
}//for//
|
||||
|
||||
if(testType == COLLECTION_TESTS[0]) {
|
||||
controller = new ListPerformanceTestViewController(getContext(), collection, false);
|
||||
}//if//
|
||||
else if(testType == COLLECTION_TESTS[1]) {
|
||||
controller = new EnhancedListPerformanceTestViewController(getContext(), collection, false);
|
||||
}//else if//
|
||||
else if(testType == COLLECTION_TESTS[2]) {
|
||||
controller = new TablePerformanceTestViewController(getContext(), collection, false);
|
||||
}//else if//
|
||||
|
||||
long t = System.currentTimeMillis();
|
||||
setTestController(controller);
|
||||
Debug.log("Time to set the test controller: " + (System.currentTimeMillis() - t) + "ms.");
|
||||
}//if//
|
||||
}//doDisplayTest()//
|
||||
/**
|
||||
* Gets the view controllers displayed in the tab panel.
|
||||
* @return The view controllers displayed in the tab panel.
|
||||
*/
|
||||
public IManagedList getTabViewControllers() {
|
||||
return (IManagedList) getAttributeValue(TAB_VIEW_CONTROLLERS);
|
||||
}//getTabViewControllers()//
|
||||
/**
|
||||
* Gets the tray value.
|
||||
* @return The tray value.
|
||||
*/
|
||||
public TrayController getTray() {
|
||||
return (TrayController) getAttributeValue(TRAY);
|
||||
}//getTray()//
|
||||
/**
|
||||
* Sets the tray value.
|
||||
* @param tray The tray value.
|
||||
*/
|
||||
public void setTray(TrayController tray) {
|
||||
setAttributeValue(TRAY, tray);
|
||||
}//setTray()//
|
||||
/**
|
||||
* Gets the nullAttribute value.
|
||||
* @return The nullAttribute value.
|
||||
*/
|
||||
public String getNullAttribute() {
|
||||
return (String) getAttributeValue(NULL_ATTRIBUTE);
|
||||
}//getNullAttribute()//
|
||||
/**
|
||||
* Sets the nullAttribute value.
|
||||
* @param nullAttribute The nullAttribute value.
|
||||
*/
|
||||
public void setNullAttribute(String nullAttribute) {
|
||||
setAttributeValue(NULL_ATTRIBUTE, nullAttribute);
|
||||
}//setNullAttribute()//
|
||||
/**
|
||||
* Gets the nonNullAttribute value.
|
||||
* @return The nonNullAttribute value.
|
||||
*/
|
||||
public String getNonNullAttribute() {
|
||||
return (String) getAttributeValue(NON_NULL_ATTRIBUTE);
|
||||
}//getNonNullAttribute()//
|
||||
/**
|
||||
* Sets the nonNullAttribute value.
|
||||
* @param nonNullAttribute The nonNullAttribute value.
|
||||
*/
|
||||
public void setNonNullAttribute(String nonNullAttribute) {
|
||||
setAttributeValue(NON_NULL_ATTRIBUTE, nonNullAttribute);
|
||||
}//setNonNullAttribute()//
|
||||
/**
|
||||
* Gets the teams value.
|
||||
* @return The teams value.
|
||||
*/
|
||||
public IManagedList getTeams() {
|
||||
return (IManagedList) getAttributeValue(TEAMS);
|
||||
}//getTeams()//
|
||||
/**
|
||||
* Gets the tests.
|
||||
* @return The tests.
|
||||
*/
|
||||
public String[] getTests() {
|
||||
return (String[]) getAttributeValue(TESTS);
|
||||
}//getTests()//
|
||||
/**
|
||||
* Gets the selected test.
|
||||
* @return The selected test.
|
||||
*/
|
||||
public String getSelectedTest() {
|
||||
return (String) getAttributeValue(SELECTED_TEST);
|
||||
}//getSelectedTest()//
|
||||
/**
|
||||
* Sets the selected test.
|
||||
* @param selectedTest The selected test.
|
||||
*/
|
||||
public void setSelectedTest(String selectedTest) {
|
||||
setAttributeValue(SELECTED_TEST, selectedTest);
|
||||
}//setSelectedTest()//
|
||||
/**
|
||||
* Gets the number of test rows.
|
||||
* @return The collection test's row count.
|
||||
*/
|
||||
public Integer getTestRowCount() {
|
||||
return (Integer) getAttributeValue(TEST_ROW_COUNT);
|
||||
}//getTestRowCount()//
|
||||
/**
|
||||
* Sets the number of test rows.
|
||||
* @param testRowCount The collection test's row count.
|
||||
*/
|
||||
public void setTestRowCount(Integer testRowCount) {
|
||||
setAttributeValue(TEST_ROW_COUNT, testRowCount);
|
||||
}//setTestRowCount()//
|
||||
/**
|
||||
* Gets the testController value.
|
||||
* @return The testController value.
|
||||
*/
|
||||
public AbstractViewController getTestController() {
|
||||
return (AbstractViewController) getAttributeValue(TEST_CONTROLLER);
|
||||
}//getTestController()//
|
||||
/**
|
||||
* Sets the testController value.
|
||||
* @param testController The testController value.
|
||||
*/
|
||||
public void setTestController(AbstractViewController testController) {
|
||||
setAttributeValue(TEST_CONTROLLER, testController);
|
||||
}//setTestController()//
|
||||
}//MainViewController//
|
||||
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Copyright (c) 2006,2007 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.ProjectEditorView;
|
||||
import test.model.Project;
|
||||
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.view.ControlDecoration;
|
||||
import com.foundation.view.IViewContext;
|
||||
import com.foundation.view.resource.ResourceReference;
|
||||
|
||||
public class ProjectEditorViewController extends AbstractViewController {
|
||||
public static final Attribute PROJECT = registerAttribute(ProjectEditorViewController.class, "project");
|
||||
private Runnable changeListener;
|
||||
/**
|
||||
* ProjectEditorViewController constructor.
|
||||
* @param context The context underwhich the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
* @param changeListener The optional listener called when changes are applied to the project.
|
||||
* @param project The edited project.
|
||||
*/
|
||||
public ProjectEditorViewController(IViewContext context, Runnable changeListener, Project project) {
|
||||
super(context);
|
||||
this.changeListener = changeListener;
|
||||
setProject((Project) getReflectionManager().createReflection(project));
|
||||
}//ProjectEditorViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return ProjectEditorView.class;
|
||||
}//getViewClass()//
|
||||
/**
|
||||
* Applies changes to the project.
|
||||
*/
|
||||
public void doApply() {
|
||||
synchronize();
|
||||
getReflectionManager().synchronizeAll();
|
||||
|
||||
if(changeListener != null) {
|
||||
changeListener.run();
|
||||
}//if//
|
||||
}//doApply()//
|
||||
/* (non-Javadoc)
|
||||
* @see test.local.view.controller.AbstractViewController#validate()
|
||||
*/
|
||||
public boolean validate() {
|
||||
boolean result = true;
|
||||
|
||||
getDecorationManager().clearDecorations(null, null);
|
||||
|
||||
if((getProject().getName() == null) || (getProject().getName().trim().length() == 0)) {
|
||||
getDecorationManager().addDecoration(getProject(), Project.NAME, new ControlDecoration(new ResourceReference("res://View/ProjectEditor/ErrorOverlay"), "Must provide a name."));
|
||||
result = false;
|
||||
}//if//
|
||||
|
||||
if((getProject().getProgress() == null) || (getProject().getProgress().intValue() < 0) || (getProject().getProgress().intValue() > 100)) {
|
||||
getDecorationManager().addDecoration(getProject(), Project.PROGRESS, new ControlDecoration(new ResourceReference("res://View/ProjectEditor/ErrorOverlay"), "Must be a number between (0..100)."));
|
||||
result = false;
|
||||
}//if//
|
||||
|
||||
getDecorationManager().applyDecorationChanges();
|
||||
|
||||
return result;
|
||||
}//validate()//
|
||||
/**
|
||||
* Rejects changes to the project.
|
||||
*/
|
||||
public void doCancel() {
|
||||
synchronize();
|
||||
getProject().reverseObjectChanges();
|
||||
}//doCancel()//
|
||||
/**
|
||||
* Gets the project being edited.
|
||||
* @return The edited project.
|
||||
*/
|
||||
public Project getProject() {
|
||||
return (Project) getAttributeValue(PROJECT);
|
||||
}//getProject()//
|
||||
/**
|
||||
* Sets the project being edited.
|
||||
* @param project The edited project.
|
||||
*/
|
||||
private void setProject(Project project) {
|
||||
setAttributeValue(PROJECT, project);
|
||||
}//getProject()//
|
||||
}//ProjectEditorViewController//
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) 2005,2006 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.SampleInnerView;
|
||||
|
||||
import com.foundation.view.IViewContext;
|
||||
|
||||
public class SampleInnerViewController extends AbstractViewController {
|
||||
/**
|
||||
* SampleInnerViewController constructor.
|
||||
* @param viewContext The view context.
|
||||
*/
|
||||
public SampleInnerViewController(IViewContext viewContext) {
|
||||
super(viewContext);
|
||||
}//SampleInnerViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return SampleInnerView.class;
|
||||
}//getViewClass()//
|
||||
}//SampleInnerViewController//
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.StreetAddressEditorView;
|
||||
import test.model.StreetAddress;
|
||||
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.view.IViewContext;
|
||||
|
||||
public class StreetAddressEditorViewController extends AbstractViewController {
|
||||
public static final Attribute STREET_ADDRESS = registerAttribute(StreetAddressEditorViewController.class, "streetAddress");
|
||||
private Runnable changeListener;
|
||||
/**
|
||||
* StreetAddressEditorViewController constructor.
|
||||
* @param context The context underwhich the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
* @param changeListener The optional listener called when changes are applied to the street address.
|
||||
* @param streetAddress The edited street address.
|
||||
*/
|
||||
public StreetAddressEditorViewController(IViewContext context, Runnable changeListener, StreetAddress streetAddress) {
|
||||
super(context);
|
||||
this.changeListener = changeListener;
|
||||
setStreetAddress((StreetAddress) getReflectionManager().createReflection(streetAddress));
|
||||
}//StreetAddressEditorViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return StreetAddressEditorView.class;
|
||||
}//getViewClass()//
|
||||
/**
|
||||
* Applies changes to the street address.
|
||||
*/
|
||||
public void doApply() {
|
||||
synchronize();
|
||||
getReflectionManager().synchronizeAll();
|
||||
|
||||
if(changeListener != null) {
|
||||
changeListener.run();
|
||||
}//if//
|
||||
}//doApply()//
|
||||
/**
|
||||
* Rejects changes to the street address.
|
||||
*/
|
||||
public void doCancel() {
|
||||
synchronize();
|
||||
getStreetAddress().reverseObjectChanges();
|
||||
}//doCancel()//
|
||||
/**
|
||||
* Gets the streetAddress being edited.
|
||||
* @return The edited streetAddress.
|
||||
*/
|
||||
public StreetAddress getStreetAddress() {
|
||||
return (StreetAddress) getAttributeValue(STREET_ADDRESS);
|
||||
}//getStreetAddress()//
|
||||
/**
|
||||
* Sets the streetAddress being edited.
|
||||
* @param streetAddress The edited streetAddress.
|
||||
*/
|
||||
private void setStreetAddress(StreetAddress streetAddress) {
|
||||
setAttributeValue(STREET_ADDRESS, streetAddress);
|
||||
}//getStreetAddress()//
|
||||
}//StreetAddressEditorViewController//
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 2005,2006 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.view.IViewContext;
|
||||
import test.local.view.StyledTextPageView;
|
||||
|
||||
public class StyledTextPageViewController extends AbstractViewController {
|
||||
/**
|
||||
* StyledTextPageViewController constructor.
|
||||
* @param context
|
||||
*/
|
||||
public StyledTextPageViewController(IViewContext context) {
|
||||
super(context);
|
||||
}//StyledTextPageViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.common.Entity#lazyLoadAttribute(com.foundation.metadata.Attribute)
|
||||
*/
|
||||
protected Object lazyLoadAttribute(Attribute attribute) {
|
||||
Object result = null;
|
||||
|
||||
result = super.lazyLoadAttribute(attribute);
|
||||
|
||||
return result;
|
||||
}//lazyLoadAttribute()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return StyledTextPageView.class;
|
||||
}//getViewClass()//
|
||||
}//StyledTextPageViewController//
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (c) 2005,2007 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.TableEditorPageView;
|
||||
import test.model.Data;
|
||||
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.util.IManagedList;
|
||||
import com.foundation.util.ManagedList;
|
||||
import com.foundation.view.IViewContext;
|
||||
|
||||
public class TableEditorPageViewController extends AbstractViewController {
|
||||
public static final Attribute DATA = registerCollection(TableEditorPageViewController.class, "data", AO_LAZY | AO_REFERENCED);
|
||||
/**
|
||||
* TableEditorPageViewController constructor.
|
||||
* @param context The context underwhich the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
*/
|
||||
public TableEditorPageViewController(IViewContext context) {
|
||||
super(context);
|
||||
}//TableEditorPageViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.common.Entity#lazyLoadAttribute(com.foundation.metadata.Attribute)
|
||||
*/
|
||||
protected Object lazyLoadAttribute(Attribute attribute) {
|
||||
Object result = null;
|
||||
|
||||
if(attribute == DATA) {
|
||||
ManagedList list = new ManagedList(10, 20);
|
||||
|
||||
list.add(new Data());
|
||||
list.add(new Data());
|
||||
list.add(new Data());
|
||||
list.add(new Data());
|
||||
result = list;
|
||||
}//if//
|
||||
else {
|
||||
result = super.lazyLoadAttribute(attribute);
|
||||
}//else//
|
||||
|
||||
return result;
|
||||
}//lazyLoadAttribute()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return TableEditorPageView.class;
|
||||
}//getViewClass()//
|
||||
/**
|
||||
* Gets the collection of data displayed in the table.
|
||||
* @return The data.
|
||||
*/
|
||||
public IManagedList getData() {
|
||||
return (IManagedList) getAttributeValue(DATA);
|
||||
}//getData()//
|
||||
}//TableEditorPageViewController//
|
||||
@@ -0,0 +1,235 @@
|
||||
/*
|
||||
* Copyright (c) 2005,2009 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Random;
|
||||
|
||||
import test.local.view.TablePageView;
|
||||
import test.model.Priority;
|
||||
import test.model.Project;
|
||||
|
||||
import com.common.debug.Debug;
|
||||
import com.foundation.controller.ViewController;
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.util.IManagedList;
|
||||
import com.foundation.view.HighlightDecoration;
|
||||
import com.foundation.view.IViewContext;
|
||||
import com.foundation.view.ImageDecoration;
|
||||
import com.foundation.view.JefColor;
|
||||
import com.foundation.view.resource.ResourceReference;
|
||||
|
||||
public class TablePageViewController extends AbstractViewController {
|
||||
public static final Attribute PROJECTS = registerCollection(TablePageViewController.class, "projects", AO_REFERENCED);
|
||||
public static final Attribute EDITOR = registerAttribute(TablePageViewController.class, "editor", AO_REFERENCED);
|
||||
public static final Attribute SELECTION = registerAttribute(TablePageViewController.class, "selection", AO_REFERENCED);
|
||||
public static final Attribute PRIORITIES = registerCollection(TablePageViewController.class, "priorities", AO_REFERENCED);
|
||||
public static final Attribute COOL_IMAGE = registerAttribute(TablePageViewController.class, "coolImage", AO_REFERENCED);
|
||||
|
||||
private int counter = 100;
|
||||
/**
|
||||
* TablePageViewController constructor.
|
||||
* @param context The context underwhich the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
* @param projects The collection of displayed projects.
|
||||
* @param priorities The collection of possible priorities for the projects.
|
||||
*/
|
||||
public TablePageViewController(IViewContext context, IManagedList projects, IManagedList priorities) {
|
||||
super(context, true);
|
||||
|
||||
setProjects((IManagedList) getReflectionManager().createReflection(projects));
|
||||
setPriorities((IManagedList) getReflectionManager().createReflection(priorities));
|
||||
setCoolImage(new ResourceReference("res://View/ProjectEditor/CoolImage"));
|
||||
}//TablePageViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.common.Entity#lazyLoadAttribute(com.foundation.metadata.Attribute)
|
||||
*/
|
||||
protected Object lazyLoadAttribute(Attribute attribute) {
|
||||
Object result = null;
|
||||
|
||||
result = super.lazyLoadAttribute(attribute);
|
||||
|
||||
return result;
|
||||
}//lazyLoadAttribute()//
|
||||
public boolean validate() {
|
||||
getDecorationManager().clearDecorations();
|
||||
|
||||
if(getProjects().getSize() > 5) {
|
||||
getDecorationManager().addDecoration(getProjects().get(5), null, new ImageDecoration("res://View/ProjectEditor/ErrorOverlay"));
|
||||
}//if//
|
||||
|
||||
if(getProjects().getSize() > 4) {
|
||||
getDecorationManager().addDecoration(getProjects().get(4), null, new HighlightDecoration(new ResourceReference("res://View/ProjectEditor/ErrorBackgroundColor"), new ResourceReference("res://View/ProjectEditor/ErrorForegroundColor"), new ResourceReference("res://View/ProjectEditor/ErrorFont"), new ResourceReference("res://View/ProjectEditor/ErrorSelectionGradient"), "Broken"));
|
||||
}//if//
|
||||
|
||||
getDecorationManager().applyDecorationChanges();
|
||||
|
||||
return super.validate();
|
||||
}//validate()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return TablePageView.class;
|
||||
}//getViewClass()//
|
||||
/**
|
||||
* Removes all projects.
|
||||
*/
|
||||
public void doRemoveAllProjects() {
|
||||
getProjects().removeAll();
|
||||
}//doRemoveAllProjects()//
|
||||
/**
|
||||
* Removes the selected project.
|
||||
*/
|
||||
public void doRemoveProject() {
|
||||
if(getSelection() != null) {
|
||||
getProjects().remove(getSelection());
|
||||
setSelection(null);
|
||||
}//if//
|
||||
}//doRemoveProject()//
|
||||
/**
|
||||
* Adds a new project.
|
||||
*/
|
||||
public void doAddProject() {
|
||||
Project project = new Project();
|
||||
|
||||
project.setName("Project " + counter++);
|
||||
project.setNote("some note");
|
||||
project.setPriority((Priority) getPriorities().getFirst());
|
||||
project.setProgress(new BigDecimal(new Random().nextInt(101)).divide(new BigDecimal("100")));
|
||||
getProjects().add(project);
|
||||
}//doAddProject()//
|
||||
/**
|
||||
* Handles the project's button being pressed in the table.
|
||||
* @param project The project whose button was pressed.
|
||||
*/
|
||||
public void doProjectButtonPressed(Project project) {
|
||||
Debug.log("Button pressed for project: " + project.getName());
|
||||
}//doProjectButtonPressed()//
|
||||
/**
|
||||
* Gets the collection of projects displayed in the table.
|
||||
* @return The projects.
|
||||
*/
|
||||
public IManagedList getProjects() {
|
||||
return (IManagedList) getAttributeValue(PROJECTS);
|
||||
}//getProjects()//
|
||||
/**
|
||||
* Sets the collection of projects displayed in the table.
|
||||
* @param projects The projects.
|
||||
*/
|
||||
private void setProjects(IManagedList projects) {
|
||||
setAttributeValue(PROJECTS, projects);
|
||||
}//setProjects()//
|
||||
/**
|
||||
* Gets the priorities possible for the projects.
|
||||
* @return The collection of priority instances.
|
||||
*/
|
||||
public IManagedList getPriorities() {
|
||||
return (IManagedList) getAttributeValue(PRIORITIES);
|
||||
}//getPriorities()//
|
||||
/**
|
||||
* Sets the collection of priorities possible for the projects.
|
||||
* @param priorities The priorities allowed.
|
||||
*/
|
||||
private void setPriorities(IManagedList priorities) {
|
||||
setAttributeValue(PRIORITIES, priorities);
|
||||
}//setPriorities()//
|
||||
/**
|
||||
* Gets the editor displayed under the table.
|
||||
* @return The editor or null if no editor is visible.
|
||||
*/
|
||||
public ViewController getEditor() {
|
||||
return (ViewController) getAttributeValue(EDITOR);
|
||||
}//getEditor()//
|
||||
/**
|
||||
* Sets the editor displayed under the table.
|
||||
* @param editor The editor or null if no editor is visible.
|
||||
*/
|
||||
private void setEditor(ViewController editor) {
|
||||
setAttributeValue(EDITOR, editor);
|
||||
}//setEditor()//
|
||||
/**
|
||||
* Gets the coolImage displayed under the table.
|
||||
* @return The coolImage or null if no coolImage is visible.
|
||||
*/
|
||||
public ResourceReference getCoolImage() {
|
||||
return (ResourceReference) getAttributeValue(COOL_IMAGE);
|
||||
}//getCoolImage()//
|
||||
/**
|
||||
* Sets the coolImage displayed under the table.
|
||||
* @param coolImage The coolImage or null if no coolImage is visible.
|
||||
*/
|
||||
private void setCoolImage(ResourceReference coolImage) {
|
||||
setAttributeValue(COOL_IMAGE, coolImage);
|
||||
}//setCoolImage()//
|
||||
/**
|
||||
* Gets the table selection.
|
||||
* @return The selected object in the table.
|
||||
*/
|
||||
public Object getSelection() {
|
||||
return (Object) getAttributeValue(SELECTION);
|
||||
}//getSelection()//
|
||||
/**
|
||||
* Sets the table selection.
|
||||
* @param selection The selected object in the table.
|
||||
*/
|
||||
public void setSelection(Object selection) {
|
||||
if(getSelection() != selection) {
|
||||
setAttributeValue(SELECTION, selection);
|
||||
setupEditor(selection);
|
||||
}//if//
|
||||
}//setSelection()//
|
||||
/**
|
||||
* Clears the selection.
|
||||
*/
|
||||
public void clearSelection() {
|
||||
setSelection(null);
|
||||
}//clearSelection()//
|
||||
/**
|
||||
* Sets up the editor for the given selection.
|
||||
* @param selection The selection whose editor must be setup.
|
||||
*/
|
||||
private void setupEditor(Object selection) {
|
||||
ViewController editor = null;
|
||||
|
||||
if(selection != null) {
|
||||
editor = new ProjectEditorViewController(getContext(), new Runnable() {
|
||||
public void run() {
|
||||
getReflectionManager().synchronizeAll();
|
||||
}//run()//
|
||||
}, (Project) selection);
|
||||
}//if//
|
||||
|
||||
setEditor(editor);
|
||||
}//setupEditor()//
|
||||
/**
|
||||
* Gets a boolean flag for the given project.
|
||||
* @param project The project for which a boolean will be retrieved.
|
||||
* @return The project's boolean.
|
||||
*/
|
||||
public Boolean getFlag(Project project) {
|
||||
return project.getFlag();
|
||||
}//getFlag()//
|
||||
/**
|
||||
* Toggles the flag on the selected object.
|
||||
*/
|
||||
public void toggleFlag() {
|
||||
Object selection = (Object) getSelection();
|
||||
|
||||
if(selection != null && selection instanceof Project) {
|
||||
((Project) selection).setFlag(((Project) selection).getFlag().booleanValue() ? Boolean.FALSE : Boolean.TRUE);
|
||||
}//if//
|
||||
}//toggleFlag()//
|
||||
/**
|
||||
* Gets the color associated with the given object.
|
||||
* @param object The object for which a color will be generated.
|
||||
* @return The object's color.
|
||||
*/
|
||||
public JefColor getObjectColor(Object object) {
|
||||
return new JefColor((object.hashCode() & 0xFF), (object.hashCode() & 0xFF00) >> 8, 255 - ((object.hashCode() & 0xFF00) >> 8));
|
||||
}//getObjectColor()//
|
||||
}//TablePageViewController//
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (c) 2009 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.TablePerformanceTestView;
|
||||
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.util.IManagedList;
|
||||
import com.foundation.view.IViewContext;
|
||||
import com.foundation.view.ImageDecoration;
|
||||
|
||||
public class TablePerformanceTestViewController extends AbstractViewController {
|
||||
public static final Attribute COLLECTION = registerCollection(TablePerformanceTestViewController.class, "collection", AO_REFERENCED);
|
||||
/**
|
||||
* TablePerformanceTestViewController constructor.
|
||||
* @param context The context under which the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
*/
|
||||
public TablePerformanceTestViewController(IViewContext context, IManagedList collection, boolean reflect) {
|
||||
super(context, true);
|
||||
|
||||
if(reflect) {
|
||||
setCollection((IManagedList) getReflectionManager().createReflection(collection));
|
||||
}//if//
|
||||
else {
|
||||
setCollection(collection);
|
||||
}//else//
|
||||
}//TablePerformanceTestViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return TablePerformanceTestView.class;
|
||||
}//getViewClass()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.declarativeengineering.jetson.view.controller.AbstractViewController#validate()
|
||||
*/
|
||||
public boolean validate() {
|
||||
getDecorationManager().clearDecorations();
|
||||
|
||||
if(getCollection().getSize() > 0) {
|
||||
getDecorationManager().addDecoration(getCollection().getFirst(), null, new ImageDecoration("res://View/ProjectEditor/ErrorOverlay"));
|
||||
}//if//
|
||||
|
||||
getDecorationManager().applyDecorationChanges();
|
||||
|
||||
return false;
|
||||
}//validate()//
|
||||
/**
|
||||
* Gets the collection value.
|
||||
* @return The collection value.
|
||||
*/
|
||||
public IManagedList getCollection() {
|
||||
return (IManagedList) getAttributeValue(COLLECTION);
|
||||
}//getCollection()//
|
||||
/**
|
||||
* Sets the collection value.
|
||||
* @param collection The collection value.
|
||||
*/
|
||||
private void setCollection(IManagedList collection) {
|
||||
setAttributeValue(COLLECTION, collection);
|
||||
}//setCollection()//
|
||||
}//TablePerformanceTestViewController//
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 2008 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt */
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.TeamView;
|
||||
|
||||
import com.foundation.util.IManagedList;
|
||||
import com.foundation.view.IViewContext;
|
||||
import com.foundation.metadata.Attribute;
|
||||
|
||||
/**
|
||||
* TeamViewController constructor.
|
||||
* @param context The context under which the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
*/
|
||||
public class TeamViewController extends AbstractViewController {
|
||||
public static final Attribute TEAMS = registerCollection(TeamViewController.class, "teams", AO_REFERENCED);
|
||||
/**
|
||||
* TeamViewController constructor.
|
||||
* @param context The context under which the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
*/
|
||||
public TeamViewController(IViewContext context, IManagedList teams) {
|
||||
super(context);
|
||||
setAttributeValue(TEAMS, getReflectionManager().createReflection(teams));
|
||||
}//TeamViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return TeamView.class;
|
||||
}//getViewClass()//
|
||||
/* (non-Javadoc)
|
||||
* @see com_declarativeengineering_jetson_view_controller.AbstractViewController#validate()
|
||||
*/
|
||||
public boolean validate() {
|
||||
return true;
|
||||
}//validate()//
|
||||
/**
|
||||
* Gets the teams value.
|
||||
* @return The teams value.
|
||||
*/
|
||||
public IManagedList getTeams() {
|
||||
return (IManagedList) getAttributeValue(TEAMS);
|
||||
}//getTeams()//
|
||||
}//TeamViewController//
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (c) 2008 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.TestDialog1View;
|
||||
|
||||
import com.foundation.util.IManagedList;
|
||||
import com.foundation.util.ManagedList;
|
||||
import com.foundation.view.IViewContext;
|
||||
import com.foundation.metadata.Attribute;
|
||||
|
||||
public class TestDialog1ViewController extends AbstractViewController {
|
||||
public static final Attribute ITEMS = registerCollection(TestDialog1ViewController.class, "items", AO_REFERENCED | AO_LAZY);
|
||||
public static final Attribute SELECTED = registerAttribute(TestDialog1ViewController.class, "selected");
|
||||
/**
|
||||
* TestDialog1ViewController constructor.
|
||||
* @param context
|
||||
*/
|
||||
public TestDialog1ViewController(IViewContext context) {
|
||||
super(context);
|
||||
}//TestDialog1ViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return TestDialog1View.class;
|
||||
}//getViewClass()//
|
||||
/**
|
||||
* Closes the view.
|
||||
*/
|
||||
public void doClose() {
|
||||
close();
|
||||
}//doClose()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.common.Entity#lazyLoadAttribute(com.foundation.metadata.Attribute)
|
||||
*/
|
||||
protected Object lazyLoadAttribute(Attribute attribute) {
|
||||
Object result = null;
|
||||
|
||||
if(attribute == ITEMS) {
|
||||
result = new ManagedList(new String[] {"One", "Two", "Three"});
|
||||
}//if//
|
||||
else {
|
||||
result = super.lazyLoadAttribute(attribute);
|
||||
}//else//
|
||||
|
||||
return result;
|
||||
}//lazyLoadAttribute()//
|
||||
/**
|
||||
* Gets the items value.
|
||||
* @return The items value.
|
||||
*/
|
||||
public IManagedList getItems() {
|
||||
return (IManagedList) getAttributeValue(ITEMS);
|
||||
}//getItems()//
|
||||
/**
|
||||
* Gets the selected value.
|
||||
* @return The selected value.
|
||||
*/
|
||||
public Object getSelected() {
|
||||
return (Object) getAttributeValue(SELECTED);
|
||||
}//getSelected()//
|
||||
/**
|
||||
* Sets the selected value.
|
||||
* @param selected The selected value.
|
||||
*/
|
||||
public void setSelected(Object selected) {
|
||||
setAttributeValue(SELECTED, selected);
|
||||
}//setSelected()//
|
||||
}//TestDialog1ViewController//
|
||||
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (c) 2008,2009 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.TestDialog2View;
|
||||
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.util.IManagedList;
|
||||
import com.foundation.util.ManagedList;
|
||||
import com.foundation.view.ControlDecoration;
|
||||
import com.foundation.view.IViewContext;
|
||||
|
||||
public class TestDialog2ViewController extends AbstractViewController {
|
||||
public static final Attribute ITEMS = registerCollection(TestDialog2ViewController.class, "items", AO_REFERENCED | AO_LAZY);
|
||||
public static final Attribute TEXT = registerAttribute(TestDialog2ViewController.class, "text");
|
||||
/**
|
||||
* TestDialog2ViewController constructor.
|
||||
* @param context
|
||||
*/
|
||||
public TestDialog2ViewController(IViewContext context) {
|
||||
super(context);
|
||||
}//TestDialog2ViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return TestDialog2View.class;
|
||||
}//getViewClass()//
|
||||
/**
|
||||
* Closes the view.
|
||||
*/
|
||||
public void doClose() {
|
||||
close();
|
||||
}//doClose()//
|
||||
/* (non-Javadoc)
|
||||
* @see test.local.view.controller.AbstractViewController#validate()
|
||||
*/
|
||||
public boolean validate() {
|
||||
boolean result = true;
|
||||
|
||||
getDecorationManager().clearDecorations();
|
||||
|
||||
if(getText() == null || getText().trim().length() == 0) {
|
||||
getDecorationManager().addDecoration(this, TEXT, new ControlDecoration("res://View/ProjectEditor/ErrorOverlay", "Must provide a valid product code in the form: XXXX-XXXX-XXXX-XXXX-XXXX"));
|
||||
result = false;
|
||||
}//if//
|
||||
|
||||
getDecorationManager().applyDecorationChanges();
|
||||
|
||||
return result;
|
||||
}//validate()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.common.Entity#lazyLoadAttribute(com.foundation.metadata.Attribute)
|
||||
*/
|
||||
protected Object lazyLoadAttribute(Attribute attribute) {
|
||||
Object result = null;
|
||||
|
||||
if(attribute == ITEMS) {
|
||||
result = new ManagedList(new String[] {"One", "Two", "Three"});
|
||||
}//if//
|
||||
else {
|
||||
result = super.lazyLoadAttribute(attribute);
|
||||
}//else//
|
||||
|
||||
return result;
|
||||
}//lazyLoadAttribute()//
|
||||
/**
|
||||
* Gets the items value.
|
||||
* @return The items value.
|
||||
*/
|
||||
public IManagedList getItems() {
|
||||
return (IManagedList) getAttributeValue(ITEMS);
|
||||
}//getItems()//
|
||||
/**
|
||||
* Gets the text value.
|
||||
* @return The text value.
|
||||
*/
|
||||
public String getText() {
|
||||
return (String) getAttributeValue(TEXT);
|
||||
}//getText()//
|
||||
/**
|
||||
* Sets the text value.
|
||||
* @param text The text value.
|
||||
*/
|
||||
public void setText(String text) {
|
||||
setAttributeValue(TEXT, text);
|
||||
}//setText()//
|
||||
}//TestDialog2ViewController//
|
||||
@@ -0,0 +1,271 @@
|
||||
/*
|
||||
* Copyright (c) 2007,2008 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import test.local.view.TextPageView;
|
||||
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.view.ControlDecoration;
|
||||
import com.foundation.view.IViewContext;
|
||||
|
||||
public class TextPageViewController extends AbstractViewController {
|
||||
public static final Attribute TEXT = registerAttribute(TextPageViewController.class, "text", "This is a test.");
|
||||
public static final Attribute BYTE = registerAttribute(TextPageViewController.class, "byte", new Byte((byte) 12));
|
||||
public static final Attribute SHORT = registerAttribute(TextPageViewController.class, "short", new Short((short) -11002));
|
||||
public static final Attribute INTEGER = registerAttribute(TextPageViewController.class, "integer", new Integer(892342012));
|
||||
public static final Attribute LONG = registerAttribute(TextPageViewController.class, "long", new Long(0));
|
||||
public static final Attribute FLOAT = registerAttribute(TextPageViewController.class, "float", new Float(0.123f));
|
||||
public static final Attribute DOUBLE = registerAttribute(TextPageViewController.class, "double", new Double(-12.0000005d));
|
||||
public static final Attribute BIG_DECIMAL = registerAttribute(TextPageViewController.class, "bigDecimal", new BigDecimal("-12.0000005"));
|
||||
public static final Attribute PERCENT = registerAttribute(TextPageViewController.class, "percent", new BigDecimal("10.8"));
|
||||
public static final Attribute CURRENCY = registerAttribute(TextPageViewController.class, "currency", new BigDecimal("112.68"));
|
||||
public static final Attribute TIME = registerAttribute(TextPageViewController.class, "time", null);
|
||||
public static final Attribute DATE = registerAttribute(TextPageViewController.class, "date", null);
|
||||
public static final Attribute CALENDAR = registerAttribute(TextPageViewController.class, "calendar", null);
|
||||
public static final Attribute CUSTOM = registerAttribute(TextPageViewController.class, "custom");
|
||||
/**
|
||||
* TextPageViewController constructor.
|
||||
* @param context The context underwhich the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
* @param projects The collection of displayed projects.
|
||||
*/
|
||||
public TextPageViewController(IViewContext context) {
|
||||
super(context);
|
||||
}//TextPageViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.common.Entity#lazyLoadAttribute(com.foundation.metadata.Attribute)
|
||||
*/
|
||||
protected Object lazyLoadAttribute(Attribute attribute) {
|
||||
Object result = null;
|
||||
|
||||
result = super.lazyLoadAttribute(attribute);
|
||||
|
||||
return result;
|
||||
}//lazyLoadAttribute()//
|
||||
/* (non-Javadoc)
|
||||
* @see test.local.view.controller.AbstractViewController#validate()
|
||||
*/
|
||||
public boolean validate() {
|
||||
boolean result = true;
|
||||
|
||||
getDecorationManager().clearDecorations(null, null);
|
||||
|
||||
if(getText() == null || getText().trim().length() == 0) {
|
||||
getDecorationManager().addDecoration(this, TEXT, new ControlDecoration("res://View/ProjectEditor/ErrorOverlay", "Cannot be empty."));
|
||||
result = false;
|
||||
}//if//
|
||||
|
||||
getDecorationManager().applyDecorationChanges();
|
||||
|
||||
return result;
|
||||
}//validate()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return TextPageView.class;
|
||||
}//getViewClass()//
|
||||
/**
|
||||
* Gets the text value.
|
||||
* @return The text value.
|
||||
*/
|
||||
public String getText() {
|
||||
return (String) getAttributeValue(TEXT);
|
||||
}//getText()//
|
||||
/**
|
||||
* Sets the text value.
|
||||
* @param text The text value.
|
||||
*/
|
||||
public void setText(String text) {
|
||||
setAttributeValue(TEXT, text);
|
||||
}//setText()//
|
||||
/**
|
||||
* Gets the byte value.
|
||||
* @return The byte value.
|
||||
*/
|
||||
public Byte getByte() {
|
||||
return (Byte) getAttributeValue(BYTE);
|
||||
}//getByte()//
|
||||
/**
|
||||
* Sets the byte value.
|
||||
* @param byte The byte value.
|
||||
*/
|
||||
public void setByte(Byte byteValue) {
|
||||
setAttributeValue(BYTE, byteValue);
|
||||
}//setByte()//
|
||||
/**
|
||||
* Gets the short value.
|
||||
* @return The short value.
|
||||
*/
|
||||
public Short getShort() {
|
||||
return (Short) getAttributeValue(SHORT);
|
||||
}//getShort()//
|
||||
/**
|
||||
* Sets the short value.
|
||||
* @param short The short value.
|
||||
*/
|
||||
public void setShort(Short shortValue) {
|
||||
setAttributeValue(SHORT, shortValue);
|
||||
}//setShort()//
|
||||
/**
|
||||
* Gets the integer value.
|
||||
* @return The integer value.
|
||||
*/
|
||||
public Integer getInteger() {
|
||||
return (Integer) getAttributeValue(INTEGER);
|
||||
}//getInteger()//
|
||||
/**
|
||||
* Sets the integer value.
|
||||
* @param integer The integer value.
|
||||
*/
|
||||
public void setInteger(Integer integer) {
|
||||
setAttributeValue(INTEGER, integer);
|
||||
}//setInteger()//
|
||||
/**
|
||||
* Gets the long value.
|
||||
* @return The long value.
|
||||
*/
|
||||
public Long getLong() {
|
||||
return (Long) getAttributeValue(LONG);
|
||||
}//getLong()//
|
||||
/**
|
||||
* Sets the long value.
|
||||
* @param long The long value.
|
||||
*/
|
||||
public void setLong(Long longValue) {
|
||||
setAttributeValue(LONG, longValue);
|
||||
}//setLong()//
|
||||
/**
|
||||
* Gets the float value.
|
||||
* @return The float value.
|
||||
*/
|
||||
public Float getFloat() {
|
||||
return (Float) getAttributeValue(FLOAT);
|
||||
}//getFloat()//
|
||||
/**
|
||||
* Sets the float value.
|
||||
* @param float The float value.
|
||||
*/
|
||||
public void setFloat(Float floatValue) {
|
||||
setAttributeValue(FLOAT, floatValue);
|
||||
}//setFloat()//
|
||||
/**
|
||||
* Gets the double value.
|
||||
* @return The double value.
|
||||
*/
|
||||
public Double getDouble() {
|
||||
return (Double) getAttributeValue(DOUBLE);
|
||||
}//getDouble()//
|
||||
/**
|
||||
* Sets the double value.
|
||||
* @param double The double value.
|
||||
*/
|
||||
public void setDouble(Double doubleValue) {
|
||||
setAttributeValue(DOUBLE, doubleValue);
|
||||
}//setDouble()//
|
||||
/**
|
||||
* Gets the bigDecimal value.
|
||||
* @return The bigDecimal value.
|
||||
*/
|
||||
public BigDecimal getBigDecimal() {
|
||||
return (BigDecimal) getAttributeValue(BIG_DECIMAL);
|
||||
}//getBigDecimal()//
|
||||
/**
|
||||
* Sets the bigDecimal value.
|
||||
* @param bigDecimal The bigDecimal value.
|
||||
*/
|
||||
public void setBigDecimal(BigDecimal bigDecimal) {
|
||||
setAttributeValue(BIG_DECIMAL, bigDecimal);
|
||||
}//setBigDecimal()//
|
||||
/**
|
||||
* Gets the percent value.
|
||||
* @return The percent value.
|
||||
*/
|
||||
public BigDecimal getPercent() {
|
||||
return (BigDecimal) getAttributeValue(PERCENT);
|
||||
}//getPercent()//
|
||||
/**
|
||||
* Sets the percent value.
|
||||
* @param percent The percent value.
|
||||
*/
|
||||
public void setPercent(BigDecimal percent) {
|
||||
setAttributeValue(PERCENT, percent);
|
||||
}//setPercent()//
|
||||
/**
|
||||
* Gets the currency value.
|
||||
* @return The currency value.
|
||||
*/
|
||||
public BigDecimal getCurrency() {
|
||||
return (BigDecimal) getAttributeValue(CURRENCY);
|
||||
}//getCurrency()//
|
||||
/**
|
||||
* Sets the currency value.
|
||||
* @param currency The currency value.
|
||||
*/
|
||||
public void setCurrency(BigDecimal currency) {
|
||||
setAttributeValue(CURRENCY, currency);
|
||||
}//setCurrency()//
|
||||
/**
|
||||
* Gets the time value.
|
||||
* @return The time value.
|
||||
*/
|
||||
public Date getTime() {
|
||||
return (Date) getAttributeValue(TIME);
|
||||
}//getTime()//
|
||||
/**
|
||||
* Sets the time value.
|
||||
* @param time The time value.
|
||||
*/
|
||||
public void setTime(Date time) {
|
||||
setAttributeValue(TIME, time);
|
||||
}//setTime()//
|
||||
/**
|
||||
* Gets the date value.
|
||||
* @return The date value.
|
||||
*/
|
||||
public Date getDate() {
|
||||
return (Date) getAttributeValue(DATE);
|
||||
}//getDate()//
|
||||
/**
|
||||
* Sets the date value.
|
||||
* @param date The date value.
|
||||
*/
|
||||
public void setDate(Date date) {
|
||||
setAttributeValue(DATE, date);
|
||||
}//setDate()//
|
||||
/**
|
||||
* Gets the calendar value.
|
||||
* @return The calendar value.
|
||||
*/
|
||||
public Date getCalendar() {
|
||||
return (Date) getAttributeValue(CALENDAR);
|
||||
}//getCalendar()//
|
||||
/**
|
||||
* Sets the calendar value.
|
||||
* @param calendar The calendar value.
|
||||
*/
|
||||
public void setCalendar(Date calendar) {
|
||||
setAttributeValue(CALENDAR, calendar);
|
||||
}//setCalendar()//
|
||||
/**
|
||||
* Gets the custom value.
|
||||
* @return The custom value.
|
||||
*/
|
||||
public BigDecimal getCustom() {
|
||||
return (BigDecimal) getAttributeValue(CUSTOM);
|
||||
}//getCustom()//
|
||||
/**
|
||||
* Sets the custom value.
|
||||
* @param custom The custom value.
|
||||
*/
|
||||
public void setCustom(BigDecimal custom) {
|
||||
setAttributeValue(CUSTOM, custom);
|
||||
}//setCustom()//
|
||||
}//TextPageViewController//
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2006,2009 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.ToolBarPageView;
|
||||
|
||||
import com.common.debug.Debug;
|
||||
import com.foundation.view.IViewContext;
|
||||
|
||||
public class ToolBarPageViewController extends AbstractViewController {
|
||||
/**
|
||||
* ToolBarPageViewController constructor.
|
||||
* @param viewContext The view context.
|
||||
*/
|
||||
public ToolBarPageViewController(IViewContext context) {
|
||||
super(context);
|
||||
}//ToolBarPageViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return ToolBarPageView.class;
|
||||
}//getViewClass()//
|
||||
public void doPush2Pressed() {
|
||||
Debug.log("Push 2 pressed.");
|
||||
}//doPush2Pressed()//
|
||||
}//ToolBarPageViewController//
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (c) 2007,2009 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.Tray;
|
||||
import test.model.*;
|
||||
|
||||
import com.common.debug.Debug;
|
||||
import com.foundation.util.IManagedCollection;
|
||||
import com.foundation.util.ManagedList;
|
||||
import com.foundation.view.IViewContext;
|
||||
import com.foundation.metadata.Attribute;
|
||||
|
||||
public class TrayController extends AbstractViewController {
|
||||
public static final Attribute COLLECTION = registerCollection(TrayController.class, "collection", AO_REFERENCED | AO_LAZY);
|
||||
/**
|
||||
* TrayController constructor.
|
||||
* @param context
|
||||
*/
|
||||
public TrayController(IViewContext context) {
|
||||
super(context);
|
||||
}//TrayController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.common.Entity#lazyLoadAttribute(com.foundation.metadata.Attribute)
|
||||
*/
|
||||
protected Object lazyLoadAttribute(Attribute attribute) {
|
||||
Object result = null;
|
||||
|
||||
if(attribute == COLLECTION) {
|
||||
IManagedCollection menus = new ManagedList(10, 20);
|
||||
MenuContainer container = new MenuContainer("Cascade 1");
|
||||
|
||||
menus.add(new PushMenu("Push 1"));
|
||||
menus.add(new PushMenu("Push 2"));
|
||||
menus.add(new RadioMenu("Radio 1"));
|
||||
menus.add(new RadioMenu("Radio 2"));
|
||||
menus.add(new CheckMenu("Check 1"));
|
||||
menus.add(new CheckMenu("Check 2"));
|
||||
menus.add(new RadioMenu("Radio 3"));
|
||||
menus.add(new RadioMenu("Radio 4"));
|
||||
menus.add(container);
|
||||
container.getChildren().add(new PushMenu("Push 1"));
|
||||
container.getChildren().add(new PushMenu("Push 2"));
|
||||
container.getChildren().add(new PushMenu("Push 3"));
|
||||
|
||||
result = menus;
|
||||
}//if//
|
||||
else {
|
||||
result = super.lazyLoadAttribute(attribute);
|
||||
}//else//
|
||||
|
||||
return result;
|
||||
}//lazyLoadAttribute()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return Tray.class;
|
||||
}//getViewClass()//
|
||||
public void doSomething() {
|
||||
Debug.log("Tray Menu Selected");
|
||||
}//doSomething()//
|
||||
public void doMenuPressed(PushMenu menu) {
|
||||
Debug.log("Dynamic menu pressed: " + menu.getName());
|
||||
}//doMenuPressed()//
|
||||
/**
|
||||
* Gets the collection value.
|
||||
* @return The collection value.
|
||||
*/
|
||||
public IManagedCollection getCollection() {
|
||||
return (IManagedCollection) getAttributeValue(COLLECTION);
|
||||
}//getCollection()//
|
||||
}//TrayController//
|
||||
@@ -0,0 +1,202 @@
|
||||
/*
|
||||
* Copyright (c) 2005,2007 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.local.view.controller;
|
||||
|
||||
import test.local.view.TreePageView;
|
||||
import test.model.Contact;
|
||||
import test.model.EmailAddress;
|
||||
import test.model.Project;
|
||||
import test.model.StreetAddress;
|
||||
|
||||
import com.common.debug.Debug;
|
||||
import com.foundation.controller.ViewController;
|
||||
import com.foundation.metadata.Attribute;
|
||||
import com.foundation.util.IManagedList;
|
||||
import com.foundation.view.IViewContext;
|
||||
import com.foundation.view.JefColor;
|
||||
import com.foundation.view.resource.ResourceReference;
|
||||
|
||||
public class TreePageViewController extends AbstractViewController {
|
||||
public static final Attribute PROJECTS = registerCollection(TreePageViewController.class, "projects", AO_REFERENCED);
|
||||
public static final Attribute EDITOR = registerAttribute(TreePageViewController.class, "editor", AO_REFERENCED);
|
||||
public static final Attribute SELECTION = registerAttribute(TreePageViewController.class, "selection", AO_REFERENCED);
|
||||
public static final Attribute PRIORITIES = registerCollection(TreePageViewController.class, "priorities", AO_REFERENCED);
|
||||
public static final Attribute COOL_IMAGE = registerAttribute(TreePageViewController.class, "coolImage", AO_REFERENCED);
|
||||
/**
|
||||
* TreePageViewController constructor.
|
||||
* @param context The context underwhich the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
* @param projects The collection of displayed projects.
|
||||
* @param priorities The collection of possible priorities for the projects.
|
||||
*/
|
||||
public TreePageViewController(IViewContext context, IManagedList projects, IManagedList priorities) {
|
||||
super(context);
|
||||
|
||||
setProjects((IManagedList) getReflectionManager().createReflection(projects));
|
||||
setPriorities((IManagedList) getReflectionManager().createReflection(priorities));
|
||||
setCoolImage(new ResourceReference("res://View/ProjectEditor/CoolImage"));
|
||||
}//TreePageViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.common.Entity#lazyLoadAttribute(com.foundation.metadata.Attribute)
|
||||
*/
|
||||
protected Object lazyLoadAttribute(Attribute attribute) {
|
||||
Object result = null;
|
||||
|
||||
result = super.lazyLoadAttribute(attribute);
|
||||
|
||||
return result;
|
||||
}//lazyLoadAttribute()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return TreePageView.class;
|
||||
}//getViewClass()//
|
||||
/**
|
||||
* Gets the coolImage displayed under the table.
|
||||
* @return The coolImage or null if no coolImage is visible.
|
||||
*/
|
||||
public ResourceReference getCoolImage() {
|
||||
return (ResourceReference) getAttributeValue(COOL_IMAGE);
|
||||
}//getCoolImage()//
|
||||
/**
|
||||
* Sets the coolImage displayed under the table.
|
||||
* @param coolImage The coolImage or null if no coolImage is visible.
|
||||
*/
|
||||
private void setCoolImage(ResourceReference coolImage) {
|
||||
setAttributeValue(COOL_IMAGE, coolImage);
|
||||
}//setCoolImage()//
|
||||
/**
|
||||
* Handles the project's button being pressed in the table.
|
||||
* @param project The project whose button was pressed.
|
||||
*/
|
||||
public void doProjectButtonPressed(Project project) {
|
||||
Debug.log("Button pressed for project: " + project.getName());
|
||||
}//doProjectButtonPressed()//
|
||||
/**
|
||||
* Gets the collection of projects displayed in the tree.
|
||||
* @return The projects.
|
||||
*/
|
||||
public IManagedList getProjects() {
|
||||
return (IManagedList) getAttributeValue(PROJECTS);
|
||||
}//getProjects()//
|
||||
/**
|
||||
* Sets the collection of projects displayed in the tree.
|
||||
* @param projects The projects.
|
||||
*/
|
||||
private void setProjects(IManagedList projects) {
|
||||
setAttributeValue(PROJECTS, projects);
|
||||
}//setProjects()//
|
||||
/**
|
||||
* Gets the priorities possible for the projects.
|
||||
* @return The collection of priority instances.
|
||||
*/
|
||||
public IManagedList getPriorities() {
|
||||
return (IManagedList) getAttributeValue(PRIORITIES);
|
||||
}//getPriorities()//
|
||||
/**
|
||||
* Sets the collection of priorities possible for the projects.
|
||||
* @param priorities The priorities allowed.
|
||||
*/
|
||||
private void setPriorities(IManagedList priorities) {
|
||||
setAttributeValue(PRIORITIES, priorities);
|
||||
}//setPriorities()//
|
||||
/**
|
||||
* Gets the editor displayed under the table.
|
||||
* @return The editor or null if no editor is visible.
|
||||
*/
|
||||
public ViewController getEditor() {
|
||||
return (ViewController) getAttributeValue(EDITOR);
|
||||
}//getEditor()//
|
||||
/**
|
||||
* Sets the editor displayed under the table.
|
||||
* @param editor The editor or null if no editor is visible.
|
||||
*/
|
||||
private void setEditor(ViewController editor) {
|
||||
setAttributeValue(EDITOR, editor);
|
||||
}//setEditor()//
|
||||
/**
|
||||
* Gets the table selection.
|
||||
* @return The selected object in the table.
|
||||
*/
|
||||
public Object getSelection() {
|
||||
return (Object) getAttributeValue(SELECTION);
|
||||
}//getSelection()//
|
||||
/**
|
||||
* Sets the table selection.
|
||||
* @param selection The selected object in the table.
|
||||
*/
|
||||
public void setSelection(Object selection) {
|
||||
if(getSelection() != selection) {
|
||||
setAttributeValue(SELECTION, selection);
|
||||
setupEditor(selection);
|
||||
}//if//
|
||||
}//setSelection()//
|
||||
/**
|
||||
* Sets up the editor for the given selection.
|
||||
* @param selection The selection whose editor must be setup.
|
||||
*/
|
||||
private void setupEditor(Object selection) {
|
||||
ViewController editor = null;
|
||||
|
||||
if(selection != null) {
|
||||
if(selection instanceof Project) {
|
||||
editor = new ProjectEditorViewController(getContext(), new Runnable() {
|
||||
public void run() {
|
||||
getReflectionManager().synchronizeAll();
|
||||
}//run()//
|
||||
}, (Project) selection);
|
||||
}//if//
|
||||
else if(selection instanceof Contact) {
|
||||
editor = new ContactEditorViewController(getContext(), new Runnable() {
|
||||
public void run() {
|
||||
getReflectionManager().synchronizeAll();
|
||||
}//run()//
|
||||
}, (Contact) selection);
|
||||
}//else if//
|
||||
else if(selection instanceof EmailAddress) {
|
||||
editor = new EmailAddressEditorViewController(getContext(), new Runnable() {
|
||||
public void run() {
|
||||
getReflectionManager().synchronizeAll();
|
||||
}//run()//
|
||||
}, (EmailAddress) selection);
|
||||
}//else if//
|
||||
else if(selection instanceof StreetAddress) {
|
||||
editor = new StreetAddressEditorViewController(getContext(), new Runnable() {
|
||||
public void run() {
|
||||
getReflectionManager().synchronizeAll();
|
||||
}//run()//
|
||||
}, (StreetAddress) selection);
|
||||
}//else if//
|
||||
}//if//
|
||||
|
||||
setEditor(editor);
|
||||
}//setupEditor()//
|
||||
/**
|
||||
* Gets the color associated with the given object.
|
||||
* @param object The object for which a color will be generated.
|
||||
* @return The object's color.
|
||||
*/
|
||||
public JefColor getObjectColor(Object object) {
|
||||
JefColor result = null;
|
||||
|
||||
if(object instanceof Project) {
|
||||
result = new JefColor(0, 255, 0);
|
||||
}//if//
|
||||
else if(object instanceof Contact) {
|
||||
result = new JefColor(0, 0, 255);
|
||||
}//else if//
|
||||
else if(object instanceof EmailAddress) {
|
||||
result = new JefColor(255, 0, 255);
|
||||
}//else if//
|
||||
else if(object instanceof StreetAddress) {
|
||||
result = new JefColor(255, 255, 0);
|
||||
}//else if//
|
||||
|
||||
return result;
|
||||
}//getObjectColor()//
|
||||
}//TreePageViewController//
|
||||