NSCREEN : remove System.out.print log. 84/21484/1
authorjooyoul_lee <jy.exe.lee@samsung.com>
Wed, 21 May 2014 11:02:28 +0000 (20:02 +0900)
committerjooyoul_lee <jy.exe.lee@samsung.com>
Wed, 21 May 2014 11:02:28 +0000 (20:02 +0900)
1. print log - using Logger

Change-Id: I14922f1d4d7627b58cac89e4cd3139ab344a0616
Signed-off-by: jooyoul_lee <jy.exe.lee@samsung.com>
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesigner.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenBaseComposite.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenUtil.java

index 15d650d..0cf5f80 100644 (file)
@@ -383,24 +383,24 @@ public class PageDesigner extends GraphicalEditor implements CommandStackListene
         setCurrentCssFileToModel(pageData.getCurrentCssFile());
 
         if (NScreenUtil.isLogEnabled()) {
+            StringBuffer buffer = new StringBuffer();
             List<CssFile> applied = pageData.getAppliedCssFiles();
             int current = applied.indexOf(pageData.getCurrentCssFile());
-            NScreenUtil.nscreen_log("================= CSS Layer (" + applied.size()
-                    + ") =====================");
+            buffer.append("\n================= CSS Layer (" + applied.size()
+                    + ") =====================\n");
             CssFile appliedCssFile = null;
             for (int i = 0; i < applied.size(); i++) {
                 appliedCssFile = applied.get(i);
                 if (i == current) {
-                    NScreenUtil.nscreen_log(i + ". <Current> "
-                            + new File(appliedCssFile.getCssFilePath()).getName());
+                    buffer.append(i + ". <Current> "
+                            + new File(appliedCssFile.getCssFilePath()).getName() + "\n");
                 } else {
-                    NScreenUtil.nscreen_log(i + ".           "
-                            + new File(appliedCssFile.getCssFilePath()).getName());
+                    buffer.append(i + ".           "
+                            + new File(appliedCssFile.getCssFilePath()).getName() + "\n");
                 }
-
             }
-
-            NScreenUtil.nscreen_log("=====================================================");
+            buffer.append("=====================================================");
+            NScreenUtil.nscreen_log(buffer.toString());
         }
 
         if (getViewer() != null) {
index 024641a..df6f39e 100644 (file)
@@ -87,10 +87,14 @@ public class NScreenBaseComposite extends ScrolledComposite {
 
             @Override
             public void handleEvent(Event event) {
-                boolean logEnabled = NScreenUtil.isLogEnabled();
-                NScreenUtil.nscreen_log("NSCreenLog Off");
-                NScreenUtil.enableNScreenLog(!logEnabled);
-                NScreenUtil.nscreen_log("NSCreenLog On");
+                Rectangle rect = nscreenComp.getClientArea();
+                Rectangle r = new Rectangle(rect.x, rect.y, 10, 10);
+                if (r.contains(event.x, event.y)) {
+                    boolean logEnabled = NScreenUtil.isLogEnabled();
+                    NScreenUtil.nscreen_log("NSCreenLog Off");
+                    NScreenUtil.enableNScreenLog(!logEnabled);
+                    NScreenUtil.nscreen_log("NSCreenLog On");
+                }
             }
         });
     }
index edda270..07c372a 100644 (file)
@@ -14,12 +14,15 @@ import java.util.Iterator;
 import java.util.Map.Entry;
 
 import org.eclipse.swt.graphics.Image;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.tizen.common.ui.view.console.ConsoleManager;
 import org.tizen.webuibuilder.BuilderConstants;
 import org.tizen.webuibuilder.model.css.CssSelector;
 import org.tizen.webuibuilder.model.nscreen.NScreenModel;
 import org.tizen.webuibuilder.model.nscreen.NScreenModel.NScreenType;
 import org.tizen.webuibuilder.model.nscreen.NScreenModel.Orientation;
+import org.tizen.webuibuilder.model.nscreen.descriptors.NScreenDescriptor;
 import org.tizen.webuibuilder.utility.ResourceManager;
 
 
@@ -27,6 +30,8 @@ public class NScreenUtil {
     private static boolean logEnabled = false;
     private static ConsoleManager console;
 
+    private static Logger logger = LoggerFactory.getLogger(NScreenDescriptor.class);
+    
     public static void enableNScreenLog(boolean enabled) {
         logEnabled = enabled;
 
@@ -42,7 +47,7 @@ public class NScreenUtil {
     public static void nscreen_log(String log) {
         if (logEnabled) {
             console.println("[NSCREEN_LOG] " + log);
-            System.out.println("[NSCREEN_LOG] " + log);
+            logger.info(log);
         }
     }