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) {
@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");
+ }
}
});
}
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;
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;
public static void nscreen_log(String log) {
if (logEnabled) {
console.println("[NSCREEN_LOG] " + log);
- System.out.println("[NSCREEN_LOG] " + log);
+ logger.info(log);
}
}