// Path: src/com/kk/binding/kernel/BindEngine.java
// public class BindEngine {
//     private static final String TAG = "BindEngine";
//     private static BindEngine bindEngine;
//     private static IBindValueSetter bindValueSetter;
//     private static String propertyDeclareClass = "";
//     private Context mContext;
// 
//     public static BindEngine instance() {
//         if (bindEngine == null) {
//             bindEngine = new BindEngine();
//         }
//         return bindEngine;
//     }
// 
//     private BindEngine() {
//     }
// 
//     public void init(Context context) {
//         mContext = context;
//     }
// 
//     public Context getContext() {
//         return mContext;
//     }
// 
//     public static void setBindValueSetter(IBindValueSetter bindValueSetter) {
//         BindEngine.bindValueSetter = bindValueSetter;
//     }
// 
//     public static IBindValueSetter getBindValueSetter() {
//         return bindValueSetter;
//     }
// 
//     /**
//      * @param propertyDeclareClassName
//      */
//     public static void registerPropertyDeclareClass(String propertyDeclareClassName) {
//         if (!StringUtil.compare(propertyDeclareClass, propertyDeclareClassName)) {
//             propertyDeclareClass = propertyDeclareClassName;
//             BindLog.d(TAG, "registerPropertyDeclareClass:  " + propertyDeclareClass);
//             if (!StringUtil.isNullOrEmpty(propertyDeclareClass)) {
//                 Class<?> clazz = null;
//                 try {
//                     clazz = Class.forName(propertyDeclareClass);
//                     BindLog.d(TAG, "parse propertyDeclareClass success " + clazz.toString());
//                 } catch (ClassNotFoundException e) {
//                     if (BindLog.isInDesignMode())
//                         throw new RuntimeException("parse propertyDeclareClass failed " + e.toString());
//                     BindLog.e(TAG, "parse propertyDeclareClass failed " + e.toString());
//                 }
//                 if (clazz != null) {
//                     try {
//                         Object instance = clazz.newInstance();
//                         if (instance != null)
//                             BindLog.d(TAG, "create propertyDeclareClass instance success " + instance.toString());
//                     } catch (Exception e) {
//                         if (BindLog.isInDesignMode())
//                             throw new RuntimeException("create propertyDeclareClass instance failed " + e.toString());
//                         BindLog.e(TAG, "create propertyDeclareClass instance failed " + e.toString());
//                     }
//                 }
//             }
//         }
//     }
// 
// }
// 
// Path: src/com/kk/binding/util/BindLog.java
// public class BindLog {
//     private static boolean inDesignMode = false;
//     private static StringBuilder fullLog;
//     private static boolean logOpen = true;
// 
//     public static void d(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.d(tag, log);
//         }
//     }
// 
//     public static void i(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.i(tag, log);
//         }
//     }
// 
//     public static void v(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.v(tag, log);
//         }
//     }
// 
//     public static void e(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.e(tag, log);
//         }
//     }
// 
//     public static void w(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.w(tag, log);
//         }
//     }
// 
//     private static void designLog(String tag, String log) {
//         if (fullLog != null) {
//             fullLog.append("\nTAG: ").append(tag).append(" ");
//             fullLog.append(log);
//             fullLog.append("\n");
//         }
//     }
// 
//     public static void throwDesignLog() {
//         if (inDesignMode) {
//             throw new RuntimeException(fullLog != null ? fullLog.toString() : null);
//         }
//     }
// 
//     public static void setInDesignMode(boolean inDesignMode) {
//         BindLog.inDesignMode = inDesignMode;
//         if (inDesignMode) {
//             fullLog = new StringBuilder(1024 * 10);
//         }
//     }
// 
//     public static boolean isInDesignMode() {
//         return inDesignMode;
//     }
// 
//     public static void setBindLogOpen(boolean open) {
//         logOpen = open;
//     }
// 
//     public static boolean isLogOpen() {
//         return logOpen;
//     }
// }


import android.content.Intent;
import android.net.Uri;
import android.view.View;
import com.kk.binding.kernel.BindEngine;
import com.kk.binding.util.BindLog;
/*
 * Copyright (C) 2013 kk-team.com.
 *
 * 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 com.kk.binding.command;



/**
 * Created by hk on 13-12-13.
 */
public class UrlNavCommand implements ICommand {
    @Override
    public void execute(View view, Object... args) {
        if (args.length > 0 && args[0] instanceof String) {
            Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setData(Uri.parse((String) args[0]));
            if (BindEngine.instance().getContext() != null) {
                try {
                    BindEngine.instance().getContext().startActivity(intent);
                } catch (Exception e) {
// Path: src/com/kk/binding/kernel/BindEngine.java
// public class BindEngine {
//     private static final String TAG = "BindEngine";
//     private static BindEngine bindEngine;
//     private static IBindValueSetter bindValueSetter;
//     private static String propertyDeclareClass = "";
//     private Context mContext;
// 
//     public static BindEngine instance() {
//         if (bindEngine == null) {
//             bindEngine = new BindEngine();
//         }
//         return bindEngine;
//     }
// 
//     private BindEngine() {
//     }
// 
//     public void init(Context context) {
//         mContext = context;
//     }
// 
//     public Context getContext() {
//         return mContext;
//     }
// 
//     public static void setBindValueSetter(IBindValueSetter bindValueSetter) {
//         BindEngine.bindValueSetter = bindValueSetter;
//     }
// 
//     public static IBindValueSetter getBindValueSetter() {
//         return bindValueSetter;
//     }
// 
//     /**
//      * @param propertyDeclareClassName
//      */
//     public static void registerPropertyDeclareClass(String propertyDeclareClassName) {
//         if (!StringUtil.compare(propertyDeclareClass, propertyDeclareClassName)) {
//             propertyDeclareClass = propertyDeclareClassName;
//             BindLog.d(TAG, "registerPropertyDeclareClass:  " + propertyDeclareClass);
//             if (!StringUtil.isNullOrEmpty(propertyDeclareClass)) {
//                 Class<?> clazz = null;
//                 try {
//                     clazz = Class.forName(propertyDeclareClass);
//                     BindLog.d(TAG, "parse propertyDeclareClass success " + clazz.toString());
//                 } catch (ClassNotFoundException e) {
//                     if (BindLog.isInDesignMode())
//                         throw new RuntimeException("parse propertyDeclareClass failed " + e.toString());
//                     BindLog.e(TAG, "parse propertyDeclareClass failed " + e.toString());
//                 }
//                 if (clazz != null) {
//                     try {
//                         Object instance = clazz.newInstance();
//                         if (instance != null)
//                             BindLog.d(TAG, "create propertyDeclareClass instance success " + instance.toString());
//                     } catch (Exception e) {
//                         if (BindLog.isInDesignMode())
//                             throw new RuntimeException("create propertyDeclareClass instance failed " + e.toString());
//                         BindLog.e(TAG, "create propertyDeclareClass instance failed " + e.toString());
//                     }
//                 }
//             }
//         }
//     }
// 
// }
// 
// Path: src/com/kk/binding/util/BindLog.java
// public class BindLog {
//     private static boolean inDesignMode = false;
//     private static StringBuilder fullLog;
//     private static boolean logOpen = true;
// 
//     public static void d(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.d(tag, log);
//         }
//     }
// 
//     public static void i(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.i(tag, log);
//         }
//     }
// 
//     public static void v(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.v(tag, log);
//         }
//     }
// 
//     public static void e(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.e(tag, log);
//         }
//     }
// 
//     public static void w(String tag, String log) {
//         if (inDesignMode) {
//             designLog(tag, log);
//         } else if (logOpen) {
//             Log.w(tag, log);
//         }
//     }
// 
//     private static void designLog(String tag, String log) {
//         if (fullLog != null) {
//             fullLog.append("\nTAG: ").append(tag).append(" ");
//             fullLog.append(log);
//             fullLog.append("\n");
//         }
//     }
// 
//     public static void throwDesignLog() {
//         if (inDesignMode) {
//             throw new RuntimeException(fullLog != null ? fullLog.toString() : null);
//         }
//     }
// 
//     public static void setInDesignMode(boolean inDesignMode) {
//         BindLog.inDesignMode = inDesignMode;
//         if (inDesignMode) {
//             fullLog = new StringBuilder(1024 * 10);
//         }
//     }
// 
//     public static boolean isInDesignMode() {
//         return inDesignMode;
//     }
// 
//     public static void setBindLogOpen(boolean open) {
//         logOpen = open;
//     }
// 
//     public static boolean isLogOpen() {
//         return logOpen;
//     }
// }


// Path: src/com/kk/binding/command/UrlNavCommand.java
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import com.kk.binding.kernel.BindEngine;
import com.kk.binding.util.BindLog;

/*
 * Copyright (C) 2013 kk-team.com.
 *
 * 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 com.kk.binding.command;



/**
 * Created by hk on 13-12-13.
 */
public class UrlNavCommand implements ICommand {
    @Override
    public void execute(View view, Object... args) {
        if (args.length > 0 && args[0] instanceof String) {
            Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setData(Uri.parse((String) args[0]));
            if (BindEngine.instance().getContext() != null) {
                try {
                    BindEngine.instance().getContext().startActivity(intent);
                } catch (Exception e) {
                    BindLog.e("UrlNavCommand execute exception ", e.toString());