Esempio n. 1
0
 public void setPossiblePoolDialog(final JFrame dialog, final ResourceTreeTable pool) {
   possiblePool = pool;
   possiblePool.putClientProperty("dialog", dialog);
   dialog.addWindowListener(
       new WindowAdapter() {
         @Override
         public void windowClosed(WindowEvent event) {
           pool.putClientProperty("dialog", null);
           if (pool == possiblePool) {
             possiblePool = null;
           }
         }
       });
 }
  public void actionPerformed(ActionEvent event) {
    Application app = Application.getInstance();
    ResourceTreeTableModel model = resourceTreeTable.getTreeTableModel();

    Collection<? extends KNode> selectedNodes = resourceTreeTable.getSelectedNodes();
    for (KNode selectedNode : selectedNodes) {
      if (selectedNode == null) continue;
      if (selectedNode instanceof ResourceNode == false) continue;
      ResourceNode resourceNode = (ResourceNode) selectedNode;
      Long resourceId = resourceNode.getResourceId();
      if (resourceId == null) continue;
      try {
        IResource resource = ResourceInputMapper.map(resourceId);
        if (resource instanceof IMedia == false) continue;
        IMedia media = (IMedia) resource;

        doCreateSnuFromMedia(media);
      } catch (Exception e) {
        Application.getInstance()
            .showUnhandledErrorDialog(
                LanguageBundle.getString("general.errors.uncaughtexception.title"), e);
      }
    }
  }
  public void actionPerformed(ActionEvent event) {
    boolean enabled = false;
    KNode selectedNode = resourceTreeTable.getSelectedNode();
    if (selectedNode != null) {

      if (selectedNode instanceof ResourceNode) {
        ResourceNode resourceNode = (ResourceNode) selectedNode;

        if (resourceNode.getResourceType() == ResourceType.INTERFACE) {
          enabled = true;
        }
      }
    }
    Application.getInstance()
        .getProjectExplorer()
        .getMenu(ProjectExplorer.Action.MenuFileExportInterface)
        .setEnabled(enabled);
  }
Esempio n. 4
0
 public JFrame getPossiblePoolDialog() {
   if (possiblePool == null) return null;
   return (JFrame) possiblePool.getClientProperty("dialog");
 }