[kune-commits] r1089 - in trunk: img script src/main/java/org/ourproject/kune/app/public/css src/main/java/org/ourproject/kune/app/public/css/img src/main/java/org/ourproject/kune/docs/client src/main/java/org/ourproject/kune/platf/client/actions/toolbar src/main/java/org/ourproject/kune/platf/client/services src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed src/main/java/org/ourproject/kune/platf/client/ui/rte src/main/java/org/ourproject/kune/platf/client/ui/rte/basic src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar src/main/java/org/ourproject/kune/wiki/client src/main/java/org/ourproject/kune/workspace/client src/main/java/org/ourproject/kune/workspace/client/editor src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia

vjrj vjrj at ourproject.org
Mon Mar 30 15:48:43 CEST 2009


Author: vjrj
Date: 2009-03-30 15:48:35 +0200 (Mon, 30 Mar 2009)
New Revision: 1089

Added:
   trunk/src/main/java/org/ourproject/kune/app/public/css/img/film.png
   trunk/src/main/java/org/ourproject/kune/app/public/css/img/specialchars.png
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionMenuItem.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTELinkPopup.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertMediaGroup.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaDescriptor.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaRegistry.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialog.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogView.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstract.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractView.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMedia.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaView.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMedia.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaView.java
Modified:
   trunk/img/kune-logos.svg
   trunk/script/generateBasicUIElements.sh
   trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
   trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
   trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java
   trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditor.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtView.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java
   trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java
Log:
Incomplete - task RTE: Edit/erase link contextual menu 

Incomplete - task Actions UI position reorganization 

Complete - task LinkInfo and LinkImage reference in Abstra* 

Incomplete - task Insert Media dialog 

Complete - task RTE Insert Image size bug (trans field instead of other)

Modified: trunk/img/kune-logos.svg
===================================================================
--- trunk/img/kune-logos.svg	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/img/kune-logos.svg	2009-03-30 13:48:35 UTC (rev 1089)
@@ -86,14 +86,14 @@
      borderopacity="1.0"
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
-     inkscape:zoom="0.72123458"
-     inkscape:cx="372.04724"
-     inkscape:cy="526.18109"
+     inkscape:zoom="1"
+     inkscape:cx="342.68538"
+     inkscape:cy="391.54295"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
-     inkscape:window-width="1379"
-     inkscape:window-height="936"
-     inkscape:window-x="61"
+     inkscape:window-width="1280"
+     inkscape:window-height="1001"
+     inkscape:window-x="1280"
      inkscape:window-y="0"
      showguides="true"
      inkscape:guide-bbox="true"
@@ -747,5 +747,81 @@
          d="M 372.87905,411.27704 L 437.81346,411.27704"
          style="color:#000000;fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#dd8a3d;stroke-width:109.23947906;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:block" />
     </g>
+    <g
+       id="g2737">
+      <path
+         inkscape:export-ydpi="399.59854"
+         inkscape:export-xdpi="399.59854"
+         inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kune-logo-1200.png"
+         id="path2689"
+         d="M 298.07933,890.09763 C 297.3363,890.09763 296.6221,890.10025 295.90542,890.14704 C 295.83851,890.16067 295.77509,890.18388 295.70779,890.19644 C 295.04064,890.32105 294.38243,890.42731 293.6821,890.44348 C 293.58509,890.45708 293.48215,890.42895 293.38566,890.44348 C 287.66961,891.30403 282.84012,893.78596 278.95878,897.90395 C 274.42607,902.69101 272.14061,908.42577 272.1406,915.09763 C 272.1406,921.84435 274.42608,927.61807 278.95878,932.39012 C 283.86545,937.53616 290.24058,940.09761 298.07933,940.09763 C 302.23802,940.09761 306.23614,939.06435 310.03585,936.98498 C 313.8355,934.96547 317.1393,932.10715 319.96668,928.48696 L 311.41925,923.74388 C 307.7392,928.65056 303.21767,931.10554 297.8323,931.10554 C 294.09242,931.10554 290.7392,929.89235 287.85206,927.49882 C 284.91999,925.10531 283.45479,922.18991 283.45483,918.70435 L 322.53585,918.70435 L 322.53585,916.72806 C 322.53581,908.27602 319.67294,901.50799 313.98842,896.42174 C 309.20137,892.18827 303.89852,890.09769 298.07933,890.09763 z M 116.35996,890.44348 L 116.35996,909.3664 L 109.73941,909.3664 L 109.73941,919.0502 L 116.35996,919.0502 L 116.35996,938.81305 L 126.43901,938.81305 L 126.43901,919.0502 L 132.51609,919.0502 L 144.91728,938.81305 L 156.8738,938.81305 L 140.2236,913.71423 L 156.13269,891.38221 L 143.92913,891.38221 L 131.62676,909.3664 L 126.43901,909.3664 L 126.43901,890.44348 L 116.35996,890.44348 z M 240.02597,890.44348 C 238.29094,890.75314 236.67426,891.25714 235.18407,892.02451 C 232.67087,893.37089 230.68678,895.14652 229.20581,897.36048 L 229.20581,891.38221 L 219.07735,891.38221 L 219.07735,938.81305 L 229.20581,938.81305 L 229.20581,912.23202 C 229.2058,908.43237 230.27805,905.51695 232.41728,903.43755 C 234.57141,901.35823 237.30235,900.32493 240.66826,900.3249 C 244.22858,900.32493 247.00891,901.28027 248.96866,903.23992 C 250.9283,905.19964 251.88362,908.27094 251.88368,912.42965 L 251.88368,938.81305 L 262.01214,938.81305 L 262.01214,910.20633 C 262.01209,904.38713 260.23647,899.57918 256.67617,895.77945 C 254.00588,892.92972 250.91617,891.15594 247.38763,890.44348 L 240.02597,890.44348 z M 163.24732,891.38221 L 163.24732,918.85257 C 163.2473,925.28514 165.41585,930.48601 169.76905,934.46522 C 173.80809,938.20508 178.81094,940.09761 184.69,940.09763 C 190.62886,940.09761 195.60633,938.20508 199.66036,934.46522 C 204.01351,930.48601 206.18205,925.28514 206.1821,918.85257 L 206.1821,891.38221 L 196.05364,891.38221 L 196.05364,917.96324 C 196.05359,921.46376 194.98134,924.31165 192.84218,926.51067 C 190.62814,928.78452 187.93618,929.91976 184.69,929.91976 C 181.56346,929.91978 178.85062,928.76957 176.63664,926.51067 C 174.43759,924.23686 173.37574,921.40394 173.37577,917.96324 L 173.37577,891.38221 L 163.24732,891.38221 z M 296.79475,899.18854 C 300.10075,899.18859 302.9876,900.11537 305.44099,901.95534 C 307.8195,903.84025 309.57113,906.58618 310.67815,910.20633 L 283.45483,910.20633 C 284.24766,906.72081 285.89275,904.01387 288.34613,902.05415 C 290.72466,900.15434 293.53358,899.18859 296.79475,899.18854 z"
+         style="font-size:58.13353348px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#a56941;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Emblem" />
+      <g
+         inkscape:export-ydpi="399.59854"
+         inkscape:export-xdpi="399.59854"
+         inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kune-logo-1200.png"
+         transform="matrix(0.347343,0,0,0.346901,34.203754,588.03773)"
+         id="g2691">
+        <path
+           transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+           id="path2693"
+           d="M 60.321717,411.99998 L 437.33633,411.99998"
+           style="fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#dd8a3d;stroke-width:109.23953247;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:block" />
+        <path
+           transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+           id="path2695"
+           d="M 252.61203,788.60332 L 252.61203,411.59154"
+           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffdb6b;stroke-width:109.23950958;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:block" />
+        <path
+           transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+           id="path2697"
+           d="M 252.86937,597.15755 L 629.88177,597.15755"
+           style="fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#69312f;stroke-width:109.23951721;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:block" />
+        <path
+           transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+           id="path2699"
+           d="M 437.45588,596.97447 L 437.45588,219.95956"
+           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#cc6633;stroke-width:109.23950195;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:block" />
+        <path
+           transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+           id="path2701"
+           d="M 372.87905,411.27704 L 437.81346,411.27704"
+           style="fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#dd8a3d;stroke-width:109.23947906;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:block" />
+      </g>
+    </g>
+    <text
+       xml:space="preserve"
+       style="font-size:18.13397598px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:end;line-height:100%;writing-mode:lr-tb;text-anchor:end;fill:#dd8a3d;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Emblem;-inkscape-font-specification:Emblem"
+       x="954.11047"
+       y="752.78009"
+       id="text2703"
+       sodipodi:linespacing="100%"><tspan
+         sodipodi:role="line"
+         x="954.11047"
+         y="752.78009"
+         id="tspan2709">a web infrastructure to encourage collaboration,</tspan><tspan
+         sodipodi:role="line"
+         x="954.11047"
+         y="770.91406"
+         id="tspan2727">content sharing &amp; free culture</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:17.27686882px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:end;line-height:100%;writing-mode:lr-tb;text-anchor:end;fill:#dd8a3d;fill-opacity:1;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Emblem;-inkscape-font-specification:Emblem"
+       x="620.35358"
+       y="901.5686"
+       id="text2729"
+       sodipodi:linespacing="100%"><tspan
+         sodipodi:role="line"
+         x="625.28021"
+         y="901.5686"
+         id="tspan2731">a web infrastructure </tspan><tspan
+         sodipodi:role="line"
+         x="620.35358"
+         y="918.84546"
+         id="tspan2735">to encourage collaboration,</tspan><tspan
+         sodipodi:role="line"
+         x="620.35358"
+         y="936.12231"
+         id="tspan2733">content sharing &amp; free culture</tspan></text>
   </g>
 </svg>

Modified: trunk/script/generateBasicUIElements.sh
===================================================================
--- trunk/script/generateBasicUIElements.sh	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/script/generateBasicUIElements.sh	2009-03-30 13:48:35 UTC (rev 1089)
@@ -14,11 +14,11 @@
   fi
 
 # DO
-PACKAGE=`echo $DIR | cut -d "/" -f 4- | sed 's/\//\./g' | sed 's/\.$//g'
+PACKAGE=`echo $DIR | cut -d "/" -f 4- | sed 's/\//\./g' | sed 's/\.$//g'`
 
 if [[ ! -d $DIR ]]
 then
-  mkdir $DIR
+  mkdir -p $DIR
 fi
 
 cat <<EOF > $DIR/${NAME}.java

Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css	2009-03-30 13:48:35 UTC (rev 1089)
@@ -41,4 +41,4 @@
     padding: 1px 0px 1px 1px;
     text-decoration:none;
 }
-*/.x-tree-node .k-ctn-status-normal a span{}.x-tree-node .k-ctn-status-deleted a span{text-decoration:line-through;color:gray;}.x-tree-node .k-ctn-status-rejected a span{text-decoration:line-through;/* color: #FF6633; */color:#F30;}.x-tree-node .k-ctn-status-editing a span{font-style:italic;color:gray;}.x-tree-node .k-ctn-status-submitted a span{color:green;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-link-icon{background-image:url(img/link.gif)!important;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-copyleft-icon{background-image:url(img/copyleft.png)!important;}.k-picture-icon{background-image:url(img/picture.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.k-newgroup-icon{background-image:url(img/kune-icon16.png)!important;}.k-colors-icon{background-image:url(img/colors.gif)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}/* duplicated in rte.css */.k-rte-comment{border:1px dashed silver;line-height:1.4;padding:1px;background-color:#D7FFD7;}.k-specialchar-grid{border:1px solid #ACA899;}.k-specialchar-grid table{}.k-specialchar-grid div{line-height:22px;}.k-specialchar-grid td{padding:1px;}.k-specialchar-pb{border:1px solid #EBE8D7;cursor:pointer;font-size:108%!important;text-align:center;vertical-align:middle;width:18px;height:18px;}.k-specialchar-pb-up{}.k-specialchar-big{padding:3px;line-height:22px;font-size:153.899994%!important;}.k-specialchar-adv-label{margin-left:-10px;}.k-specialchar-popup{border:1px solid silver;z-index:9999!important;background-color:#FFF;}.k-specialchar-pb-down{color:#161616;}.k-specialchar-pb-up-hovering{border:thin solid #ACA899;}.k-specialchar-pb-down-hovering{color:#161616;}
\ No newline at end of file
+*/.x-tree-node .k-ctn-status-normal a span{}.x-tree-node .k-ctn-status-deleted a span{text-decoration:line-through;color:gray;}.x-tree-node .k-ctn-status-rejected a span{text-decoration:line-through;/* color: #FF6633; */color:#F30;}.x-tree-node .k-ctn-status-editing a span{font-style:italic;color:gray;}.x-tree-node .k-ctn-status-submitted a span{color:green;}.k-info-links{text-decoration:underline;color:gray;cursor:pointer;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}.k-basic-thumb{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-basic-thumb td{padding:2px 3px;border:none;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;overflow:hidden;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-link-icon{background-image:url(img/link.gif)!important;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}.k-copyleft-icon{background-image:url(img/copyleft.png)!important;}.k-picture-icon{background-image:url(img/picture.png)!important;}.k-film-icon{background-image:url(img/film.png)!important;}.k-specialchars-icon{background-image:url(img/specialchars.png)!important;}.k-info-icon{background-image:url(img/info.gif)!important;}.k-newgroup-icon{background-image:url(img/kune-icon16.png)!important;}.k-colors-icon{background-image:url(img/colors.gif)!important;}.x-toolbar-body table{/* width: 100%; */}.k-preview-msg{background:#FCA;}.k-preview-msg-lab{background:#FCA;padding:0 5px;}.k-eil-edit{border:thin solid #000;}/* duplicated in rte.css */.k-rte-comment{border:1px dashed silver;line-height:1.4;padding:1px;background-color:#D7FFD7;}.k-specialchar-grid{border:1px solid #ACA899;}.k-specialchar-grid table{}.k-specialchar-grid div{line-height:22px;}.k-specialchar-grid td{padding:1px;}.k-specialchar-pb{border:1px solid #EBE8D7;cursor:pointer;font-size:108%!important;text-align:center;vertical-align:middle;width:18px;height:18px;}.k-specialchar-pb-up{}.k-specialchar-big{padding:3px;line-height:22px;font-size:153.899994%!important;}.k-specialchar-adv-label{margin-left:-10px;}.k-specialchar-popup,.k-rte-changelink-popup{border:1px solid silver;z-index:9999!important;background-color:#FFF;}.k-specialchar-pb-down{color:#161616;}.k-specialchar-pb-up-hovering{border:thin solid #ACA899;}.k-specialchar-pb-down-hovering{color:#161616;}.k-preview-panel{border:dashed 1px gray;}.k-rte-changelink{white-space:nowrap;color:navy;cursor:pointer;text-decoration:underline;margin:5px;}
\ No newline at end of file

Added: trunk/src/main/java/org/ourproject/kune/app/public/css/img/film.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/css/img/film.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/org/ourproject/kune/app/public/css/img/specialchars.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/css/img/specialchars.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css	2009-03-30 13:48:35 UTC (rev 1089)
@@ -841,6 +841,14 @@
   background-image: url(img/picture.png) !important;
 }
 
+.k-film-icon {
+  background-image: url(img/film.png) !important;
+}
+
+.k-specialchars-icon {
+  background-image: url(img/specialchars.png) !important;
+}
+
 .k-info-icon {
   background-image: url(img/info.gif) !important;
 }
@@ -854,6 +862,7 @@
 }
 
 .x-toolbar-body table { /* width: 100%; */
+
 }
 
 .k-preview-msg {
@@ -904,6 +913,7 @@
 }
 
 .k-specialchar-pb-up {
+
 }
 
 .k-specialchar-big {
@@ -916,7 +926,7 @@
   margin-left: -10px;
 }
 
-.k-specialchar-popup {
+.k-specialchar-popup, {
   border: 1px solid #C0C0C0;
   z-index: 9999 !important;
   background-color: #FFF;
@@ -932,4 +942,22 @@
 
 .k-specialchar-pb-down-hovering {
   color: #161616;
+}
+
+.k-preview-panel {
+  border: dashed 1px gray;
+}
+
+.k-rte-changelink {
+  white-space: nowrap;
+  color: navy;
+  cursor: pointer;
+  text-decoration: underline;
+  margin: 5px;
+}
+
+.k-rte-changelink-popup {
+  border: 1px solid #C0C0C0;
+  z-index: 9999 !important;
+  background-color: #ECECEC;
 }
\ No newline at end of file

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -79,6 +79,7 @@
         createNewContentAction(TYPE_DOCUMENT, "images/nav/page_add.png", i18n.t("New document"), parentMenuTitleCtx,
                 Position.ctx, TYPE_ROOT, TYPE_FOLDER);
 
+        createTranslateAction(parentMenuTitle, TYPE_DOCUMENT, TYPE_FOLDER);
         createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
         createEditAction(parentMenuTitle, TYPE_DOCUMENT);
         createContentModeratedActions(parentMenuTitle, contentsModerated);
@@ -101,8 +102,6 @@
 
         createGoHomeAction(containers);
 
-        createTranslateAction(TYPE_DOCUMENT, TYPE_FOLDER);
-
         createDelContainerAction("Delete folder", parentMenuTitleCtx, containersNoRoot);
         createDelContentAction(parentMenuTitle, i18n.t("Delete"), contents);
         createShowDeletedItems(parentMenuTitleCtx, all);

Added: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionMenuItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionMenuItem.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionMenuItem.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,71 @@
+package org.ourproject.kune.platf.client.actions.toolbar;
+
+import org.ourproject.kune.platf.client.actions.ActionItem;
+import org.ourproject.kune.platf.client.actions.ActionToolbarMenuCheckItemDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor;
+
+import com.calclab.suco.client.events.Listener0;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.menu.BaseItem;
+import com.gwtext.client.widgets.menu.CheckItem;
+import com.gwtext.client.widgets.menu.Item;
+import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
+
+public class ActionMenuItem<T> {
+
+    Item item;
+
+    public ActionMenuItem(final ActionItem<T> actionItem, final String id, final Listener0 onclick) {
+        final ActionToolbarMenuDescriptor<T> action = (ActionToolbarMenuDescriptor<T>) actionItem.getAction();
+        if (action instanceof ActionToolbarMenuRadioDescriptor) {
+            CheckItem checkItem = new CheckItem();
+            ActionToolbarMenuRadioDescriptor<T> radioDescriptor = (ActionToolbarMenuRadioDescriptor<T>) action;
+            checkItem.setGroup(radioDescriptor.getGroup());
+            checkItem.setChecked(radioDescriptor.mustBeChecked());
+            item = checkItem;
+        } else if (action instanceof ActionToolbarMenuCheckItemDescriptor) {
+            CheckItem checkItem = new CheckItem();
+            ActionToolbarMenuCheckItemDescriptor<T> checkItemDescriptor = (ActionToolbarMenuCheckItemDescriptor<T>) action;
+            checkItem.setChecked(checkItemDescriptor.getMustBeChecked().mustBeChecked());
+            item = checkItem;
+        } else {
+            item = new Item();
+        }
+        item.setText(genMenuItemText(action));
+        BaseItemListenerAdapter clickListener = new BaseItemListenerAdapter() {
+            @Override
+            public void onClick(final BaseItem item, final EventObject e) {
+                onclick.onEvent();
+            }
+        };
+        item.addListener(clickListener);
+        String iconCls = action.getIconCls();
+        String iconUrl = action.getIconUrl();
+        if (iconCls != null) {
+            item.setIconCls(iconCls);
+        }
+        if (iconUrl != null) {
+            item.setIcon(iconUrl);
+        }
+        item.setTitle(action.getToolTip());
+        if (id != null) {
+            item.setId(id);
+        }
+    }
+
+    public Item getItem() {
+        return item;
+    }
+
+    private String genMenuItemText(final ActionToolbarMenuDescriptor<T> action) {
+        // HorizontalPanel hp = new HorizontalPanel();
+        // Label title = new Label(action.getText());
+        // hp.add(title);
+        // hp.setCellWidth(title, "100%");
+        // hp.add(new Label(action.getShortcutToS(i 18n)));
+        // return hp.getElement().getInnerHTML();
+        return action.getText() + action.getShortcutToS();
+    }
+
+}

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -26,9 +26,7 @@
 import org.ourproject.kune.platf.client.actions.ActionManager;
 import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
 import org.ourproject.kune.platf.client.actions.ActionToolbarButtonSeparator;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuCheckItemDescriptor;
 import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor;
 import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
 import org.ourproject.kune.platf.client.ui.AbstractToolbar;
 import org.ourproject.kune.platf.client.ui.FlowToolbar;
@@ -38,15 +36,11 @@
 import com.calclab.suco.client.events.Listener0;
 import com.calclab.suco.client.ioc.Provider;
 import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.core.EventObject;
 import com.gwtext.client.core.Ext;
 import com.gwtext.client.widgets.ToolbarButton;
-import com.gwtext.client.widgets.menu.BaseItem;
-import com.gwtext.client.widgets.menu.CheckItem;
 import com.gwtext.client.widgets.menu.Item;
 import com.gwtext.client.widgets.menu.Menu;
 import com.gwtext.client.widgets.menu.MenuItem;
-import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
 
 public class ActionToolbarPanel<T> implements ActionToolbarView<T> {
 
@@ -60,7 +54,7 @@
         this(actionManagerProvider, false);
     }
 
-    public ActionToolbarPanel(final Provider<ActionManager> actionManagerProvider, boolean flow) {
+    public ActionToolbarPanel(final Provider<ActionManager> actionManagerProvider, final boolean flow) {
         if (flow) {
             toolbar = new FlowToolbar();
         } else {
@@ -124,7 +118,7 @@
     public void detach() {
     }
 
-    public int getLeftPosition(ActionDescriptor<T> action) {
+    public int getLeftPosition(final ActionDescriptor<T> action) {
         final ToolbarButton button = findButton(action);
         if (button != null) {
             return button.getAbsoluteLeft();
@@ -136,7 +130,7 @@
         return toolbar;
     }
 
-    public int getTopPosition(ActionDescriptor<T> action) {
+    public int getTopPosition(final ActionDescriptor<T> action) {
         final ToolbarButton button = findButton(action);
         if (button != null) {
             return button.getAbsoluteTop();
@@ -167,7 +161,8 @@
         toolbar.setNormalStyle();
     }
 
-    public void setParentMenuTitle(ActionToolbarPosition position, String origTitle, String origTooltip, String newTitle) {
+    public void setParentMenuTitle(final ActionToolbarPosition position, final String origTitle,
+            final String origTooltip, final String newTitle) {
         final String menuKey = genMenuKey(position, origTitle, origTooltip, null, null);
         ToolbarButton button = buttons.get(menuKey);
         if (button != null) {
@@ -208,59 +203,27 @@
         toolbar.add(widget);
     }
 
-    private void addFloatStyle(Widget widget) {
+    private void addFloatStyle(final Widget widget) {
         if (toolbar instanceof FlowToolbar) {
             widget.addStyleName("kune-floatleft");
         }
     }
 
-    private void addSeparator(Menu menu, boolean separator) {
+    private void addSeparator(final Menu menu, final boolean separator) {
         if (separator) {
             menu.addSeparator();
         }
     }
 
     private Item createToolbarMenu(final ActionToolbarPosition toolBarPos, final String menuTitle,
-            final String menuTooltip, final String menuSubTitle, final ActionItem<T> actionItem, String id) {
+            final String menuTooltip, final String menuSubTitle, final ActionItem<T> actionItem, final String id) {
         final ActionToolbarMenuDescriptor<T> action = (ActionToolbarMenuDescriptor<T>) actionItem.getAction();
-        final Item item;
-        if (action instanceof ActionToolbarMenuRadioDescriptor) {
-            CheckItem checkItem = new CheckItem();
-            ActionToolbarMenuRadioDescriptor<T> radioDescriptor = (ActionToolbarMenuRadioDescriptor<T>) action;
-            checkItem.setGroup(radioDescriptor.getGroup());
-            checkItem.setChecked(radioDescriptor.mustBeChecked());
-            item = checkItem;
-        } else if (action instanceof ActionToolbarMenuCheckItemDescriptor) {
-            CheckItem checkItem = new CheckItem();
-            ActionToolbarMenuCheckItemDescriptor<T> checkItemDescriptor = (ActionToolbarMenuCheckItemDescriptor<T>) action;
-            checkItem.setChecked(checkItemDescriptor.getMustBeChecked().mustBeChecked());
-            item = checkItem;
-        } else {
-            item = new Item();
-        }
-        item.setText(genMenuItemText(action));
-        BaseItemListenerAdapter clickListener = new BaseItemListenerAdapter() {
-            @Override
-            public void onClick(BaseItem item, EventObject e) {
+
+        Item item = (new ActionMenuItem<T>(actionItem, id, new Listener0() {
+            public void onEvent() {
                 actionManagerProvider.get().doAction(actionItem);
             }
-        };
-        item.addListener(clickListener);
-        String iconCls = action.getIconCls();
-        String iconUrl = action.getIconUrl();
-        if (iconCls != null) {
-            item.setIconCls(iconCls);
-        }
-        if (iconUrl != null) {
-            item.setIcon(iconUrl);
-        }
-        // ToolTip tip = new ToolTip();
-        // tip.setHtml(action.getToolTip());
-        // tip.setShowDelay(5000);
-        item.setTitle(action.getToolTip());
-        if (id != null) {
-            item.setId(id);
-        }
+        })).getItem();
 
         final String menuKey = genMenuKey(toolBarPos, menuTitle, menuTooltip, null, null);
         final String subMenuKey = genMenuKey(toolBarPos, menuTitle, menuTooltip, menuSubTitle, null);
@@ -294,7 +257,7 @@
     }
 
     private Menu createToolbarMenu(final ActionToolbarPosition barPosition, final String iconUrl, final String iconCls,
-            final String menuTitle, final String menuKey, final String menuTooltip, int position) {
+            final String menuTitle, final String menuKey, final String menuTooltip, final int position) {
         final Menu menu = new Menu();
         menu.setShadow(true);
         final ToolbarButton toolbarMenu = new ToolbarButton(menuTitle);
@@ -330,16 +293,6 @@
         return id;
     }
 
-    private String genMenuItemText(final ActionToolbarMenuDescriptor<T> action) {
-        // HorizontalPanel hp = new HorizontalPanel();
-        // Label title = new Label(action.getText());
-        // hp.add(title);
-        // hp.setCellWidth(title, "100%");
-        // hp.add(new Label(action.getShortcutToS(i 18n)));
-        // return hp.getElement().getInnerHTML();
-        return action.getText() + action.getShortcutToS();
-    }
-
     private String genMenuKey(final ActionToolbarPosition pos, final String menuTitle, final String menuTooltip,
             final String menuSubTitle, final String actionText) {
 

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -23,6 +23,7 @@
 import org.ourproject.kune.platf.client.app.EntityOptionsGroup;
 import org.ourproject.kune.platf.client.app.ToolGroup;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertMediaGroup;
 import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkGroup;
 import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharGroup;
 
@@ -36,6 +37,7 @@
         registerDecorator(ToolGroup.class, new ToolGroup(container));
         registerDecorator(EntityOptionsGroup.class, new EntityOptionsGroup(container));
         registerDecorator(InsertImageGroup.class, new InsertImageGroup(container));
+        registerDecorator(InsertMediaGroup.class, new InsertMediaGroup(container));
         registerDecorator(InsertLinkGroup.class, new InsertLinkGroup(container));
         registerDecorator(InsertSpecialCharGroup.class, new InsertSpecialCharGroup(container));
     }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -73,6 +73,7 @@
 import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialogPanel;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialogPresenter;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertMediaGroup;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.ext.InsertImageExt;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.ext.InsertImageExtPanel;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.ext.InsertImageExtPresenter;
@@ -87,6 +88,13 @@
 import org.ourproject.kune.platf.client.ui.rte.insertlink.ext.InsertLinkExtPanel;
 import org.ourproject.kune.platf.client.ui.rte.insertlink.ext.InsertLinkExtPresenter;
 import org.ourproject.kune.platf.client.ui.rte.insertlink.ext.InsertLinkExtView;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ExternalMediaRegistry;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialogPanel;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialogPresenter;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ext.InsertExtMedia;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ext.InsertExtMediaPanel;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ext.InsertExtMediaPresenter;
 import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
 import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialogPanel;
 import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialogPresenter;
@@ -330,7 +338,7 @@
                 final RTEditorPresenter presenter = new RTEditorPresenter($(I18nTranslationService.class),
                         $(Session.class), topBar, sndBar, $(RTEImgResources.class), $$(InsertLinkDialog.class),
                         $$(ColorWebSafePalette.class), $$(EditHtmlDialog.class), $$(InsertImageDialog.class),
-                        $$(InsertTableDialog.class), $$(InsertSpecialCharDialog.class), $(DeferredCommandWrapper.class));
+                        $$(InsertMediaDialog.class),   $$(InsertTableDialog.class), $$(InsertSpecialCharDialog.class), $(DeferredCommandWrapper.class));
                 final RTEditorPanel panel = new RTEditorPanel(presenter, $(I18nUITranslationService.class),
                         $(ActionManager.class), $(GlobalShortcutRegister.class));
                 presenter.init(panel);
@@ -479,6 +487,32 @@
             }
         });
 
+        register(InsertMediaGroup.class, new Factory<InsertExtMedia>(InsertExtMedia.class) {
+            @Override
+            public InsertExtMedia create() {
+                final InsertExtMediaPresenter presenter = new InsertExtMediaPresenter($(InsertMediaDialog.class), $(ExternalMediaRegistry.class));
+                final InsertExtMediaPanel panel = new InsertExtMediaPanel(presenter, i18n, $(ExternalMediaRegistry.class));
+                presenter.init(panel);
+                return presenter;
+            }
+        });
+
+        register(Singleton.class, new Factory<InsertMediaDialog>(InsertMediaDialog.class) {
+            @Override
+            public InsertMediaDialog create() {
+                final InsertMediaDialogPresenter presenter = new InsertMediaDialogPresenter();
+                final InsertMediaDialogPanel panel = new InsertMediaDialogPanel(presenter, i18n, $(Images.class), $(InsertMediaGroup.class));
+                presenter.init(panel);
+                return presenter;
+            }
+        });
+
+        register(Singleton.class, new Factory<ExternalMediaRegistry>(ExternalMediaRegistry.class) {
+            @Override
+            public ExternalMediaRegistry create() {
+                return new ExternalMediaRegistry();
+            }});
+
         $(ApplicationComponentGroup.class).createAll();
         $(ToolGroup.class).createAll();
         $(Application.class).start();

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/AbstractTabbedDialogPresenter.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -26,11 +26,11 @@
 
     private AbstractTabbedDialogView view;
 
-    public void activateTab(int index) {
+    public void activateTab(final int index) {
         view.activateTab(index);
     }
 
-    public void addTab(View tab) {
+    public void addTab(final View tab) {
         view.addTab(tab);
     }
 
@@ -46,19 +46,20 @@
         view.hideMessages();
     }
 
-    public void init(AbstractTabbedDialogView view) {
+    public void init(final AbstractTabbedDialogView view) {
         this.view = view;
     }
 
-    public void insertTab(int index, View tab) {
+    public void insertTab(final int index, final View tab) {
         view.insertTab(index, tab);
     }
 
-    public void setErrorMessage(String message, Level level) {
+    public void setErrorMessage(final String message, final Level level) {
         view.setErrorMessage(message, level);
     }
 
     public void show() {
+        hideMessages();
         view.createAndShow();
     }
 

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTELinkPopup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTELinkPopup.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTELinkPopup.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,48 @@
+package org.ourproject.kune.platf.client.ui.rte.basic;
+
+import org.ourproject.kune.platf.client.actions.ActionItem;
+
+import com.calclab.suco.client.events.Listener0;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.PopupPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class RTELinkPopup {
+    private final HorizontalPanel hp;
+    private PopupPanel popupPalette;
+
+    public RTELinkPopup() {
+        hp = new HorizontalPanel();
+        hp.setSpacing(5);
+    }
+
+    public void addAction(final ActionItem<Object> item, final Listener0 onClick) {
+        Label actionLabel = new Label();
+        actionLabel.setText(item.getAction().getText());
+        actionLabel.addStyleName("k-rte-changelink");
+        actionLabel.addClickListener(new ClickListener() {
+            public void onClick(final Widget arg0) {
+                onClick.onEvent();
+            }
+        });
+        hp.add(actionLabel);
+    }
+
+    public void hide() {
+        if (popupPalette != null) {
+            popupPalette.hide();
+        }
+    }
+
+    public void show(final int left, final int top) {
+        popupPalette = new PopupPanel(false, false);
+        popupPalette.addStyleName("k-rte-changelink-popup");
+        popupPalette.setVisible(false);
+        popupPalette.show();
+        popupPalette.setPopupPosition(left, top);
+        popupPalette.setWidget(hp);
+        popupPalette.setVisible(true);
+    }
+}

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditor.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditor.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -13,6 +13,7 @@
 
     public final ActionToolbarPosition topbarPosition = new ActionToolbarPosition("rte-topbar");
     public final ActionToolbarPosition sndbarPosition = new ActionToolbarPosition("rte-sndbar");;
+    public final ActionToolbarPosition linkCtxPosition = new ActionToolbarPosition("rte-linkctx");;
 
     void addAction(ActionDescriptor<Object> action);
 

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -28,8 +28,11 @@
 import org.xwiki.gwt.dom.client.Range;
 import org.xwiki.gwt.dom.client.Selection;
 
+import com.calclab.suco.client.events.Listener0;
 import com.google.gwt.dom.client.Element;
+import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.Event;
 import com.google.gwt.user.client.ui.FocusListener;
 import com.google.gwt.user.client.ui.Widget;
@@ -38,11 +41,11 @@
 
     private class EventListener implements FocusListener {
 
-        public void onFocus(Widget sender) {
+        public void onFocus(final Widget sender) {
             presenter.onEditorFocus();
         }
 
-        public void onLostFocus(Widget sender) {
+        public void onLostFocus(final Widget sender) {
         }
     }
     private final I18nUITranslationService i18n;
@@ -52,9 +55,10 @@
     private final ActionManager actionManager;
     private final ShortcutRegister shortcutRegister;
     private final GlobalShortcutRegister globalShortcutReg;
+    private final RTELinkPopup linkCtxMenu;
 
-    public RTEditorPanel(final RTEditorPresenter presenter, I18nUITranslationService i18n,
-            final ActionManager actionManager, GlobalShortcutRegister globalShortcutReg) {
+    public RTEditorPanel(final RTEditorPresenter presenter, final I18nUITranslationService i18n,
+            final ActionManager actionManager, final GlobalShortcutRegister globalShortcutReg) {
         this.presenter = presenter;
         this.i18n = i18n;
         this.actionManager = actionManager;
@@ -66,10 +70,10 @@
         addFocusListener(listener);
         setWidth("96%");
         setHeight("100%");
-
+        linkCtxMenu = new RTELinkPopup();
     }
 
-    public void addActions(ActionItemCollection<Object> actionItems) {
+    public void addActions(final ActionItemCollection<Object> actionItems) {
         for (ActionItem<Object> actionItem : actionItems) {
             ActionDescriptor<Object> action = actionItem.getAction();
             if (action.hasShortcut() && action.mustBeAdded(null)) {
@@ -79,7 +83,15 @@
         }
     }
 
-    public void adjustSize(int height) {
+    public void addCtxAction(final ActionItem<Object> actionItem) {
+        linkCtxMenu.addAction(actionItem, new Listener0() {
+            public void onEvent() {
+                actionManager.doAction(actionItem);
+            }
+        });
+    }
+
+    public void adjustSize(final int height) {
         setHeight("" + height);
     }
 
@@ -95,7 +107,7 @@
         extended.copy();
     }
 
-    public void createLink(String url) {
+    public void createLink(final String url) {
         extended.createLink(url);
     }
 
@@ -141,6 +153,10 @@
         return getFstRange().cloneContents().getInnerText();
     }
 
+    public void hideLinkCtxMenu() {
+        linkCtxMenu.hide();
+    }
+
     public void insertBlockquote() {
         DocumentFragment extracted = getFstRange().cloneContents();
         // delete();
@@ -148,18 +164,18 @@
         focus();
     }
 
-    public void insertComment(String author) {
+    public void insertComment(final String author) {
         String comment = null;
         createCommentAndSelectIt(author, comment);
     }
 
-    public void insertCommentNotUsingSelection(String author) {
+    public void insertCommentNotUsingSelection(final String author) {
         getFstRange().collapse(false);
         createCommentAndSelectIt(author, null);
         focus();
     }
 
-    public void insertCommentUsingSelection(String author) {
+    public void insertCommentUsingSelection(final String author) {
         DocumentFragment extracted = getFstRange().cloneContents();
         extended.delete();
         String comment = extracted.getInnerText();
@@ -171,11 +187,11 @@
         extended.insertHorizontalRule();
     }
 
-    public void insertHtml(String html) {
+    public void insertHtml(final String html) {
         extended.insertHtml(html);
     }
 
-    public void insertImage(String url) {
+    public void insertImage(final String url) {
         extended.insertImage(url);
     }
 
@@ -203,6 +219,14 @@
         return basic.isItalic();
     }
 
+    public boolean isLink() {
+        if (LinkExecutableUtils.getSelectedAnchor(this) != null) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
     public boolean isStrikethrough() {
         return extended.isStrikethrough();
     }
@@ -237,7 +261,7 @@
 
     @SuppressWarnings("unchecked")
     @Override
-    public void onBrowserEvent(Event event) {
+    public void onBrowserEvent(final Event event) {
         switch (DOM.eventGetType(event)) {
         case Event.ONCLICK:
             updateStatus();
@@ -256,6 +280,7 @@
             } else {
                 super.onBrowserEvent(event);
                 updateStatus();
+                updateLinkInfo();
                 if (isAnEditionKey(event.getKeyCode())) {
                     fireEdit();
                 }
@@ -288,22 +313,33 @@
         basic.selectAll();
     }
 
-    public void setBackColor(String color) {
+    public void setBackColor(final String color) {
         basic.setBackColor(color);
     }
 
-    public void setFontName(String name) {
+    public void setFontName(final String name) {
         basic.setFontName(name);
     }
 
-    public void setFontSize(FontSize size) {
+    public void setFontSize(final FontSize size) {
         basic.setFontSize(size);
     }
 
-    public void setForeColor(String color) {
+    public void setForeColor(final String color) {
         basic.setForeColor(color);
     }
 
+    public void showLinkCtxMenu() {
+        DeferredCommand.addCommand(new Command() {
+            public void execute() {
+                org.xwiki.gwt.dom.client.Element selectedAnchor = LinkExecutableUtils.getSelectedAnchor(RTEditorPanel.this);
+                linkCtxMenu.show(RTEditorPanel.this.getAbsoluteLeft() + selectedAnchor.getAbsoluteLeft(),
+                        RTEditorPanel.this.getAbsoluteTop() + selectedAnchor.getAbsoluteTop() + 20);
+            }
+        });
+
+    }
+
     public void toggleBold() {
         basic.toggleBold();
     }
@@ -340,7 +376,7 @@
         presenter.fireOnEdit();
     }
 
-    private void createCommentAndSelectIt(String author, String comment) {
+    private void createCommentAndSelectIt(final String author, final String comment) {
         Element commentEl = createCommentElement(author, comment);
         Range innerCommentRange = getDocument().createRange();
         getFstRange().insertNode(commentEl);
@@ -349,7 +385,7 @@
         fireEdit();
     }
 
-    private Element createCommentElement(String userName, String insertComment) {
+    private Element createCommentElement(final String userName, final String insertComment) {
         String time = i18n.formatDateWithLocale(new Date(), true);
         Element span = getDocument().createSpanElement();
         String comment = insertComment != null ? insertComment : i18n.t("type your comment here");
@@ -367,7 +403,7 @@
         return getDocument().getSelection();
     }
 
-    private boolean isAnEditionKey(int keyCode) {
+    private boolean isAnEditionKey(final int keyCode) {
         if (keyCode != KEY_HOME && keyCode != KEY_END && keyCode != KEY_UP && keyCode != KEY_DOWN
                 && keyCode != KEY_LEFT && keyCode != KEY_RIGHT && keyCode != KEY_PAGEDOWN && keyCode != KEY_PAGEUP
                 && keyCode != KEY_ESCAPE) {
@@ -377,6 +413,10 @@
         }
     }
 
+    private void updateLinkInfo() {
+        presenter.updateLinkInfo();
+    }
+
     /**
      * Updates the status of all the stateful buttons.
      */

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -16,7 +16,6 @@
 import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
 import org.ourproject.kune.platf.client.shortcuts.ShortcutDescriptor;
 import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.ui.TextUtils;
 import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
 import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
 import org.ourproject.kune.platf.client.ui.rte.RichTextArea;
@@ -26,6 +25,7 @@
 import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialog;
 import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialog;
 import org.ourproject.kune.platf.client.ui.rte.insertlink.LinkInfo;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
 import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
 import org.ourproject.kune.platf.client.ui.rte.inserttable.InsertTableDialog;
 import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
@@ -75,17 +75,19 @@
     private Listener<String> insertTableListener;
     private Listener<LinkInfo> insertLinkListener;
     private Listener<ImageInfo> insertImageListener;
+    private Listener<String> insertMediaListener;
     private Listener<String> updateHtmlListener;
     private ActionToolbarButtonDescriptor<Object> insertTableBtn;
     private final Provider<InsertSpecialCharDialog> insertSpecialCharDialog;
     protected Listener<String> insertSpecialCharListener;
+    private final Provider<InsertMediaDialog> insertMediaDialog;
 
-    public RTEditorPresenter(I18nTranslationService i18n, Session session, RTEActionTopToolbar topBar,
-            RTEActionSndToolbar sndBar, RTEImgResources imgResources,
-            Provider<InsertLinkDialog> textEditorInsertElement, Provider<ColorWebSafePalette> palette,
-            Provider<EditHtmlDialog> editHtmlDialog, Provider<InsertImageDialog> insertImageDialog,
-            Provider<InsertTableDialog> insertTableDialog, Provider<InsertSpecialCharDialog> insertSpecialCharDialog,
-            DeferredCommandWrapper deferred) {
+    public RTEditorPresenter(final I18nTranslationService i18n, final Session session,
+            final RTEActionTopToolbar topBar, final RTEActionSndToolbar sndBar, final RTEImgResources imgResources,
+            final Provider<InsertLinkDialog> textEditorInsertElement, final Provider<ColorWebSafePalette> palette,
+            final Provider<EditHtmlDialog> editHtmlDialog, final Provider<InsertImageDialog> insertImageDialog,
+            final Provider<InsertMediaDialog> insertMediaDialog, final Provider<InsertTableDialog> insertTableDialog,
+            final Provider<InsertSpecialCharDialog> insertSpecialCharDialog, final DeferredCommandWrapper deferred) {
         this.i18n = i18n;
         this.session = session;
         this.topBar = topBar;
@@ -94,6 +96,7 @@
         this.palette = palette;
         this.editHtmlDialog = editHtmlDialog;
         this.insertImageDialog = insertImageDialog;
+        this.insertMediaDialog = insertMediaDialog;
         this.insertTableDialog = insertTableDialog;
         this.insertSpecialCharDialog = insertSpecialCharDialog;
         this.deferred = deferred;
@@ -105,22 +108,22 @@
         actions = new ActionItemCollection<Object>();
         this.onEdit = new Event0("onRTEEdit");
         canBeBasic = new ActionAddCondition<Object>() {
-            public boolean mustBeAdded(Object param) {
+            public boolean mustBeAdded(final Object param) {
                 return view.canBeBasic();
             }
         };
         canBeExtended = new ActionAddCondition<Object>() {
-            public boolean mustBeAdded(Object param) {
+            public boolean mustBeAdded(final Object param) {
                 return isExtended();
             }
         };
     }
 
-    public void addAction(ActionDescriptor<Object> action) {
+    public void addAction(final ActionDescriptor<Object> action) {
         actions.add(withNoItem(action));
     }
 
-    public void addActions(ActionCollection<Object> actioncollection) {
+    public void addActions(final ActionCollection<Object> actioncollection) {
         actions.addAll(withNoItem(actioncollection));
     }
 
@@ -177,7 +180,7 @@
         return topBar;
     }
 
-    public void init(RTEditorView view) {
+    public void init(final RTEditorView view) {
         this.view = view;
         createBasicActions();
     }
@@ -188,24 +191,32 @@
         palette.get().hide();
     }
 
-    public void setExtended(boolean extended) {
+    public void setExtended(final boolean extended) {
         this.extended = extended;
     }
 
-    public void setFocus(boolean focus) {
+    public void setFocus(final boolean focus) {
         view.setFocus(focus);
     }
 
-    public void setHtml(String html) {
+    public void setHtml(final String html) {
         view.setHTML(html);
         view.focus();
     }
 
-    public void setText(String text) {
+    public void setText(final String text) {
         view.setText(text);
         view.focus();
     }
 
+    public void updateLinkInfo() {
+        if (isExtended() && view.isLink()) {
+            view.showLinkCtxMenu();
+        } else {
+            view.hideLinkCtxMenu();
+        }
+    }
+
     public void updateStatus() {
         if (view.canBeBasic()) {
             sndBar.setPushButtonPressed(bold, view.isBold());
@@ -424,7 +435,7 @@
                     public void onEvent() {
                         if (updateHtmlListener == null) {
                             updateHtmlListener = new Listener<String>() {
-                                public void onEvent(String html) {
+                                public void onEvent(final String html) {
                                     view.setHTML(html);
                                     fireOnEdit();
                                 }
@@ -474,7 +485,7 @@
                     }
                 });
         comment.setEnableCondition(new ActionEnableCondition<Object>() {
-            public boolean mustBeEnabled(Object param) {
+            public boolean mustBeEnabled(final Object param) {
                 return session.isLogged();
             }
         });
@@ -587,7 +598,7 @@
                             public void onEvent() {
                                 if (insertImageListener == null) {
                                     insertImageListener = new Listener<ImageInfo>() {
-                                        public void onEvent(ImageInfo imageInfo) {
+                                        public void onEvent(final ImageInfo imageInfo) {
                                             String img = imageInfo.toString();
                                             Log.debug("Image: " + imageInfo);
                                             view.focus();
@@ -597,9 +608,7 @@
                                     };
                                 }
                                 InsertImageDialog dialog = insertImageDialog.get();
-                                dialog.setImageInfo(new ImageInfo("", ImageInfo.DEF_WRAP_VALUE,
-                                        ImageInfo.DEF_CLICK_ORIGINAL_VALUE, ImageInfo.POSITION_LEFT,
-                                        ImageInfo.SIZE_ORIGINAL));
+                                dialog.reset();
                                 dialog.setOnCreateImage(insertImageListener);
                                 dialog.show();
                             }
@@ -616,34 +625,64 @@
         imgMenu.setParentMenuTitle(i18n.t(INSERT_MENU));
         imgMenu.setActionPosition(topbarPosition);
 
+        final ActionToolbarMenuDescriptor<Object> insertMedia = new ActionToolbarMenuDescriptor<Object>(accessRol,
+                topbarPosition, new Listener0() {
+                    public void onEvent() {
+                        deferred.addCommand(new Listener0() {
+                            public void onEvent() {
+                                if (insertMediaListener == null) {
+                                    insertMediaListener = new Listener<String>() {
+                                        public void onEvent(final String html) {
+                                            Log.debug("Media: " + html);
+                                            view.focus();
+                                            view.insertHtml(html);
+                                            fireOnEdit();
+                                        }
+                                    };
+                                }
+                                InsertMediaDialog dialog = insertMediaDialog.get();
+                                dialog.setOnCreate(insertMediaListener);
+                                dialog.show();
+                            }
+                        });
+                    }
+                });
+        insertMedia.setIconCls(getCssName(imgResources.film()));
+        insertMedia.setTextDescription(i18n.t("Audio/Video..."));
+        insertMedia.setAddCondition(canBeExtended);
+        insertMedia.setParentMenuTitle(i18n.t(INSERT_MENU));
+
         ActionToolbarButtonDescriptor<Object> createOrEditLinkBtn = new ActionToolbarButtonDescriptor<Object>(
                 accessRol, sndbarPosition, new Listener0() {
                     public void onEvent() {
-                        if (insertLinkListener == null) {
-                            insertLinkListener = new Listener<LinkInfo>() {
-                                public void onEvent(LinkInfo linkInfo) {
-                                    String link = linkInfo.toString();
-                                    Log.debug("Link: " + link);
-                                    view.focus();
-                                    view.insertHtml(link);
-                                    fireOnEdit();
+                        deferred.addCommand(new Listener0() {
+                            public void onEvent() {
+                                if (insertLinkListener == null) {
+                                    insertLinkListener = new Listener<LinkInfo>() {
+                                        public void onEvent(final LinkInfo linkInfo) {
+                                            String link = linkInfo.toString();
+                                            Log.debug("Link: " + link);
+                                            view.focus();
+                                            view.insertHtml(link);
+                                            fireOnEdit();
+                                        }
+                                    };
                                 }
-                            };
-                        }
-                        LinkInfo linkInfo = view.getLinkInfoIfHref();
-                        InsertLinkDialog dialog = insertLinkDialog.get();
-                        dialog.setLinkInfo(linkInfo);
-                        dialog.setOnCreateLink(insertLinkListener);
-                        dialog.show();
-                        String href = linkInfo.getHref();
-                        if (href.length() > 0) {
-                            if (href.startsWith("mailto")) {
-                                dialog.activateTab(2);
-                            } else {
-                                dialog.activateTab(1);
+                                LinkInfo linkInfo = view.getLinkInfoIfHref();
+                                InsertLinkDialog dialog = insertLinkDialog.get();
+                                dialog.setLinkInfo(linkInfo);
+                                dialog.setOnCreateLink(insertLinkListener);
+                                dialog.show();
+                                String href = linkInfo.getHref();
+                                if (href.length() > 0) {
+                                    if (href.startsWith("mailto")) {
+                                        dialog.activateTab(2);
+                                    } else {
+                                        dialog.activateTab(1);
+                                    }
+                                }
                             }
-                        }
-
+                        });
                     }
                 });
         createOrEditLinkBtn.setIconCls(getCssName(imgResources.link()));
@@ -659,6 +698,13 @@
         createOrEditLink.setActionPosition(topbarPosition);
         createOrEditLink.setParentMenuTitle(i18n.t(INSERT_MENU));
 
+        ActionToolbarMenuDescriptor<Object> editLinkCtx = new ActionToolbarMenuDescriptor<Object>(createOrEditLink);
+        editLinkCtx.setTextDescription(i18n.t("Change"));
+        editLinkCtx.setToolTip(null);
+        editLinkCtx.setShortcut(null);
+        editLinkCtx.setActionPosition(linkCtxPosition);
+        editLinkCtx.setParentMenuTitle(i18n.t(INSERT_MENU));
+
         ActionToolbarButtonDescriptor<Object> removeLink = new ActionToolbarButtonDescriptor<Object>(accessRol,
                 sndbarPosition, new Listener0() {
                     public void onEvent() {
@@ -671,6 +717,13 @@
         removeLink.setShortcut(new ShortcutDescriptor(true, true, 'K'));
         removeLink.setAddCondition(canBeExtended);
 
+        ActionToolbarMenuDescriptor<Object> removeLinkCtx = new ActionToolbarMenuDescriptor<Object>(removeLink);
+        removeLinkCtx.setTextDescription(i18n.t("Remove"));
+        removeLinkCtx.setToolTip(null);
+        removeLinkCtx.setShortcut(null);
+        removeLinkCtx.setActionPosition(linkCtxPosition);
+        removeLinkCtx.setParentMenuTitle(i18n.t(INSERT_MENU));
+
         final ActionToolbarMenuDescriptor<Object> removeFormat = new ActionToolbarMenuDescriptor<Object>(accessRol,
                 topbarPosition, new Listener0() {
                     public void onEvent() {
@@ -704,7 +757,7 @@
                         NotifyUser.showProgressLoading();
                         if (insertSpecialCharListener == null) {
                             insertSpecialCharListener = new Listener<String>() {
-                                public void onEvent(String character) {
+                                public void onEvent(final String character) {
                                     view.insertHtml(character);
                                 }
                             };
@@ -720,17 +773,6 @@
         insertSpecialChar.setParentMenuTitle(i18n.t(INSERT_MENU));
         insertSpecialChar.setTopSeparator(true);
 
-        final ActionToolbarMenuDescriptor<Object> insertMedia = new ActionToolbarMenuDescriptor<Object>(accessRol,
-                topbarPosition, new Listener0() {
-                    public void onEvent() {
-                        NotifyUser.info(TextUtils.IN_DEVELOPMENT);
-                    }
-                });
-        insertMedia.setIconCls(getCssName(imgResources.film()));
-        insertMedia.setTextDescription(i18n.t("Media..."));
-        insertMedia.setAddCondition(canBeExtended);
-        insertMedia.setParentMenuTitle(i18n.t(INSERT_MENU));
-
         final ActionToolbarMenuDescriptor<Object> insertTable = new ActionToolbarMenuDescriptor<Object>(accessRol,
                 topbarPosition, new Listener0() {
                     public void onEvent() {
@@ -757,7 +799,7 @@
                     public void onEvent() {
                         palette.get().show(getActionLeftPosition(sndBar, insertTableBtn),
                                 getActionTopPosition(sndBar, removeFormatBtn), new Listener<String>() {
-                                    public void onEvent(String color) {
+                                    public void onEvent(final String color) {
                                         palette.get().hide();
                                         view.setForeColor(color);
                                         fireOnEdit();
@@ -774,7 +816,7 @@
                     public void onEvent() {
                         palette.get().show(getActionLeftPosition(sndBar, fontColor),
                                 getActionTopPosition(sndBar, fontColor), new Listener<String>() {
-                                    public void onEvent(String color) {
+                                    public void onEvent(final String color) {
                                         palette.get().hide();
                                         view.setBackColor(color);
                                         fireOnEdit();
@@ -853,9 +895,12 @@
         }
         actions.add(withNoItem(fontColor));
         actions.add(withNoItem(backgroundColor));
+
+        view.addCtxAction(withNoItem(editLinkCtx));
+        view.addCtxAction(withNoItem(removeLinkCtx));
     }
 
-    private ActionToolbarMenuDescriptor<Object> createFontNameAction(ActionAddCondition<Object> canBeBasic,
+    private ActionToolbarMenuDescriptor<Object> createFontNameAction(final ActionAddCondition<Object> canBeBasic,
             final String fontName) {
         final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol,
                 sndbarPosition, new Listener0() {
@@ -871,8 +916,8 @@
         return font;
     }
 
-    private ActionToolbarMenuDescriptor<Object> createFontSizeAction(ActionAddCondition<Object> canBeBasic,
-            final int fontSize, String fontSizeName) {
+    private ActionToolbarMenuDescriptor<Object> createFontSizeAction(final ActionAddCondition<Object> canBeBasic,
+            final int fontSize, final String fontSizeName) {
         final ActionToolbarMenuDescriptor<Object> font = new ActionToolbarMenuDescriptor<Object>(accessRol,
                 sndbarPosition, new Listener0() {
                     public void onEvent() {
@@ -888,15 +933,16 @@
         return font;
     }
 
-    private int getActionLeftPosition(ActionToolbar<Object> bar, ActionToolbarButtonDescriptor<Object> action) {
+    private int getActionLeftPosition(final ActionToolbar<Object> bar,
+            final ActionToolbarButtonDescriptor<Object> action) {
         return bar.getLeftPosition(action);
     }
 
-    private int getActionTopPosition(ActionToolbar<Object> bar, ActionToolbarButtonDescriptor<Object> action) {
+    private int getActionTopPosition(final ActionToolbar<Object> bar, final ActionToolbarButtonDescriptor<Object> action) {
         return bar.getTopPosition(action);
     }
 
-    private String getCssName(ImageResource imageResource) {
+    private String getCssName(final ImageResource imageResource) {
         return RTEImgResources.SUFFIX + imageResource.getName();
     }
 
@@ -906,7 +952,7 @@
 
     private ActionEnableCondition<Object> isInsertHtmlSupported() {
         return new ActionEnableCondition<Object>() {
-            public boolean mustBeEnabled(Object param) {
+            public boolean mustBeEnabled(final Object param) {
                 return true;
             }
         };
@@ -915,9 +961,8 @@
     private void onInsertTablePressed() {
         if (insertTableListener == null) {
             insertTableListener = new Listener<String>() {
-                public void onEvent(String table) {
+                public void onEvent(final String table) {
                     if (view.isAnythingSelected()) {
-                        // FIXME
                         // move to end of selection?
                     }
                     view.insertHtml(table);
@@ -929,11 +974,11 @@
         insertTableDialog.get().show();
     }
 
-    private void styleToolbar(ActionToolbar<Object> bar) {
+    private void styleToolbar(final ActionToolbar<Object> bar) {
         bar.setNormalStyle();
     }
 
-    private ActionItemCollection<Object> withNoItem(ActionCollection<Object> actions) {
+    private ActionItemCollection<Object> withNoItem(final ActionCollection<Object> actions) {
         ActionItemCollection<Object> collection = new ActionItemCollection<Object>();
         for (ActionDescriptor<Object> action : actions) {
             // this action don't have a associated item
@@ -942,7 +987,7 @@
         return collection;
     }
 
-    private ActionItem<Object> withNoItem(ActionDescriptor<Object> action) {
+    private ActionItem<Object> withNoItem(final ActionDescriptor<Object> action) {
         return new ActionItem<Object>(action, null);
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorView.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -1,6 +1,7 @@
 package org.ourproject.kune.platf.client.ui.rte.basic;
 
 import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.actions.ActionItem;
 import org.ourproject.kune.platf.client.actions.ActionItemCollection;
 import org.ourproject.kune.platf.client.ui.rte.RichTextArea.FontSize;
 import org.ourproject.kune.platf.client.ui.rte.insertlink.LinkInfo;
@@ -9,6 +10,8 @@
 
     void addActions(ActionItemCollection<Object> actions);
 
+    void addCtxAction(ActionItem<Object> actionItem);
+
     void adjustSize(int height);
 
     boolean canBeBasic();
@@ -35,6 +38,8 @@
 
     String getText();
 
+    void hideLinkCtxMenu();
+
     void insertBlockquote();
 
     void insertComment(String author);
@@ -61,6 +66,8 @@
 
     boolean isItalic();
 
+    boolean isLink();
+
     boolean isStrikethrough();
 
     boolean isSubscript();
@@ -101,6 +108,8 @@
 
     void setText(String text);
 
+    void showLinkCtxMenu();
+
     void toggleBold();
 
     void toggleItalic();

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -39,7 +39,8 @@
     private String position;
     private String size;
 
-    public ImageInfo(String src, boolean wraptext, boolean clickOriginal, String position, String size) {
+    public ImageInfo(final String src, final boolean wraptext, final boolean clickOriginal, final String position,
+            final String size) {
         this.src = src;
         this.wraptext = wraptext;
         this.clickOriginal = clickOriginal;
@@ -80,23 +81,23 @@
         return wraptext;
     }
 
-    public void setClickOriginal(boolean clickOriginal) {
+    public void setClickOriginal(final boolean clickOriginal) {
         this.clickOriginal = clickOriginal;
     }
 
-    public void setPosition(String position) {
+    public void setPosition(final String position) {
         this.position = position;
     }
 
-    public void setSize(String size) {
+    public void setSize(final String size) {
         this.size = size;
     }
 
-    public void setSrc(String src) {
+    public void setSrc(final String src) {
         this.src = src;
     }
 
-    public void setWraptext(boolean wraptext) {
+    public void setWraptext(final boolean wraptext) {
         this.wraptext = wraptext;
     }
 
@@ -123,7 +124,7 @@
 
     private String getStyleSize() {
         for (String[] current : sizes) {
-            if (current[1].equals(size)) {
+            if (current[0].equals(size)) {
                 return current[2];
             }
         }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -11,12 +11,8 @@
 
     ImageInfo getImageInfo();
 
-    void setImageInfo(ImageInfo imageInfo);
+    void reset();
 
-    void setImagePosition(String position);
-
-    void setImageSize(String size);
-
     void setOnCreateImage(Listener<ImageInfo> listener);
 
     void setOnInsertImagePressed(Listener0 onInsertLinkPressed);

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -11,7 +11,11 @@
     private ImageInfo imageInfo;
     private Listener0 onInsertPressed;
 
-    public void fireOnInsertImage(ImageInfo imageInfo) {
+    public InsertImageDialogPresenter() {
+        initImageInfo();
+    }
+
+    public void fireOnInsertImage(final ImageInfo imageInfo) {
         onCreateListener.onEvent(imageInfo);
         super.hide();
     }
@@ -20,23 +24,15 @@
         return imageInfo;
     }
 
-    public void setImageInfo(ImageInfo imageInfo) {
-        this.imageInfo = imageInfo;
+    public void reset() {
+        initImageInfo();
     }
 
-    public void setImagePosition(String position) {
-        imageInfo.setPosition(position);
-    }
-
-    public void setImageSize(String size) {
-        imageInfo.setSize(size);
-    }
-
-    public void setOnCreateImage(Listener<ImageInfo> listener) {
+    public void setOnCreateImage(final Listener<ImageInfo> listener) {
         onCreateListener = listener;
     }
 
-    public void setOnInsertImagePressed(Listener0 onInsertPressed) {
+    public void setOnInsertImagePressed(final Listener0 onInsertPressed) {
         this.onInsertPressed = onInsertPressed;
     }
 
@@ -47,4 +43,9 @@
     protected void onInsert() {
         onInsertPressed.onEvent();
     }
+
+    private void initImageInfo() {
+        imageInfo = new ImageInfo("", ImageInfo.DEF_WRAP_VALUE, ImageInfo.DEF_CLICK_ORIGINAL_VALUE,
+                ImageInfo.POSITION_LEFT, ImageInfo.SIZE_ORIGINAL);
+    }
 }

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertMediaGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertMediaGroup.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertMediaGroup.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,27 @@
+package org.ourproject.kune.platf.client.ui.rte.insertimg;
+
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstract;
+
+import com.calclab.suco.client.ioc.Container;
+import com.calclab.suco.client.ioc.Provider;
+import com.calclab.suco.client.ioc.decorator.ProviderCollection;
+import com.calclab.suco.client.ioc.decorator.Singleton;
+
+public class InsertMediaGroup extends ProviderCollection {
+
+    public InsertMediaGroup(final Container container) {
+        super(container, Singleton.instance);
+    }
+
+    public void createAll() {
+        for (final Provider<?> p : getProviders()) {
+            p.get();
+        }
+    }
+
+    public void resetAll() {
+        for (final Provider<?> p : getProviders()) {
+            ((InsertMediaAbstract) p.get()).reset();
+        }
+    }
+}

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPanel.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -13,6 +13,8 @@
 import com.gwtext.client.widgets.form.Checkbox;
 import com.gwtext.client.widgets.form.ComboBox;
 import com.gwtext.client.widgets.form.FieldSet;
+import com.gwtext.client.widgets.form.Label;
+import com.gwtext.client.widgets.form.event.CheckboxListenerAdapter;
 import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
 import com.gwtext.client.widgets.form.event.FormPanelListenerAdapter;
 
@@ -24,12 +26,16 @@
     private final ComboBox positionCombo;
     protected final Checkbox wrapText;
     protected final Checkbox clickOriginal;
+    private final Label intro;
 
-    public InsertImageAbstractPanel(String title, final InsertImageAbstractPresenter presenter) {
+    public InsertImageAbstractPanel(final String title, final InsertImageAbstractPresenter presenter) {
         super(title);
         super.setAutoWidth(true);
         super.setHeight(InsertImageDialogView.HEIGHT);
+        super.getFormPanel().setLabelWidth(DEF_FIELD_LABEL_WITH + 20);
 
+        intro = new Label();
+
         final Store storeSizes = new SimpleStore(new String[] { "abbr", "trans", "size" }, getSizes());
         storeSizes.load();
 
@@ -46,34 +52,60 @@
         clickOriginal.setChecked(ImageInfo.DEF_CLICK_ORIGINAL_VALUE);
         clickOriginal.setWidth(DEF_FIELD_WIDTH);
 
+        sizeCombo.addListener(new ComboBoxListenerAdapter() {
+            @Override
+            public void onSelect(final ComboBox comboBox, final Record record, final int index) {
+                String size = record.getAsString("abbr");
+                presenter.setSize(size);
+            }
+        });
+
         positionCombo.addListener(new ComboBoxListenerAdapter() {
             @Override
-            public void onSelect(ComboBox comboBox, Record record, int index) {
+            public void onSelect(final ComboBox comboBox, final Record record, final int index) {
                 String pos = record.getAsString("abbr");
+                presenter.setPosition(pos);
                 setWrapVisible(pos);
             }
         });
 
         super.addListener(new FormPanelListenerAdapter() {
             @Override
-            public void onActivate(Panel panel) {
+            public void onActivate(final Panel panel) {
                 ImageInfo linkImage = presenter.getImageInfo();
                 updateValues(linkImage);
                 presenter.onActivate();
             }
         });
 
+        clickOriginal.addListener(new CheckboxListenerAdapter() {
+            @Override
+            public void onCheck(final Checkbox field, final boolean checked) {
+                presenter.onClickOriginalChecked(checked);
+            }
+        });
+
+        wrapText.addListener(new CheckboxListenerAdapter() {
+            @Override
+            public void onCheck(final Checkbox field, final boolean checked) {
+                presenter.onWrapTextChecked(checked);
+            }
+        });
+
         FieldSet advanced = new FieldSet(Resources.i18n.t("More options"));
         advanced.setCollapsible(true);
         advanced.setCollapsed(true);
         advanced.setAutoHeight(true);
         advanced.setAutoWidth(true);
         advanced.setAutoScroll(false);
+        advanced.addClass("kune-Margin-Large-t");
+        // advanced.setPaddings(10, 0, 0, 0);
 
         advanced.add(sizeCombo);
         advanced.add(positionCombo);
         advanced.add(wrapText);
         advanced.add(clickOriginal);
+        add(intro);
         add(advanced);
     }
 
@@ -98,11 +130,15 @@
     }
 
     @Override
-    public void insert(int index, Component component) {
+    public void insert(final int index, final Component component) {
         super.insert(index, component);
     }
 
-    protected void updateValues(ImageInfo imageInfo) {
+    public void setIntro(final String text) {
+        intro.setHtml(text);
+    }
+
+    protected void updateValues(final ImageInfo imageInfo) {
         sizeCombo.setValue(imageInfo.getSize());
         String position = imageInfo.getPosition();
         positionCombo.setValue(position);
@@ -111,7 +147,7 @@
         setWrapVisible(position);
     }
 
-    private ComboBox createCombo(final Store storeSizes, String title) {
+    private ComboBox createCombo(final Store storeSizes, final String title) {
         ComboBox cb = new ComboBox();
         cb.setEditable(false);
         cb.setForceSelection(true);
@@ -119,6 +155,7 @@
         cb.setFieldLabel(title);
         cb.setStore(storeSizes);
         cb.setDisplayField("trans");
+        cb.setValueField("abbr");
         cb.setMode(ComboBox.LOCAL);
         cb.setTriggerAction(ComboBox.ALL);
         cb.setTypeAhead(true);
@@ -158,7 +195,7 @@
         return sizesObjs;
     }
 
-    private void setWrapVisible(String position) {
+    private void setWrapVisible(final String position) {
         if (position.equals(ImageInfo.POSITION_CENTER)) {
             wrapText.setVisible(false);
         } else {

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractPresenter.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -12,6 +12,7 @@
     protected InsertImageAbstractView view;
     protected final InsertImageDialog insertImageDialog;
     private final Listener0 onInsertImagePressed;
+    protected ImageInfo imageInfo;
 
     public InsertImageAbstractPresenter(final InsertImageDialog insertImageDialog) {
         this.insertImageDialog = insertImageDialog;
@@ -35,7 +36,7 @@
         return view;
     }
 
-    public void init(InsertImageAbstractView view) {
+    public void init(final InsertImageAbstractView view) {
         this.view = view;
         insertImageDialog.addTab(view);
     }
@@ -48,23 +49,39 @@
         insertImageDialog.setOnInsertImagePressed(onInsertImagePressed);
     }
 
-    public void onInsert(ImageInfo linkInfo) {
+    public void onClickOriginalChecked(final boolean checked) {
+        insertImageDialog.getImageInfo().setClickOriginal(checked);
+    }
+
+    public void onInsert(final ImageInfo linkInfo) {
         insertImageDialog.fireOnInsertImage(linkInfo);
         reset();
     }
 
-    public void onPositionFieldChanged(String position) {
-        insertImageDialog.setImagePosition(position);
+    public void onPositionFieldChanged(final String position) {
+        insertImageDialog.getImageInfo().setPosition(position);
     }
 
-    public void onSizeFieldChanged(String size) {
-        insertImageDialog.setImageSize(size);
+    public void onSizeFieldChanged(final String size) {
+        insertImageDialog.getImageInfo().setSize(size);
     }
 
+    public void onWrapTextChecked(final boolean checked) {
+        insertImageDialog.getImageInfo().setWraptext(checked);
+    }
+
     public void reset() {
         view.reset();
     }
 
+    public void setPosition(final String position) {
+        insertImageDialog.getImageInfo().setPosition(position);
+    }
+
+    public void setSize(final String size) {
+        insertImageDialog.getImageInfo().setSize(size);
+    }
+
     protected ImageInfo updateImageInfo() {
         return new ImageInfo(view.getSrc(), view.getWrapText(), view.getClickOriginal(), view.getPosition(),
                 view.getSize());

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/InsertImageAbstractView.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -12,9 +12,10 @@
 
     String getSrc();
 
+    boolean getWrapText();
+
     boolean isValid();
 
     void reset();
 
-    boolean getWrapText();
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPanel.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPanel.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -4,11 +4,14 @@
 import org.ourproject.kune.platf.client.ui.TextUtils;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstractPanel;
 
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.ui.Frame;
+import com.google.gwt.user.client.ui.Label;
+import com.gwtext.client.core.EventCallback;
 import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
 import com.gwtext.client.widgets.PaddedPanel;
 import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
 import com.gwtext.client.widgets.form.TextField;
 import com.gwtext.client.widgets.layout.FitLayout;
 
@@ -17,9 +20,12 @@
     private static final String LINK_FIELD = "iiep-img-field";
     private final TextField srcField;
     private final Panel previewPanel;
+    private final InsertImageExtPresenter presenter;
+    private final Label previewLabel;
 
-    public InsertImageExtPanel(final InsertImageExtPresenter presenter, I18nTranslationService i18n) {
-        super(i18n.t("External image"), presenter);
+    public InsertImageExtPanel(final InsertImageExtPresenter presenter, final I18nTranslationService i18n) {
+        super(i18n.t("External"), presenter);
+        this.presenter = presenter;
 
         srcField = new TextField();
         srcField.setTabIndex(1);
@@ -34,22 +40,54 @@
         srcField.setValidationEvent(false);
         srcField.setId(LINK_FIELD);
         insert(0, srcField);
+
         previewPanel = new Panel();
         previewPanel.setLayout(new FitLayout());
-        previewPanel.setHeight(125);
+        previewPanel.setHeight(75);
+
         add(new PaddedPanel(previewPanel, 0));
-        Button preview = new Button(i18n.t("Preview"));
-        preview.addListener(new ButtonListenerAdapter() {
-            @Override
-            public void onClick(Button button, EventObject e) {
-                // presenter.onPreview();
+
+        srcField.addKeyPressListener(new EventCallback() {
+            public void execute(final EventObject e) {
+                refreshPreview();
             }
         });
-        addButton(preview);
+
+        previewLabel = new Label(i18n.t("Image preview will be displayed here."));
+        // previewLabel.setStyleName("kune-Margin-20-trbl");
+        previewLabel.addStyleName("k-preview-panel");
+        previewReset();
     }
 
     @Override
     public String getSrc() {
         return srcField.getValueAsString();
     }
+
+    @Override
+    public void reset() {
+        super.reset();
+        previewReset();
+    }
+
+    public void setPreviewUrl(final String url) {
+        Frame previewFrame = new Frame(url);
+        previewPanel.clear();
+        previewPanel.add(previewFrame);
+        previewPanel.doLayout();
+    }
+
+    private void previewReset() {
+        previewPanel.clear();
+        previewPanel.add(previewLabel);
+    }
+
+    private void refreshPreview() {
+        DeferredCommand.addCommand(new Command() {
+            public void execute() {
+                presenter.onPreview();
+            }
+        });
+    }
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPresenter.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtPresenter.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -5,8 +5,21 @@
 
 public class InsertImageExtPresenter extends InsertImageAbstractPresenter implements InsertImageExt {
 
+    private InsertImageExtView view;
+
     public InsertImageExtPresenter(InsertImageDialog insertImageDialog) {
         super(insertImageDialog);
     }
 
+    public void init(InsertImageExtView view) {
+        super.init(view);
+        this.view = view;
+    }
+
+    public void onPreview() {
+        if (isValid()) {
+            view.setPreviewUrl(view.getSrc());
+        }
+    }
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtView.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/InsertImageExtView.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -3,4 +3,7 @@
 import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstractView;
 
 public interface InsertImageExtView extends InsertImageAbstractView {
+
+    void setPreviewUrl(String src);
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -32,10 +32,6 @@
 
     void setLinkInfo(LinkInfo linkInfo);
 
-    void setLinkText(String text);
-
-    void setLinkTitle(String title);
-
     void setOnCreateLink(Listener<LinkInfo> listener);
 
     void setOnInsertLinkPressed(Listener0 onInsertLinkPressed);

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -30,7 +30,11 @@
     private LinkInfo linkInfo;
     private Listener0 onInsertLinkPressed;
 
-    public void fireOnInsertLink(LinkInfo linkInfo) {
+    public InsertLinkDialogPresenter() {
+        linkInfo = new LinkInfo("");
+    }
+
+    public void fireOnInsertLink(final LinkInfo linkInfo) {
         onCreateListener.onEvent(linkInfo);
         super.hide();
     }
@@ -43,23 +47,15 @@
         super.hide();
     }
 
-    public void setLinkInfo(LinkInfo linkInfo) {
+    public void setLinkInfo(final LinkInfo linkInfo) {
         this.linkInfo = linkInfo;
     }
 
-    public void setLinkText(String text) {
-        linkInfo.setText(text);
-    }
-
-    public void setLinkTitle(String title) {
-        linkInfo.setTitle(title);
-    }
-
     public void setOnCreateLink(final Listener<LinkInfo> listener) {
         this.onCreateListener = listener;
     }
 
-    public void setOnInsertLinkPressed(Listener0 onInsertLinkPressed) {
+    public void setOnInsertLinkPressed(final Listener0 onInsertLinkPressed) {
         this.onInsertLinkPressed = onInsertLinkPressed;
     }
 

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -8,14 +8,15 @@
     public static final String TITLE = "title";
     public static final String TARGET = "target";
     public static final String _BLANK = "_blank";
+    private static final String NO_TARGET = null;
 
-    public static LinkInfo parse(Element element) {
+    public static LinkInfo parse(final Element element) {
         String target = element.getAttribute(TARGET);
         return new LinkInfo(element.getInnerText(), element.getTitle(), element.getAttribute(HREF), target != null
                 && target.equals(_BLANK));
     }
 
-    public static LinkInfo parse(org.xwiki.gwt.dom.client.Element element) {
+    public static LinkInfo parse(final org.xwiki.gwt.dom.client.Element element) {
         String target = element.getAttribute(TARGET);
         return new LinkInfo(element.getInnerText(), element.getTitle(), element.getAttribute(HREF), target != null
                 && target.equals(_BLANK));
@@ -26,29 +27,27 @@
     private String href;
     private String target;
 
-    public LinkInfo(String text) {
+    public LinkInfo(final String text) {
         this(text, null, "", false);
     }
 
-    public LinkInfo(String text, String href) {
+    public LinkInfo(final String text, final String href) {
         this.text = text;
         this.href = href;
     }
 
-    public LinkInfo(String text, String title, String href, boolean inNewWindow) {
+    public LinkInfo(final String text, final String title, final String href, final boolean inNewWindow) {
         this.text = text;
         this.href = href;
         this.title = title;
-        if (inNewWindow) {
-            this.setTarget(_BLANK);
-        }
+        setInNewWindow(inNewWindow);
     }
 
     public Element getElement() {
         Element anchor = DOM.createAnchor();
         com.google.gwt.user.client.Element element = (com.google.gwt.user.client.Element) anchor;
         DOM.setElementProperty(element, HREF, href);
-        if (getTarget() != null) {
+        if (getTarget() != NO_TARGET) {
             DOM.setElementProperty(element, TARGET, getTarget());
         }
         if (title != null) {
@@ -75,26 +74,34 @@
     }
 
     public boolean inSameWindow() {
-        if (target != null) {
+        if (target != NO_TARGET) {
             return target.equals(_BLANK);
         } else {
             return false;
         }
     }
 
-    public void setHref(String href) {
+    public void setHref(final String href) {
         this.href = href;
     }
 
-    public void setTarget(String target) {
+    public void setInNewWindow(final boolean inNewWindow) {
+        if (inNewWindow) {
+            this.setTarget(_BLANK);
+        } else {
+            setTarget(NO_TARGET);
+        }
+    }
+
+    public void setTarget(final String target) {
         this.target = target;
     }
 
-    public void setText(String text) {
+    public void setText(final String text) {
         this.text = text;
     }
 
-    public void setTitle(String title) {
+    public void setTitle(final String title) {
         this.title = title;
     }
 

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPanel.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPanel.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -14,6 +14,7 @@
 import com.gwtext.client.widgets.form.Checkbox;
 import com.gwtext.client.widgets.form.FieldSet;
 import com.gwtext.client.widgets.form.TextField;
+import com.gwtext.client.widgets.form.event.CheckboxListenerAdapter;
 import com.gwtext.client.widgets.form.event.FormPanelListenerAdapter;
 
 public class InsertLinkAbstractPanel extends DefaultForm {
@@ -23,7 +24,7 @@
     protected TextField onOverField;
     protected final Checkbox sameWindow;
 
-    public InsertLinkAbstractPanel(String title, final InsertLinkAbstractPresenter presenter) {
+    public InsertLinkAbstractPanel(final String title, final InsertLinkAbstractPresenter presenter) {
         super(title);
         super.setAutoWidth(true);
         super.setHeight(InsertLinkDialogView.HEIGHT);
@@ -56,7 +57,7 @@
         sameWindow.setChecked(false);
 
         textField.addKeyPressListener(new EventCallback() {
-            public void execute(EventObject e) {
+            public void execute(final EventObject e) {
                 DeferredCommand.addCommand(new Command() {
                     public void execute() {
                         presenter.onTextFieldChanged(textField.getRawValue());
@@ -66,7 +67,7 @@
         });
 
         onOverField.addKeyPressListener(new EventCallback() {
-            public void execute(EventObject e) {
+            public void execute(final EventObject e) {
                 DeferredCommand.addCommand(new Command() {
                     public void execute() {
                         presenter.onOverFieldChanged(onOverField.getRawValue());
@@ -75,9 +76,16 @@
             }
         });
 
+        sameWindow.addListener(new CheckboxListenerAdapter() {
+            @Override
+            public void onCheck(final Checkbox field, final boolean checked) {
+                presenter.onSameWindowCheck(checked);
+            }
+        });
+
         super.addListener(new FormPanelListenerAdapter() {
             @Override
-            public void onActivate(Panel panel) {
+            public void onActivate(final Panel panel) {
                 LinkInfo linkInfo = presenter.getLinkInfo();
                 updateValues(linkInfo);
                 presenter.onActivate();
@@ -113,11 +121,11 @@
     }
 
     @Override
-    public void insert(int index, Component component) {
+    public void insert(final int index, final Component component) {
         super.insert(index, component);
     }
 
-    protected void updateValues(LinkInfo linkInfo) {
+    protected void updateValues(final LinkInfo linkInfo) {
         textField.setValue(linkInfo.getText());
         onOverField.setValue(linkInfo.getTitle());
         if (sameWindow.isVisible()) {

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPresenter.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/InsertLinkAbstractPresenter.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -54,7 +54,7 @@
         return view;
     }
 
-    public void init(InsertLinkAbstractView view) {
+    public void init(final InsertLinkAbstractView view) {
         this.view = view;
         editorInsertDialog.addTab(view);
     }
@@ -67,19 +67,23 @@
         editorInsertDialog.setOnInsertLinkPressed(onInsertLinkPressed);
     }
 
-    public void onInsert(LinkInfo linkInfo) {
+    public void onInsert(final LinkInfo linkInfo) {
         editorInsertDialog.fireOnInsertLink(linkInfo);
         reset();
     }
 
-    public void onOverFieldChanged(String title) {
-        editorInsertDialog.setLinkTitle(title);
+    public void onOverFieldChanged(final String title) {
+        editorInsertDialog.getLinkInfo().setTitle(title);
     }
 
-    public void onTextFieldChanged(String text) {
-        editorInsertDialog.setLinkText(text);
+    public void onSameWindowCheck(final boolean checked) {
+        editorInsertDialog.getLinkInfo().setInNewWindow(checked);
     }
 
+    public void onTextFieldChanged(final String text) {
+        editorInsertDialog.getLinkInfo().setText(text);
+    }
+
     public void reset() {
         view.reset();
     }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/InsertLinkExtPanel.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -47,6 +47,7 @@
         previewPanel = new Panel();
         previewPanel.setLayout(new FitLayout());
         previewPanel.setHeight(125);
+        previewPanel.setCls("k-preview-panel");
 
         add(new PaddedPanel(previewPanel, 0));
 

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaDescriptor.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaDescriptor.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,36 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia;
+
+public class ExternalMediaDescriptor {
+
+    private final String name;
+    private final String siteurl;
+    private final String detectRegex;
+    private final String idRegex;
+    private final String embedTemplate;
+
+    public ExternalMediaDescriptor(final String name, final String siteurl, final String detectRegex,
+            final String idRegex, final String embedTemplate) {
+        this.name = name;
+        this.siteurl = siteurl;
+        this.detectRegex = detectRegex;
+        this.idRegex = idRegex;
+        this.embedTemplate = embedTemplate;
+    }
+
+    public String getEmbed(final String url) {
+        String id = url.replaceFirst(idRegex, "kk");
+        return embedTemplate.replaceFirst("\\[%d\\]", id);
+    }
+
+    public boolean is(final String url) {
+        return url.matches(detectRegex);
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getSiteurl() {
+        return siteurl;
+    }
+}

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaRegistry.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaRegistry.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,33 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+public class ExternalMediaRegistry extends ArrayList<ExternalMediaDescriptor> {
+
+    private static final long serialVersionUID = 1L;
+
+    public static final ExternalMediaDescriptor NO_MEDIA = new ExternalMediaDescriptor(null, null, null, null, null);
+
+    public ExternalMediaDescriptor get(final String url) {
+        for (ExternalMediaDescriptor media : this) {
+            if (media.is(url)) {
+                return media;
+            }
+
+        }
+        return NO_MEDIA;
+    }
+
+    public String getNames() {
+        String names = "";
+        for (Iterator<ExternalMediaDescriptor> iterator = this.iterator(); iterator.hasNext();) {
+            ExternalMediaDescriptor elem = iterator.next();
+            names += elem.getName();
+            if (iterator.hasNext()) {
+                names += ", ";
+            }
+        }
+        return names;
+    }
+}
\ No newline at end of file

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialog.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialog.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,16 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia;
+
+import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialog;
+
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
+
+public interface InsertMediaDialog extends AbstractTabbedDialog {
+
+    void fireOnInsertMedia(String html);
+
+    void setOnCreate(Listener<String> listener);
+
+    void setOnInsertPressed(Listener0 onInsertPressed);
+
+}

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,56 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPanel;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertMediaGroup;
+
+import com.calclab.suco.client.events.Listener0;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+
+public class InsertMediaDialogPanel extends AbstractTabbedDialogPanel implements InsertMediaDialogView {
+
+    private static final String INSERT_MEDIA_DIALOG = "k-imdp-dialog";
+    private static final String INSERT_MEDIA_DIALOG_ERROR_ID = "k-imdp-dialog-err";
+    private final InsertMediaGroup insertMediaGroup;
+
+    public InsertMediaDialogPanel(final InsertMediaDialogPresenter presenter, final I18nTranslationService i18n,
+            final Images images, final InsertMediaGroup insertMediaGroup) {
+        super(INSERT_MEDIA_DIALOG, i18n.t("Insert Media (audio/video)"), 380, HEIGHT + 100, 380, HEIGHT + 100, true,
+                images, INSERT_MEDIA_DIALOG_ERROR_ID);
+        super.setIconCls("k-film-icon");
+        this.insertMediaGroup = insertMediaGroup;
+
+        super.addHideListener(new Listener0() {
+            public void onEvent() {
+                insertMediaGroup.resetAll();
+            }
+        });
+
+        Button insert = new Button(i18n.t("Insert"));
+        insert.addListener(new ButtonListenerAdapter() {
+            @Override
+            public void onClick(final Button button, final EventObject e) {
+                presenter.onInsert();
+            }
+        });
+
+        Button cancel = new Button(i18n.t("Cancel"));
+        cancel.addListener(new ButtonListenerAdapter() {
+            @Override
+            public void onClick(final Button button, final EventObject e) {
+                presenter.onCancel();
+            }
+        });
+        addButton(insert);
+        addButton(cancel);
+    }
+
+    @Override
+    public void createAndShow() {
+        insertMediaGroup.createAll();
+        super.createAndShow();
+    }
+}

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPresenter.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPresenter.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,33 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia;
+
+import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPresenter;
+
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
+
+public class InsertMediaDialogPresenter extends AbstractTabbedDialogPresenter implements InsertMediaDialog {
+
+    private Listener0 onInsertPressed;
+    Listener<String> onCreateListener;
+
+    public void fireOnInsertMedia(String html) {
+        onCreateListener.onEvent(html);
+        super.hide();
+    }
+
+    public void setOnCreate(Listener<String> listener) {
+        onCreateListener = listener;
+    }
+
+    public void setOnInsertPressed(Listener0 onInsertPressed) {
+        this.onInsertPressed = onInsertPressed;
+    }
+
+    protected void onCancel() {
+        super.hide();
+    }
+
+    protected void onInsert() {
+        onInsertPressed.onEvent();
+    }
+}

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogView.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogView.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,9 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface InsertMediaDialogView extends View {
+
+    int HEIGHT = 150;
+
+}

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstract.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstract.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstract.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia;
+
+public interface InsertMediaAbstract {
+
+    void reset();
+
+}

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPanel.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPanel.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,57 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia;
+
+import org.ourproject.kune.platf.client.i18n.Resources;
+import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialogView;
+
+import com.gwtext.client.widgets.Component;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.form.Label;
+import com.gwtext.client.widgets.form.TextField;
+import com.gwtext.client.widgets.form.event.FormPanelListenerAdapter;
+
+public class InsertMediaAbstractPanel extends DefaultForm implements InsertMediaAbstractView {
+
+    protected TextField hrefField;
+    private final Label intro;
+
+    public InsertMediaAbstractPanel(final String title, final InsertMediaAbstractPresenter presenter) {
+        super(title);
+        super.setAutoWidth(true);
+        super.setHeight(InsertMediaDialogView.HEIGHT);
+
+        intro = new Label();
+
+        hrefField = new TextField();
+        hrefField.setTabIndex(1);
+        hrefField.setLabel(Resources.i18n.t("Link"));
+        hrefField.setWidth(DEF_FIELD_WIDTH);
+        hrefField.setAllowBlank(false);
+        hrefField.setMinLength(3);
+        hrefField.setMaxLength(250);
+        hrefField.setValidationEvent(false);
+
+        super.addListener(new FormPanelListenerAdapter() {
+            @Override
+            public void onActivate(final Panel panel) {
+                presenter.onActivate();
+            }
+        });
+
+        add(intro);
+        add(hrefField);
+    }
+
+    public String getSrc() {
+        return hrefField.getRawValue();
+    }
+
+    @Override
+    public void insert(final int index, final Component component) {
+        super.insert(index, component);
+    }
+
+    public void setIntro(final String text) {
+        intro.setHtml(text);
+    }
+}

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPresenter.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractPresenter.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,58 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.calclab.suco.client.events.Listener0;
+
+public class InsertMediaAbstractPresenter implements InsertMediaAbstract {
+
+    protected InsertMediaAbstractView view;
+    protected final InsertMediaDialog insertMediaDialog;
+    private final Listener0 onInsertMediaPressed;
+
+    public InsertMediaAbstractPresenter(final InsertMediaDialog insertMediaDialog) {
+        this.insertMediaDialog = insertMediaDialog;
+        onInsertMediaPressed = new Listener0() {
+            public void onEvent() {
+                if (isValid()) {
+                    String embedInfo = updateMediaInfo();
+                    insertMediaDialog.fireOnInsertMedia(embedInfo);
+                } else {
+                    Log.debug("Form in InsertMedia not valid");
+                }
+            }
+        };
+    }
+
+    public View getView() {
+        return view;
+    }
+
+    public void init(final InsertMediaAbstractView view) {
+        this.view = view;
+        insertMediaDialog.addTab(view);
+    }
+
+    public boolean isValid() {
+        return view.isValid();
+    }
+
+    public void onActivate() {
+        insertMediaDialog.setOnInsertPressed(onInsertMediaPressed);
+    }
+
+    public void onInsert(final String linkInfo) {
+        insertMediaDialog.fireOnInsertMedia(linkInfo);
+        reset();
+    }
+
+    public void reset() {
+        view.reset();
+    }
+
+    protected String updateMediaInfo() {
+        return "";
+    }
+}

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractView.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/InsertMediaAbstractView.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,13 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface InsertMediaAbstractView extends View {
+
+    String getSrc();
+
+    boolean isValid();
+
+    void reset();
+
+}

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMedia.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMedia.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMedia.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.ext;
+
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstract;
+
+public interface InsertExtMedia extends InsertMediaAbstract {
+
+}

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPanel.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPanel.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,16 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.ext;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ExternalMediaRegistry;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractPanel;
+
+public class InsertExtMediaPanel extends InsertMediaAbstractPanel implements InsertExtMediaView {
+
+    public InsertExtMediaPanel(final InsertExtMediaPresenter presenter, final I18nTranslationService i18n,
+            final ExternalMediaRegistry externalMediaRegistry) {
+        super(i18n.t("External"), presenter);
+        String supportedVideos = externalMediaRegistry.getNames();
+        setIntro(i18n.t("Provide a link to the external video (supported videos: [%s])", supportedVideos) + "<br/>");
+    }
+
+}

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPresenter.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaPresenter.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,45 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.ext;
+
+import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ExternalMediaDescriptor;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.ExternalMediaRegistry;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractPresenter;
+
+public class InsertExtMediaPresenter extends InsertMediaAbstractPresenter implements InsertExtMedia {
+
+    private InsertExtMediaView view;
+    private final ExternalMediaRegistry externalMediaRegistry;
+    private ExternalMediaDescriptor mediaDescriptor;
+
+    public InsertExtMediaPresenter(final InsertMediaDialog insertMediaDialog,
+            final ExternalMediaRegistry externalMediaRegistry) {
+        super(insertMediaDialog);
+        this.externalMediaRegistry = externalMediaRegistry;
+
+        externalMediaRegistry.add(new ExternalMediaDescriptor("youtube", "http://youtube.com",
+                "http://[a-z]*.youtube.com/watch?v=.*", "FIXME", "<embed [%d]>"));
+    }
+
+    public void init(final InsertExtMediaView view) {
+        super.init(view);
+        this.view = view;
+    }
+
+    @Override
+    public boolean isValid() {
+        String url = view.getSrc();
+        mediaDescriptor = externalMediaRegistry.get(url);
+        if (mediaDescriptor.equals(ExternalMediaRegistry.NO_MEDIA)) {
+            insertMediaDialog.setErrorMessage("We cannot process this video link", Level.error);
+            return false;
+        } else {
+            return true;
+        }
+    }
+
+    @Override
+    protected String updateMediaInfo() {
+        return mediaDescriptor.getEmbed(view.getSrc());
+    }
+}

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaView.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/InsertExtMediaView.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,6 @@
+package org.ourproject.kune.platf.client.ui.rte.insertmedia.ext;
+
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractView;
+
+public interface InsertExtMediaView extends InsertMediaAbstractView {
+}

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -15,17 +15,17 @@
     private static final String INSERT_SPECIAL_CHAR_DIALOG_ERROR_ID = "iscdp-err";
     private final InsertSpecialCharGroup insertSpecialCharGroup;
 
-    public InsertSpecialCharDialogPanel(final InsertSpecialCharDialogPresenter presenter, Images images,
-            I18nTranslationService i18n, InsertSpecialCharGroup insertSpecialCharGroup, RTEImgResources imgResources) {
+    public InsertSpecialCharDialogPanel(final InsertSpecialCharDialogPresenter presenter, final Images images,
+            final I18nTranslationService i18n, final InsertSpecialCharGroup insertSpecialCharGroup,
+            final RTEImgResources imgResources) {
         super(INSERT_SPECIAL_CHAR_DIALOG, i18n.t("Insert Special Character"), 495, HEIGHT + 90, 495, HEIGHT + 90, true,
                 images, INSERT_SPECIAL_CHAR_DIALOG_ERROR_ID);
-        // super.setIconCls(RTEImgResources.SUFFIX +
-        // imgResources.insertspreadsheet().getName());
+        super.setIconCls("k-specialchars-icon");
         this.insertSpecialCharGroup = insertSpecialCharGroup;
         Button close = new Button(i18n.t("Close"));
         close.addListener(new ButtonListenerAdapter() {
             @Override
-            public void onClick(Button button, EventObject e) {
+            public void onClick(final Button button, final EventObject e) {
                 hide();
             }
         });

Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -80,7 +80,7 @@
                 parentMenuTitleCtx, Position.ctx, TYPE_ROOT, TYPE_FOLDER);
 
         // createContentModeratedActions(parentMenuTitle, contentsModerated);
-
+        createTranslateAction(parentMenuTitle, TYPE_FOLDER, TYPE_WIKIPAGE);
         createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
         createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"), containersNoRoot);
         createEditAction(parentMenuTitle, TYPE_WIKIPAGE);
@@ -102,8 +102,6 @@
 
         createGoHomeAction(containers);
 
-        createTranslateAction(TYPE_FOLDER, TYPE_WIKIPAGE);
-
         createDelContainerAction("Delete folder", parentMenuTitleCtx, containersNoRoot);
         createDelContentAction(parentMenuTitle, i18n.t("Delete"), contents);
         createShowDeletedItems(parentMenuTitleCtx, all);

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -98,14 +98,16 @@
     protected final EntityHeader entityLogo;
     private final SitePublicSpaceLink publicLink;
 
-    public AbstractFoldableContentActions(Session session, StateManager stateManager, I18nUITranslationService i18n,
-            ErrorHandler errorHandler, DeferredCommandWrapper deferredCommandWrapper,
-            Provider<GroupServiceAsync> groupServiceProvider, Provider<ContentServiceAsync> contentServiceProvider,
-            Provider<FileUploader> fileUploaderProvider, ContextNavigator contextNavigator,
-            ContentActionRegistry contentActionRegistry, ContextActionRegistry contextActionRegistry,
-            Provider<FileDownloadUtils> fileDownloadProvider, Provider<ContentEditor> textEditorProvider,
-            Provider<ContextPropEditor> contextPropEditorProvider, FoldableContent foldableContent,
-            EntityHeader entityLogo, SitePublicSpaceLink publicLink) {
+    public AbstractFoldableContentActions(final Session session, final StateManager stateManager,
+            final I18nUITranslationService i18n, final ErrorHandler errorHandler,
+            final DeferredCommandWrapper deferredCommandWrapper,
+            final Provider<GroupServiceAsync> groupServiceProvider,
+            final Provider<ContentServiceAsync> contentServiceProvider,
+            final Provider<FileUploader> fileUploaderProvider, final ContextNavigator contextNavigator,
+            final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
+            final Provider<FileDownloadUtils> fileDownloadProvider, final Provider<ContentEditor> textEditorProvider,
+            final Provider<ContextPropEditor> contextPropEditorProvider, final FoldableContent foldableContent,
+            final EntityHeader entityLogo, final SitePublicSpaceLink publicLink) {
         this.session = session;
         this.stateManager = stateManager;
         this.i18n = i18n;
@@ -125,7 +127,7 @@
         this.publicLink = publicLink;
         createActions();
         session.onInitDataReceived(new Listener<InitDataDTO>() {
-            public void onEvent(InitDataDTO parameter) {
+            public void onEvent(final InitDataDTO parameter) {
                 createPostSessionInitActions();
             }
         });
@@ -134,7 +136,7 @@
     protected void createActions() {
     }
 
-    protected void createContentModeratedActions(String parentMenuTitle, final String... contentsModerated) {
+    protected void createContentModeratedActions(final String parentMenuTitle, final String... contentsModerated) {
         createSetStatusAction(AccessRolDTO.Administrator, i18n.t("Published online"), ContentStatusDTO.publishedOnline,
                 contentsModerated);
         createSetStatusAction(AccessRolDTO.Editor, i18n.t("Editing in progress"), ContentStatusDTO.editingInProgress,
@@ -147,7 +149,8 @@
                 contentsModerated);
     }
 
-    protected void createContentRenameAction(String parentMenuTitle, String textDescription, String... registerInTypes) {
+    protected void createContentRenameAction(final String parentMenuTitle, final String textDescription,
+            final String... registerInTypes) {
         final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtn = new ActionToolbarMenuAndItemDescriptor<StateToken>(
                 AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
                     public void onEvent(final StateToken stateToken) {
@@ -162,7 +165,8 @@
         contentActionRegistry.addAction(renameCtn, registerInTypes);
     }
 
-    protected void createDelContainerAction(String text, String parentMenuTitle, String... registerInTypes) {
+    protected void createDelContainerAction(final String text, final String parentMenuTitle,
+            final String... registerInTypes) {
         final ActionToolbarMenuAndItemDescriptor<StateToken> delContainer = new ActionToolbarMenuAndItemDescriptor<StateToken>(
                 AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
                     public void onEvent(final StateToken token) {
@@ -177,7 +181,8 @@
         contextActionRegistry.addAction(delContainer, registerInTypes);
     }
 
-    protected void createDelContentAction(String parentMenuTitle, String textDescription, String... registerInTypes) {
+    protected void createDelContentAction(final String parentMenuTitle, final String textDescription,
+            final String... registerInTypes) {
         final ActionToolbarMenuAndItemDescriptor<StateToken> delContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
                 AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
                     public void onEvent(final StateToken token) {
@@ -202,7 +207,7 @@
         contentActionRegistry.addAction(delContent, registerInTypes);
     }
 
-    protected void createDownloadActions(String typeUploadedfile) {
+    protected void createDownloadActions(final String typeUploadedfile) {
         ActionToolbarButtonDescriptor<StateToken> download = new ActionToolbarButtonDescriptor<StateToken>(
                 AccessRolDTO.Viewer, CONTENT_TOPBAR, new Listener<StateToken>() {
                     public void onEvent(final StateToken token) {
@@ -229,7 +234,7 @@
     }
 
     protected ActionToolbarButtonDescriptor<StateToken> createEditAction(final String fileMenuTitle,
-            String... registerInTypes) {
+            final String... registerInTypes) {
         ActionToolbarButtonDescriptor<StateToken> editContent = new ActionToolbarButtonDescriptor<StateToken>(
                 AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
                     public void onEvent(final StateToken stateToken) {
@@ -258,7 +263,7 @@
                                                         }
                                                     }
 
-                                                    public void onSuccess(Object param) {
+                                                    public void onSuccess(final Object param) {
                                                         NotifyUser.hideProgress();
                                                         session.getContentState().setContent(html);
                                                         editor.onSavedSuccessful();
@@ -295,7 +300,7 @@
         return editContent;
     }
 
-    protected ActionMenuItemDescriptor<StateToken> createGoAction(String... registerInTypes) {
+    protected ActionMenuItemDescriptor<StateToken> createGoAction(final String... registerInTypes) {
         ActionMenuItemDescriptor<StateToken> go = new ActionMenuItemDescriptor<StateToken>(AccessRolDTO.Viewer,
                 new Listener<StateToken>() {
                     public void onEvent(final StateToken token) {
@@ -309,7 +314,7 @@
         return go;
     }
 
-    protected ActionToolbarButtonDescriptor<StateToken> createGoHomeAction(String... registerInTypes) {
+    protected ActionToolbarButtonDescriptor<StateToken> createGoHomeAction(final String... registerInTypes) {
         ActionToolbarButtonDescriptor<StateToken> goGroupHome = new ActionToolbarButtonDescriptor<StateToken>(
                 AccessRolDTO.Viewer, CONTEXT_TOPBAR, new Listener<StateToken>() {
                     public void onEvent(final StateToken token) {
@@ -319,7 +324,7 @@
         goGroupHome.setMustBeAuthenticated(false);
         goGroupHome.setIconUrl("images/group-home.png");
         goGroupHome.setEnableCondition(new ActionEnableCondition<StateToken>() {
-            public boolean mustBeEnabled(StateToken token) {
+            public boolean mustBeEnabled(final StateToken token) {
                 final StateToken defContentToken = session.getCurrentState().getGroup().getDefaultContent().getStateToken();
                 return !session.getCurrentStateToken().equals(defContentToken);
             }
@@ -331,7 +336,7 @@
 
     protected void createNewContainerAction(final String contentTypeId, final String iconUrl,
             final String textDescription, final String parentMenuTitle, final String parentMenuSubtitle,
-            final String defaultName, Position position, String... registerInTypes) {
+            final String defaultName, final Position position, final String... registerInTypes) {
         final ActionToolbarMenuAndItemDescriptor<StateToken> addFolder;
         addFolder = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Editor, CONTENT_TOPBAR,
                 new Listener<StateToken>() {
@@ -354,8 +359,8 @@
     }
 
     protected ActionToolbarMenuAndItemDescriptor<StateToken> createNewContentAction(final String typeId,
-            String iconUrl, final String description, final String parentMenuTitle, Position position,
-            String... registerInTypes) {
+            final String iconUrl, final String description, final String parentMenuTitle, final Position position,
+            final String... registerInTypes) {
         final ActionToolbarMenuAndItemDescriptor<StateToken> addContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
                 AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener0() {
                     public void onEvent() {
@@ -381,8 +386,8 @@
     protected void createPostSessionInitActions() {
     }
 
-    protected ActionToolbarMenuDescriptor<StateToken> createRefreshCntAction(String parentMenuTitle,
-            String... registerInTypes) {
+    protected ActionToolbarMenuDescriptor<StateToken> createRefreshCntAction(final String parentMenuTitle,
+            final String... registerInTypes) {
         final ActionToolbarMenuDescriptor<StateToken> refreshCnt = new ActionToolbarMenuDescriptor<StateToken>(
                 AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
                     public void onEvent(final StateToken stateToken) {
@@ -398,8 +403,8 @@
         return refreshCnt;
     }
 
-    protected ActionToolbarMenuDescriptor<StateToken> createRefreshCxtAction(String parentMenuTitleCtx,
-            String... registerInTypes) {
+    protected ActionToolbarMenuDescriptor<StateToken> createRefreshCxtAction(final String parentMenuTitleCtx,
+            final String... registerInTypes) {
         final ActionToolbarMenuDescriptor<StateToken> refreshCtx = new ActionToolbarMenuDescriptor<StateToken>(
                 AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
                     public void onEvent(final StateToken stateToken) {
@@ -415,8 +420,8 @@
         return refreshCtx;
     }
 
-    protected ActionToolbarMenuAndItemDescriptor<StateToken> createRenameContentInCtxAction(String parentMenuTitleCtx,
-            String textDescription, String... registerInTypes) {
+    protected ActionToolbarMenuAndItemDescriptor<StateToken> createRenameContentInCtxAction(
+            final String parentMenuTitleCtx, final String textDescription, final String... registerInTypes) {
         final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtx = new ActionToolbarMenuAndItemDescriptor<StateToken>(
                 AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
                     public void onEvent(final StateToken stateToken) {
@@ -429,8 +434,8 @@
         return renameCtx;
     }
 
-    protected ActionToolbarMenuDescriptor<StateToken> createSetAsDefContent(String parentMenuTitle,
-            String... registerInTypes) {
+    protected ActionToolbarMenuDescriptor<StateToken> createSetAsDefContent(final String parentMenuTitle,
+            final String... registerInTypes) {
         final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupContent;
         setAsDefGroupContent = new ActionToolbarMenuDescriptor<StateToken>(AccessRolDTO.Administrator, CONTENT_TOPBAR,
                 new Listener<StateToken>() {
@@ -455,7 +460,7 @@
     }
 
     protected void createSetStatusAction(final AccessRolDTO rol, final String textDescription,
-            final ContentStatusDTO status, String[] contentsModerated) {
+            final ContentStatusDTO status, final String[] contentsModerated) {
         final ActionToolbarMenuRadioDescriptor<StateToken> action = new ActionToolbarMenuRadioDescriptor<StateToken>(
                 rol, CONTENT_TOPBAR, new Listener<StateToken>() {
                     public void onEvent(final StateToken stateToken) {
@@ -476,7 +481,7 @@
         contentActionRegistry.addAction(action, contentsModerated);
     }
 
-    protected void createShowDeletedItems(String parentMenuTitle, String... registerInTypes) {
+    protected void createShowDeletedItems(final String parentMenuTitle, final String... registerInTypes) {
         ActionToolbarMenuCheckItemDescriptor<StateToken> showDeletedItems = new ActionToolbarMenuCheckItemDescriptor<StateToken>(
                 AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener0() {
                     public void onEvent() {
@@ -500,24 +505,26 @@
         contextActionRegistry.addAction(showDeletedItems, registerInTypes);
     }
 
-    protected ActionToolbarButtonDescriptor<StateToken> createTranslateAction(String... registerInTypes) {
-        ActionToolbarButtonDescriptor<StateToken> translateContent = new ActionToolbarButtonDescriptor<StateToken>(
+    protected ActionToolbarMenuDescriptor<StateToken> createTranslateAction(final String fileMenuTitle,
+            final String... registerInTypes) {
+        ActionToolbarMenuDescriptor<StateToken> translateContent = new ActionToolbarMenuDescriptor<StateToken>(
                 AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
                     public void onEvent(final StateToken stateToken) {
                         NotifyUser.important(i18n.t("Sorry, this functionality is currently in development"));
                     }
                 });
+        translateContent.setParentMenuTitle(fileMenuTitle);
         translateContent.setTextDescription(i18n.tWithNT("Translate", "used in button"));
         translateContent.setToolTip(i18n.t("Translate this document to other languages"));
         translateContent.setIconUrl("images/language.gif");
-        translateContent.setLeftSeparator(ActionToolbarButtonSeparator.spacer);
         translateContent.setEnableCondition(notDeleted());
         contentActionRegistry.addAction(translateContent, registerInTypes);
         return translateContent;
     }
 
     protected ActionToolbarButtonAndItemDescriptor<StateToken> createUploadAction(final String textDescription,
-            final String iconUrl, final String toolTip, final String permitedExtensions, String... registerInTypes) {
+            final String iconUrl, final String toolTip, final String permitedExtensions,
+            final String... registerInTypes) {
         final ActionToolbarButtonAndItemDescriptor<StateToken> uploadFile;
         uploadFile = new ActionToolbarButtonAndItemDescriptor<StateToken>(AccessRolDTO.Editor, CONTEXT_BOTTOMBAR,
                 new Listener0() {
@@ -539,7 +546,7 @@
         return uploadFile;
     }
 
-    protected ActionToolbarButtonAndItemDescriptor<StateToken> createUploadMediaAction(String... registerInTypes) {
+    protected ActionToolbarButtonAndItemDescriptor<StateToken> createUploadMediaAction(final String... registerInTypes) {
         ActionToolbarButtonAndItemDescriptor<StateToken> uploadMedia = createUploadAction(i18n.t("Upload media"),
                 "images/nav/upload.png", i18n.t("Upload some media (images, videos...)"),
                 session.getGalleryPermittedExtensions());
@@ -556,13 +563,13 @@
      * TYPE_UPLOADEDFILE);
      */
     @SuppressWarnings("unused")
-    private ActionToolbarMenuAndItemDescriptor<StateToken> createSetGroupLogoAction(String parentMenuTitle) {
+    private ActionToolbarMenuAndItemDescriptor<StateToken> createSetGroupLogoAction(final String parentMenuTitle) {
         final ActionToolbarMenuAndItemDescriptor<StateToken> setGroupLogo = new ActionToolbarMenuAndItemDescriptor<StateToken>(
                 AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
                     public void onEvent(final StateToken token) {
                         groupServiceProvider.get().setGroupFullLogo(session.getUserHash(), token,
                                 new AsyncCallbackSimple<GroupDTO>() {
-                                    public void onSuccess(GroupDTO newGroup) {
+                                    public void onSuccess(final GroupDTO newGroup) {
                                         NotifyUser.info("Logo selected");
                                         if (session.getCurrentState().getGroup().getShortName().equals(
                                                 newGroup.getShortName())) {
@@ -577,7 +584,7 @@
         setGroupLogo.setTextDescription(i18n.t("Set this as the group logo"));
         setGroupLogo.setIconUrl("images/nav/picture.png");
         setGroupLogo.setEnableCondition(new ActionEnableCondition<StateToken>() {
-            public boolean mustBeEnabled(StateToken token) {
+            public boolean mustBeEnabled(final StateToken token) {
                 final BasicMimeTypeDTO mime = session.getContentState().getMimeType();
                 return mime != null && mime.getType().equals("image");
             }
@@ -587,7 +594,7 @@
 
     private ActionEnableCondition<StateToken> notDefAndNotDeleted() {
         return new ActionEnableCondition<StateToken>() {
-            public boolean mustBeEnabled(StateToken token) {
+            public boolean mustBeEnabled(final StateToken token) {
                 final boolean isNotDefContentToken = !session.getCurrentState().getGroup().getDefaultContent().getStateToken().equals(
                         session.getCurrentStateToken());
                 return isNotDefContentToken && notDeleted().mustBeEnabled(token);
@@ -597,7 +604,7 @@
 
     private ActionEnableCondition<StateToken> notDeleted() {
         return new ActionEnableCondition<StateToken>() {
-            public boolean mustBeEnabled(StateToken token) {
+            public boolean mustBeEnabled(final StateToken token) {
                 final boolean isNotDeleted = !(session.isCurrentStateAContent() && session.getContentState().getStatus().equals(
                         ContentStatusDTO.inTheDustbin));
                 return isNotDeleted;
@@ -605,8 +612,8 @@
         };
     }
 
-    private void register(ActionToolbarMenuAndItemDescriptor<StateToken> action, Position position,
-            String... registerInTypes) {
+    private void register(final ActionToolbarMenuAndItemDescriptor<StateToken> action, final Position position,
+            final String... registerInTypes) {
         switch (position) {
         case ctx:
             contextActionRegistry.addAction(action, registerInTypes);

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -52,8 +52,10 @@
 import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialog;
 import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertMediaGroup;
 import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialog;
 import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkGroup;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
 import org.ourproject.kune.platf.client.ui.rte.saving.RTESavingEditorPanel;
 import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.platf.client.utils.TimerWrapper;
@@ -77,6 +79,9 @@
 import org.ourproject.kune.workspace.client.editor.insertlocallink.InsertLinkLocal;
 import org.ourproject.kune.workspace.client.editor.insertlocallink.InsertLinkLocalPanel;
 import org.ourproject.kune.workspace.client.editor.insertlocallink.InsertLinkLocalPresenter;
+import org.ourproject.kune.workspace.client.editor.insertlocalmedia.InsertLocalMedia;
+import org.ourproject.kune.workspace.client.editor.insertlocalmedia.InsertLocalMediaPanel;
+import org.ourproject.kune.workspace.client.editor.insertlocalmedia.InsertLocalMediaPresenter;
 import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
 import org.ourproject.kune.workspace.client.entityheader.EntityHeaderPanel;
 import org.ourproject.kune.workspace.client.entityheader.EntityHeaderPresenter;
@@ -956,6 +961,17 @@
             }
         });
 
+        register(InsertMediaGroup.class, new Factory<InsertLocalMedia>(InsertLocalMedia.class) {
+            @Override
+            public InsertLocalMedia create() {
+                final InsertLocalMediaPresenter presenter = new InsertLocalMediaPresenter($(InsertMediaDialog.class));
+                final InsertLocalMediaPanel panel = new InsertLocalMediaPanel(presenter,
+                        $(I18nTranslationService.class));
+                presenter.init(panel);
+                return presenter;
+            }
+        });
+
         $(GlobalShortcutRegister.class).enable();
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/InsertImageLocalPanel.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -8,9 +8,10 @@
 
 public class InsertImageLocalPanel extends InsertImageAbstractPanel implements InsertImageLocalView {
 
-    public InsertImageLocalPanel(final InsertImageLocalPresenter presenter, I18nTranslationService i18n) {
-        super(i18n.t("Local image"), presenter);
-        insert(0, new Label(TextUtils.IN_DEVELOPMENT));
+    public InsertImageLocalPanel(final InsertImageLocalPresenter presenter, final I18nTranslationService i18n) {
+        super(i18n.t("Local"), presenter);
+        Label label = new Label();
+        label.setHtml(TextUtils.IN_DEVELOPMENT + "<br/><br/>");
+        insert(0, label);
     }
-
 }

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMedia.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMedia.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMedia.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.workspace.client.editor.insertlocalmedia;
+
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstract;
+
+public interface InsertLocalMedia extends InsertMediaAbstract {
+
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPanel.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPanel.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,14 @@
+package org.ourproject.kune.workspace.client.editor.insertlocalmedia;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.TextUtils;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractPanel;
+
+public class InsertLocalMediaPanel extends InsertMediaAbstractPanel implements InsertLocalMediaView {
+
+    public InsertLocalMediaPanel(final InsertLocalMediaPresenter presenter, final I18nTranslationService i18n) {
+        super(i18n.t("Local"), presenter);
+        setIntro(TextUtils.IN_DEVELOPMENT + "<br/><br/>");
+    }
+
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPresenter.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaPresenter.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,18 @@
+package org.ourproject.kune.workspace.client.editor.insertlocalmedia;
+
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractPresenter;
+
+public class InsertLocalMediaPresenter extends InsertMediaAbstractPresenter implements InsertLocalMedia {
+
+    private InsertLocalMediaView view;
+
+    public InsertLocalMediaPresenter(InsertMediaDialog insertMediaDialog) {
+        super(insertMediaDialog);
+    }
+
+    public void init(InsertLocalMediaView view) {
+        super.init(view);
+        this.view = view;
+    }
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaView.java	2009-03-26 00:07:59 UTC (rev 1088)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/InsertLocalMediaView.java	2009-03-30 13:48:35 UTC (rev 1089)
@@ -0,0 +1,6 @@
+package org.ourproject.kune.workspace.client.editor.insertlocalmedia;
+
+import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstractView;
+
+public interface InsertLocalMediaView extends InsertMediaAbstractView {
+}




More information about the kune-commits mailing list