Package org.freeplane.plugin.workspace.actions

Source Code of org.freeplane.plugin.workspace.actions.WorkspaceProjectOpenLocationAction

package org.freeplane.plugin.workspace.actions;

import java.awt.event.ActionEvent;

import org.freeplane.plugin.workspace.URIUtils;
import org.freeplane.plugin.workspace.WorkspaceController;
import org.freeplane.plugin.workspace.components.menu.CheckEnableOnPopup;
import org.freeplane.plugin.workspace.model.project.AWorkspaceProject;

@CheckEnableOnPopup
public class WorkspaceProjectOpenLocationAction extends NodeOpenLocationAction {
  private static final long serialVersionUID = 1L;

  public WorkspaceProjectOpenLocationAction() {
    super();
  }

  @Override
  public void setEnabled() {
    if(WorkspaceController.getCurrentProject() == null) {
      setEnabled(false);
    }
    else {
      setEnabled(true);
   
  }

  public void actionPerformed(ActionEvent event) {
    AWorkspaceProject project = WorkspaceController.getCurrentProject();
    if(project == null) {
      return;
    }
 
    openFolder(URIUtils.getAbsoluteFile(project.getProjectHome()));
   
  }
}
TOP

Related Classes of org.freeplane.plugin.workspace.actions.WorkspaceProjectOpenLocationAction

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.