package org.opennms.features.topology.plugins.topo.linkd.internal.operations;

import java.util.List;

import org.opennms.features.topology.api.Operation;
import org.opennms.features.topology.api.OperationContext;
import org.opennms.features.topology.plugins.topo.linkd.internal.LinkdTopologyProvider;

public class OpenOperation implements Operation {

    LinkdTopologyProvider m_linkdTopologyProvider;
    public OpenOperation(LinkdTopologyProvider topologyProveder) {
        m_linkdTopologyProvider=topologyProveder;
    }

    @Override
    public Undoer execute(List<Object> targets, OperationContext operationContext) {
        if (targets == null || targets.isEmpty() ) {
        	log("no target, loading null provider");
            m_linkdTopologyProvider.load(null);
        } else {
        	log("loading " + targets.get(0));
            m_linkdTopologyProvider.load((String) targets.get(0));
        }
        log("finished loading");
        return null;
    }

    private void log(final String string) {
		System.err.println(string);
	}

	@Override
    public boolean display(List<Object> targets,
            OperationContext operationContext) {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public boolean enabled(List<Object> targets,
            OperationContext operationContext) {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public String getId() {
        // TODO Auto-generated method stub
        return null;
    }

}

@@ -1103,36 +1103,24 @@
 ct%3E targets,
-%0A           
  OperationCo
@@ -1149,51 +1149,8 @@
 ) %7B%0A
-        // TODO Auto-generated method stub%0A
     
@@ -1152,36 +1152,35 @@
 %0A        return 
-fals
+tru
 e;%0A    %7D%0A%0A    @O
@@ -1235,28 +1235,16 @@
 targets,
-%0A           
  Operati
@@ -1281,66 +1281,19 @@
     
-    // TODO Auto-generated method stub%0A        
+%09
 return 
-fals
+tru
 e;%0A 
@@ -1348,66 +1348,31 @@
     
-    // TODO Auto-generated method stub%0A        return null
+%09return %22LinkdFileOpen%22
 ;%0A  

fix display and enabled of linkd File open