Changeset 2320
- Timestamp:
- 10/22/12 16:32:39 (12 years ago)
- Location:
- ComponentRegistry/branches/ComponentRegistry-1.13.0-olha/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/branches/ComponentRegistry-1.13.0-olha/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/browser/BrowserOverviewList.mxml
r2317 r2320 125 125 </mx:Script> 126 126 127 128 127 <mx:HBox paddingLeft="5" 129 128 paddingRight="5" … … 172 171 <mx:Label text="Showing {dataGrid.dataProvider.length} of {dataGrid.unfilteredLength}"/> 173 172 174 <mx:Image source="{StyleConstants.rssIcon}"175 toolTip = "Linking to the RSS feed"173 174 <comp:RssLinkButton 176 175 contextMenu = "{(new RssDescriptionsContextMenu(typeOfDescription)).cm}" 177 176 click="goToFeed()" -
ComponentRegistry/branches/ComponentRegistry-1.13.0-olha/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/browser/CommentsPanel.as
r2317 r2320 10 10 import clarin.cmdi.componentregistry.common.StyleConstants; 11 11 import clarin.cmdi.componentregistry.common.components.RssCommentsContextMenu; 12 import clarin.cmdi.componentregistry.common.components.RssLinkButton; 12 13 13 14 import flash.events.Event; … … 53 54 } 54 55 55 private function makeRssImage():Image{ 56 var rssImage:Image = new Image(); 57 rssImage.setStyle("horizontalAlign", "right"); 58 rssImage.source=StyleConstants.rssIcon; 59 rssImage.toolTip = "Linking to the RSS feed"; 60 rssImage.contextMenu = (new RssCommentsContextMenu(_itemDescription)).cm; 61 rssImage.addEventListener(MouseEvent.CLICK, goToFeed); 62 return rssImage; 56 private function makeRssLinkButton():RssLinkButton{ 57 var rssButton:RssLinkButton = new RssLinkButton(); 58 rssButton.contextMenu = (new RssCommentsContextMenu(_itemDescription)).cm; 59 rssButton.addEventListener(MouseEvent.CLICK, goToFeed); 60 return rssButton; 63 61 } 64 62 … … 73 71 74 72 // Rss feed "button" 75 var rss Image:Image = makeRssImage();76 addChild(rss Image);73 var rssButton:RssLinkButton = makeRssLinkButton(); 74 addChild(rssButton); 77 75 78 76 // A box for the comments (will be loaded in callback but should be shown first) -
ComponentRegistry/branches/ComponentRegistry-1.13.0-olha/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/common/components/DownIconButton.as
r873 r2320 13 13 toolTip = "move down"; 14 14 } 15 16 15 } 17 16 } -
ComponentRegistry/branches/ComponentRegistry-1.13.0-olha/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/common/components/RssCommentsContextMenu.as
r2318 r2320 1 1 package clarin.cmdi.componentregistry.common.components 2 2 { 3 import clarin.cmdi.componentregistry.common.RssLinkPopUp;3 4 4 import clarin.cmdi.componentregistry.common.ItemDescription; 5 5 import clarin.cmdi.componentregistry.services.Config; 6 6 7 import flash. geom.Point;7 import flash.events.Event; 8 8 import flash.events.ContextMenuEvent; 9 import mx.managers.PopUpManager;9 import flash.ui.ContextMenuItem; 10 10 import flash.system.System; 11 import flash.net.URLRequest; 12 import flash.net.navigateToURL; 11 13 12 14 public class RssCommentsContextMenu extends RssContextMenu … … 19 21 } 20 22 21 22 23 override protected function copyRssLink(event:ContextMenuEvent):void { 23 24 System.setClipboard(Config.getRssUriComments(_itemDescription)); 24 25 } 25 26 27 override protected function showRssLink(event:ContextMenuEvent):void{ 28 navigateToURL(new URLRequest(Config.getRssUriComments(_itemDescription)), "_blank"); 29 } 26 30 27 override protected function showRssLink(event:ContextMenuEvent):void{ 28 29 var rssLinkPanel:RssLinkPopUp = new RssLinkPopUp(); 30 rssLinkPanel.uri=Config.getRssUriComments(_itemDescription); 31 32 var xShift:int = 0; 33 var position:Point = positioning(xShift, event); 34 rssLinkPanel.x = position.x; 35 rssLinkPanel.y= position.y; 36 37 PopUpManager.addPopUp(rssLinkPanel, event.mouseTarget); 31 override protected function menuUpdateCaption(event:ContextMenuEvent):void { 32 _showRssLinkMenuItem.caption = Config.getRssUriComments(_itemDescription); 38 33 } 34 39 35 } 40 36 } -
ComponentRegistry/branches/ComponentRegistry-1.13.0-olha/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/common/components/RssContextMenu.as
r2317 r2320 3 3 import clarin.cmdi.componentregistry.services.Config; 4 4 5 import flash.events.Event; 5 6 import flash.events.ContextMenuEvent; 6 7 import flash.geom.Point; … … 16 17 17 18 private var _copyRssLinkMenuItem:ContextMenuItem; 18 private var _showRssLinkMenuItem:ContextMenuItem; 19 19 protected var _showRssLinkMenuItem:ContextMenuItem; 20 20 21 21 … … 25 25 cm.hideBuiltInItems(); 26 26 cm.customItems = createMenuItems(); 27 27 cm.addEventListener(ContextMenuEvent.MENU_SELECT, menuUpdateCaption); 28 28 } 29 29 … … 31 31 var result:Array = new Array(); 32 32 33 _copyRssLinkMenuItem = new ContextMenuItem("Copy the link to the clipboard"); 33 _showRssLinkMenuItem = new ContextMenuItem(" "); 34 _showRssLinkMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, showRssLink); 35 _showRssLinkMenuItem.visible = true; 36 result.push(_showRssLinkMenuItem); 37 38 _copyRssLinkMenuItem = new ContextMenuItem("Copy Rss link to clipboard"); 34 39 _copyRssLinkMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, copyRssLink); 35 40 _copyRssLinkMenuItem.visible = true; 36 41 result.push(_copyRssLinkMenuItem); 37 38 _showRssLinkMenuItem = new ContextMenuItem("Show link to the RSS feed");39 _showRssLinkMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, showRssLink);40 _showRssLinkMenuItem.visible = true;41 result.push(_showRssLinkMenuItem);42 42 43 43 return result; … … 51 51 } 52 52 53 protected function positioning(xShift:int, event:ContextMenuEvent):Point{ 54 var point:Point = new Point(); 55 point.x = event.mouseTarget.mouseX; 56 point.y = event.mouseTarget.mouseY; 57 point = event.mouseTarget.localToGlobal(point); 58 return (new Point(point.x-xShift, point.y)); 53 protected function menuUpdateCaption(event:ContextMenuEvent):void{ 59 54 } 55 56 60 57 } 61 58 } -
ComponentRegistry/branches/ComponentRegistry-1.13.0-olha/ComponentBrowserGui/src/main/flex/clarin/cmdi/componentregistry/common/components/RssDescriptionsContextMenu.as
r2318 r2320 1 1 package clarin.cmdi.componentregistry.common.components 2 2 { 3 import clarin.cmdi.componentregistry.common.RssLinkPopUp;4 3 import clarin.cmdi.componentregistry.services.Config; 5 4 6 import flash. geom.Point;5 import flash.events.Event; 7 6 import flash.events.ContextMenuEvent; 8 import mx.managers.PopUpManager;7 import flash.ui.ContextMenuItem; 9 8 import flash.system.System; 9 import flash.net.URLRequest; 10 import flash.net.navigateToURL; 10 11 11 12 public class RssDescriptionsContextMenu extends RssContextMenu 12 13 { 13 14 private var _typeOfDescription:String; 15 14 16 15 17 public function RssDescriptionsContextMenu(typeOfDescription:String) … … 18 20 } 19 21 20 21 override protected function copyRssLink(event:ContextMenuEvent):void { 22 override protected function copyRssLink(event:ContextMenuEvent):void { 22 23 System.setClipboard(Config.getRssUriDescriptions(_typeOfDescription)); 23 24 } 25 26 override protected function showRssLink(event:ContextMenuEvent):void{ 27 navigateToURL(new URLRequest(Config.getRssUriDescriptions(_typeOfDescription)), "_blank"); 28 } 24 29 25 26 override protected function showRssLink(event:ContextMenuEvent):void{ 27 28 var rssLinkPanel:RssLinkPopUp = new RssLinkPopUp(); 29 rssLinkPanel.uri = Config.getRssUriDescriptions(_typeOfDescription); 30 31 var xShift:int = 350; 32 var position:Point = positioning(xShift, event); 33 rssLinkPanel.x = position.x; 34 rssLinkPanel.y=position.y; 35 36 PopUpManager.addPopUp(rssLinkPanel, event.mouseTarget); 30 override protected function menuUpdateCaption(event:ContextMenuEvent):void { 31 _showRssLinkMenuItem.caption = Config.getRssUriDescriptions(_typeOfDescription); 37 32 } 38 33 }
Note: See TracChangeset
for help on using the changeset viewer.