// Path: traction/src/main/java/traction/mvc/implementations/CommandArgument.java
// public class CommandArgument
// {
//     private String commandName;
//     private boolean eventCancelled;
//     private JSONObject tagProperties;
// 
//     public boolean isEventCancelled()
//     {
//         return eventCancelled;
//     }
// 
//     public void setEventCancelled(boolean isCancelled)
//     {
//         eventCancelled = isCancelled;
//     }
// 
//     public CommandArgument(String commandName)
//     {
//         this(commandName, null);
//     }
// 
//     public CommandArgument(String commandName, JSONObject tagProperties)
//     {
//         this.commandName = commandName;
//         this.eventCancelled = false;
//         this.tagProperties = tagProperties;
//     }
// 
//     public JSONObject getEventData()
//     {
//         return tagProperties;
//     }
// 
//     public String getCommandName()
//     {
//         return commandName;
//     }
// }
// 
// Path: traction/src/main/java/traction/mvc/interfaces/IObservableCommand.java
// public interface IObservableCommand
// extends IObservableObject
// {
//     /**
//      * call to execute command
//      * @param arg
//      */
//     void execute(CommandArgument arg);
// 
//     void setExecuteListener(IOnExecuteListener listener);
// 
//     /**
//      *
//      * @return : true if command can execute
//      */
//     boolean getCanExecute();
// 
//     /**
//      * set whether command can execute
//      * @param b
//      */
//     void setCanExecute(boolean b);
// }
// 
// Path: traction/src/main/java/traction/mvc/interfaces/IOnExecuteListener.java
// public interface IOnExecuteListener
// {
//     void onExecuted(CommandArgument arg);
// }
// 
// Path: traction/src/main/java/traction/mvc/interfaces/IPropertyStore.java
// public interface IPropertyStore
// {
//     Property<?,?> getProperty(String name);
// }


import android.util.Property;
import traction.mvc.implementations.CommandArgument;
import traction.mvc.interfaces.IObservableCommand;
import traction.mvc.interfaces.IOnExecuteListener;
import traction.mvc.interfaces.IPropertyStore;
/* Copyright 2013 Tim Stratton

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */

package traction.mvc.observables;



/**
 * class representing a Command. It exposes a property that can be used to determine if
 * the command can execute and gives a handle to override to perform functions when the command has been invoked
 * @author Tim Stratton
 */
public class Command
extends ObservableObject
implements IObservableCommand
{
    private IOnExecuteListener executeListener;

    public Command()
    {
        setCanExecute(true);
    }

    public Command(boolean initCanExecute)
    {
        setCanExecute(initCanExecute);
    }

    public void setExecuteListener(IOnExecuteListener listener)
    {
        executeListener = listener;
    }

	private boolean canExecute;

	@Override
// Path: traction/src/main/java/traction/mvc/implementations/CommandArgument.java
// public class CommandArgument
// {
//     private String commandName;
//     private boolean eventCancelled;
//     private JSONObject tagProperties;
// 
//     public boolean isEventCancelled()
//     {
//         return eventCancelled;
//     }
// 
//     public void setEventCancelled(boolean isCancelled)
//     {
//         eventCancelled = isCancelled;
//     }
// 
//     public CommandArgument(String commandName)
//     {
//         this(commandName, null);
//     }
// 
//     public CommandArgument(String commandName, JSONObject tagProperties)
//     {
//         this.commandName = commandName;
//         this.eventCancelled = false;
//         this.tagProperties = tagProperties;
//     }
// 
//     public JSONObject getEventData()
//     {
//         return tagProperties;
//     }
// 
//     public String getCommandName()
//     {
//         return commandName;
//     }
// }
// 
// Path: traction/src/main/java/traction/mvc/interfaces/IObservableCommand.java
// public interface IObservableCommand
// extends IObservableObject
// {
//     /**
//      * call to execute command
//      * @param arg
//      */
//     void execute(CommandArgument arg);
// 
//     void setExecuteListener(IOnExecuteListener listener);
// 
//     /**
//      *
//      * @return : true if command can execute
//      */
//     boolean getCanExecute();
// 
//     /**
//      * set whether command can execute
//      * @param b
//      */
//     void setCanExecute(boolean b);
// }
// 
// Path: traction/src/main/java/traction/mvc/interfaces/IOnExecuteListener.java
// public interface IOnExecuteListener
// {
//     void onExecuted(CommandArgument arg);
// }
// 
// Path: traction/src/main/java/traction/mvc/interfaces/IPropertyStore.java
// public interface IPropertyStore
// {
//     Property<?,?> getProperty(String name);
// }


// Path: traction/src/main/java/traction/mvc/observables/Command.java
import android.util.Property;
import traction.mvc.implementations.CommandArgument;
import traction.mvc.interfaces.IObservableCommand;
import traction.mvc.interfaces.IOnExecuteListener;
import traction.mvc.interfaces.IPropertyStore;

/* Copyright 2013 Tim Stratton

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */

package traction.mvc.observables;



/**
 * class representing a Command. It exposes a property that can be used to determine if
 * the command can execute and gives a handle to override to perform functions when the command has been invoked
 * @author Tim Stratton
 */
public class Command
extends ObservableObject
implements IObservableCommand
{
    private IOnExecuteListener executeListener;

    public Command()
    {
        setCanExecute(true);
    }

    public Command(boolean initCanExecute)
    {
        setCanExecute(initCanExecute);
    }

    public void setExecuteListener(IOnExecuteListener listener)
    {
        executeListener = listener;
    }

	private boolean canExecute;

	@Override
	protected IPropertyStore getPropertyStore()