コード例 #1
0
 @Override
 public void setEnabled() {
   boolean enable = false;
   final ProgressUtilities progUtil = new ProgressUtilities();
   final Collection<NodeModel> nodes =
       Controller.getCurrentModeController().getMapController().getSelectedNodes();
   for (final NodeModel node : nodes) {
     if (node != null && !progUtil.hasExternalResource(node)) {
       enable = true;
       break;
     }
   }
   setEnabled(enable);
 }
コード例 #2
0
 public void actionPerformed(final ActionEvent arg0) {
   final ProgressUtilities progUtil = new ProgressUtilities();
   final MapController mapController = Controller.getCurrentModeController().getMapController();
   final Collection<NodeModel> nodes = mapController.getSelectedNodes();
   final ViewerController vc =
       ((ViewerController)
           Controller.getCurrentController()
               .getModeController()
               .getExtension(ViewerController.class));
   final NodeModel selectedNode = mapController.getSelectedNode();
   final ExternalResource extRes = (ExternalResource) vc.createExtension(selectedNode);
   if (extRes != null) {
     final File file = new File(extRes.getAbsoluteUri(selectedNode.getMap()));
     for (final NodeModel node : nodes) {
       if (!progUtil.hasExternalResource(node)) {
         vc.paste(file, node, node.isLeft());
       }
     }
   }
 }