NSCREEN : remove unused code. 31/20731/2
authoryonghwan82.jeon <yonghwan82.jeon@samsung.com>
Mon, 12 May 2014 12:08:58 +0000 (21:08 +0900)
committeryonghwan82.jeon <yonghwan82.jeon@samsung.com>
Mon, 12 May 2014 12:27:43 +0000 (21:27 +0900)
remove unused code.

Change-Id: I6b2467c5682fc633a15741439872eb3dcf2117ab
Signed-off-by: yonghwan82.jeon <yonghwan82.jeon@samsung.com>
13 files changed:
org.tizen.webuibuilder/plugin.xml
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/app/AppManager.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/nscreen/DeviceManager.java [moved from org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/nscreen/DeviceManger.java with 92% similarity]
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/nscreen/NScreenModelManager.java [moved from org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/nscreen/NScreenModelManger.java with 98% similarity]
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/editor/PageDesignerToolbar.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/newnscreen/NScreenView.java [deleted file]
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/newnscreen/NScreenViewPage.java [deleted file]
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/NScreenItem.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/dialog/NScreenInputWizardPage.java [moved from org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/newnscreen/NScreenInputWizardPage.java with 99% similarity]
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/dialog/NScreenViewMessages.java [moved from org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/newnscreen/NScreenViewMessages.java with 95% similarity]
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/dialog/NScreenViewMessages.properties [moved from org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/newnscreen/NScreenViewMessages.properties with 100% similarity]
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/dialog/NscreenInputWizard.java [moved from org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/newnscreen/NscreenInputWizard.java with 95% similarity]
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/model/NScreenModel.java [deleted file]

index 27165c8..54005db 100644 (file)
@@ -40,7 +40,7 @@
                relative="org.eclipse.ui.views.ContentOutline">
          </view>
          <view
-               id="org.tizen.webuibuilder.ui.views.NScreenView3"
+               id="org.tizen.webuibuilder.ui.views.NScreenView"
                minimized="false"
                relationship="stack"
                relative="org.eclipse.ui.views.ContentOutline">
          <newWizardShortcut
                id="org.tizen.web.project.wizard.webapp">
          </newWizardShortcut>
-         <view
-               id="org.tizen.webuibuilder.ui.views.NScreenView"
-               minimized="false"
-               relationship="stack"
-               relative="org.eclipse.ui.views.ContentOutline">
-         </view>
       </perspectiveExtension>
    </extension>
    <extension
       <view
             category="org.tizen.nativeapp.viewCategory"
             class="org.tizen.webuibuilder.ui.views.nscreen.NScreenView"
-            id="org.tizen.webuibuilder.ui.views.NScreenView3"
-            name="NScreen3"
+            id="org.tizen.webuibuilder.ui.views.NScreenView"
+            name="%nscreenViewName"
             restorable="true">
       </view>
       <view
             name="%timeline"
             restorable="true">
       </view>
-      <view
-            category="org.tizen.nativeapp.viewCategory"
-            class="org.tizen.webuibuilder.ui.views.newnscreen.NScreenView"
-            icon="res/icons/checkboxitem_16.png"
-            id="org.tizen.webuibuilder.ui.views.NScreenView"
-            name="%nscreenViewName"
-            restorable="true">
-      </view>
    </extension>
    <extension
          point="org.eclipse.ui.newWizards">
index ec13c49..64dc178 100644 (file)
@@ -46,7 +46,7 @@ import org.tizen.webuibuilder.model.css.CssFile;
 import org.tizen.webuibuilder.model.css.io.CssReader;
 import org.tizen.webuibuilder.model.descriptors.DescriptorManager;
 import org.tizen.webuibuilder.model.filedata.AppFileData;
-import org.tizen.webuibuilder.model.nscreen.NScreenModelManger;
+import org.tizen.webuibuilder.model.nscreen.NScreenModelManager;
 import org.tizen.webuibuilder.model.nscreen.descriptors.NScreenDescriptor;
 import org.tizen.webuibuilder.model.page.IPageDataSetListener;
 import org.tizen.webuibuilder.model.page.PageData;
@@ -85,7 +85,7 @@ public class AppManager implements IPageDataSetListener, IAppListener {
 
     private String rootFullPath;
 
-    private NScreenModelManger nscreenModelManger;
+    private NScreenModelManager nscreenModelManger;
     private NScreenDescriptor nscreenDescriptor;
 
     /**
@@ -99,7 +99,7 @@ public class AppManager implements IPageDataSetListener, IAppListener {
         this.projectManager = projectManager;
         this.descriptorManager = descriptorManager;
         partFactory = new PartFactory(descriptorManager);
-        nscreenModelManger = new NScreenModelManger();
+        nscreenModelManger = new NScreenModelManager();
         nscreenDescriptor = new NScreenDescriptor(this);
 
         pageDataSet = new PageDataSet();
@@ -868,7 +868,7 @@ public class AppManager implements IPageDataSetListener, IAppListener {
         return null;
     }
 
-    public NScreenModelManger getNScreenModelManger() {
+    public NScreenModelManager getNScreenModelManger() {
         return this.nscreenModelManger;
     }
 
@@ -31,18 +31,18 @@ import org.slf4j.LoggerFactory;
 import org.tizen.webuibuilder.model.nscreen.Device.Orientation;
 
 
-public class DeviceManger {
-    Logger logger = LoggerFactory.getLogger(DeviceManger.class);
+public class DeviceManager {
+    Logger logger = LoggerFactory.getLogger(DeviceManager.class);
 
-    static DeviceManger manager = null;
+    static DeviceManager manager = null;
     private List<Device> devices = new LinkedList<Device>();
 
-    private DeviceManger() {
+    private DeviceManager() {
     }
 
-    public static DeviceManger getDeviceManager() {
+    public static DeviceManager getDeviceManager() {
         if (manager == null) {
-            manager = new DeviceManger();
+            manager = new DeviceManager();
             manager.load();
         }
         return manager;
@@ -31,10 +31,10 @@ import org.tizen.webuibuilder.BuilderConstants;
 import org.tizen.webuibuilder.model.nscreen.NScreenModel.NScreenType;
 
 
-public class NScreenModelManger {
+public class NScreenModelManager {
     private List<NScreenModel> nscreenModels = new ArrayList<NScreenModel>();
 
-    public NScreenModelManger() {
+    public NScreenModelManager() {
     }
 
     public NScreenModel createCommonNscreen() {
index 222f57f..97caecd 100644 (file)
@@ -57,7 +57,7 @@ import org.tizen.webuibuilder.model.Part;
 import org.tizen.webuibuilder.model.app.AppManager;
 import org.tizen.webuibuilder.model.nscreen.Device;
 import org.tizen.webuibuilder.model.nscreen.Device.Orientation;
-import org.tizen.webuibuilder.model.nscreen.DeviceManger;
+import org.tizen.webuibuilder.model.nscreen.DeviceManager;
 import org.tizen.webuibuilder.nl.BuilderMessages;
 import org.tizen.webuibuilder.ui.views.nscreen.NScreenItem;
 import org.tizen.webuibuilder.utility.Platform;
@@ -171,7 +171,7 @@ public class PageDesignerToolbar implements ISelectionListener {
         // }
 
         if (!resolution.getDeviceMode().equals(appManager.getFrameworkScale())) {
-            setResolution(DeviceManger.getDeviceManager().getDevices(), null);
+            setResolution(DeviceManager.getDeviceManager().getDevices(), null);
             resetMenuPart();
         }
 
diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/newnscreen/NScreenView.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/newnscreen/NScreenView.java
deleted file mode 100644 (file)
index e19d2a8..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * UI Builder
- *
- * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * 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.
- *
- * Contributors:
- * - S-Core Co., Ltd
- *
- */
-
-
-package org.tizen.webuibuilder.ui.views.newnscreen;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.IPage;
-import org.eclipse.ui.part.MessagePage;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.part.PageBookView;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.tizen.webuibuilder.ui.editor.PageDesignerForHTML;
-import org.tizen.webuibuilder.ui.views.nscreen.NScreenViewMessages;
-
-
-/**
- * This sample class demonstrates how to plug-in a new workbench view. The view shows data obtained
- * from the model. The sample creates a dummy model on the fly, but a real implementation would
- * connect to the model available either in this or another plug-in (e.g. the workspace). The view
- * is connected to the model using a content provider.
- * <p>
- * The view uses a label provider to define how model objects should be presented in the view. Each
- * view can present the same model objects using different labels and icons, if needed.
- * Alternatively, a single label provider can be shared between views in order to ensure that
- * objects of the same type are presented in the same way everywhere.
- * <p>
- */
-
-public class NScreenView extends PageBookView {
-    private static Logger logger = LoggerFactory.getLogger(NScreenView.class);
-
-    /**
-     * The constructor.
-     */
-    public NScreenView() {
-    }
-
-    @Override
-    /*
-     * (non-Javadoc) Passing the focus request to the viewer's control.
-     * 
-     * @see org.eclipse.ui.part.PageBookView#setFocus()
-     */
-    public void setFocus() {
-    }
-
-    @Override
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.ui.part.PageBookView#createDefaultPage(org.eclipse.ui.part.PageBook)
-     */
-    protected IPage createDefaultPage(PageBook book) {
-        MessagePage messagePage = new MessagePage();
-        initPage(messagePage);
-        messagePage.setMessage(NScreenViewMessages.MESSAGE_DEFAULT);
-        messagePage.createControl(book);
-        return messagePage;
-    }
-
-    @Override
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.ui.part.PageBookView#doCreatePage(org.eclipse.ui.IWorkbenchPart)
-     */
-    protected PageRec doCreatePage(IWorkbenchPart part) {
-        PageRec rec = null;
-        if (part instanceof PageDesignerForHTML) {
-            NScreenViewPage page = new NScreenViewPage();
-            initPage(page);
-            page.createControl(getPageBook());
-            rec = new PageRec(part, page);
-        } else {
-            logger.info("Call default Page.");
-        }
-        return rec;
-    }
-
-    @Override
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.ui.part.PageBookView#doDestroyPage(org.eclipse.ui.IWorkbenchPart,
-     * org.eclipse.ui.part.PageBookView.PageRec)
-     */
-    protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
-        pageRecord.page.dispose();
-    }
-
-    @Override
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.ui.part.PageBookView#getBootstrapPart()
-     */
-    protected IWorkbenchPart getBootstrapPart() {
-        IWorkbench workbench = PlatformUI.getWorkbench();
-        if (workbench == null) {
-            return null;
-        }
-
-        IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
-        if (window == null) {
-            return null;
-        }
-
-        IWorkbenchPage page = window.getActivePage();
-        if (page == null) {
-            return null;
-        }
-
-        IEditorPart editor = page.getActiveEditor();
-        if (editor == null) {
-            return null;
-        }
-
-        return editor;
-    }
-
-    @Override
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.eclipse.ui.part.PageBookView#isImportant(org.eclipse.ui.IWorkbenchPart)
-     */
-    protected boolean isImportant(IWorkbenchPart part) {
-        if (!(part instanceof PageDesignerForHTML)) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/newnscreen/NScreenViewPage.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/newnscreen/NScreenViewPage.java
deleted file mode 100644 (file)
index 9787f0e..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * UI Builder
- *
- * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * 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.
- *
- * Contributors:
- * - S-Core Co., Ltd
- *
- */
-
-
-package org.tizen.webuibuilder.ui.views.newnscreen;
-
-import java.util.List;
-
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.Page;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.tizen.webuibuilder.model.nscreen.Device;
-import org.tizen.webuibuilder.model.nscreen.DeviceManger;
-import org.tizen.webuibuilder.model.nscreen.NScreenModel;
-import org.tizen.webuibuilder.ui.editor.PageDesigner;
-
-
-public class NScreenViewPage extends Page {
-    private static Logger logger = LoggerFactory.getLogger(NScreenViewPage.class);
-
-    private Composite parentComposite;
-    private Button button1;
-    private Button button2;
-
-    /**
-     * Creates a new page.
-     */
-
-    public NScreenViewPage() {
-        // nothing.
-    }
-
-    @Override
-    public void createControl(Composite parent) {
-        this.parentComposite = new Composite(parent, SWT.NULL);
-        layout();
-    }
-
-    @Override
-    public Control getControl() {
-        return this.parentComposite;
-    }
-
-    /**
-     * Sets focus to a part in the page.
-     */
-
-    @Override
-    public void setFocus() {
-        this.parentComposite.setFocus();
-    }
-
-    private void layout() {
-        this.parentComposite.setLayout(new FillLayout());
-
-        button1 = new Button(this.parentComposite, SWT.PUSH);
-        button1.setText("Add/Edit");
-        button1.pack();
-
-        button2 = new Button(this.parentComposite, SWT.PUSH);
-        button2.setText("Custom Device Manger");
-        button2.pack();
-
-        button1.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                logger.info("Button1 push and Pop Up New Nscreen Input Dialog.");
-
-                NscreenInputWizard wizard = new NscreenInputWizard();
-                WizardDialog dialog = openWizardDialog(wizard);
-                if (dialog == null) {
-                    logger.info("NscreenInputWizard Dialog is null");
-                    return;
-                }
-                dialog.open();
-            }
-        });
-
-        button2.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                logger.info("Button2 push.");
-
-                Device device = DeviceManger.getDeviceManager().getDevices().get(0);
-                System.out.println(device.print());
-
-                IWorkbench workbench = PlatformUI.getWorkbench();
-                IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
-
-                IEditorPart ieditor = window.getActivePage().getActiveEditor();
-
-                PageDesigner editor = (PageDesigner) ieditor;
-                List<NScreenModel> list =
-                        editor.getAppManager().getNScreenModelManger()
-                                .getNScreenModelsForDevice(device);
-                String printData = "";
-                for (int i = 0; i < list.size(); i++) {
-                    NScreenModel model = list.get(i);
-                    printData += "ModelName :";
-                    printData += model.getName();
-                    printData += "\n";
-                }
-                System.out.println(printData);
-
-            }
-        });
-
-    }
-
-    private WizardDialog openWizardDialog(IWizard newWizard) {
-        IWorkbench workbench = PlatformUI.getWorkbench();
-        IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
-        if (window == null) {
-            logger.info("IWorkbenchWindow is null");
-            return null;
-        }
-        Shell shell = window.getShell();
-        if (shell == null) {
-            logger.info("Shell is null");
-            return null;
-        }
-
-        WizardDialog dialog = new WizardDialog(shell, newWizard);
-        return dialog;
-    }
-
-}
index dc05de0..e75e185 100644 (file)
@@ -25,7 +25,7 @@ import org.eclipse.swt.widgets.MenuItem;
 import org.tizen.webuibuilder.animator.ui.views.timeline.common.ColorResource;
 import org.tizen.webuibuilder.model.css.CssFile;
 import org.tizen.webuibuilder.model.nscreen.Device;
-import org.tizen.webuibuilder.model.nscreen.DeviceManger;
+import org.tizen.webuibuilder.model.nscreen.DeviceManager;
 import org.tizen.webuibuilder.model.nscreen.NScreenModel;
 import org.tizen.webuibuilder.model.nscreen.NScreenModel.NScreenType;
 import org.tizen.webuibuilder.ui.views.nscreen.command.NScreenDisableCommand;
@@ -200,7 +200,7 @@ public class NScreenItem extends Composite {
     }
 
     private List<Device> filterScreen() {
-        List<Device> devices = DeviceManger.getDeviceManager().getDevices();
+        List<Device> devices = DeviceManager.getDeviceManager().getDevices();
 
         NScreenType type = model.getType();
 
diff --git a/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/model/NScreenModel.java b/org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/nscreen/model/NScreenModel.java
deleted file mode 100644 (file)
index 11a9d7d..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * UI Builder
- *
- * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * 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.
- *
- * Contributors:
- * - S-Core Co., Ltd
- *
- */
-
-
-package org.tizen.webuibuilder.ui.views.nscreen.model;
-
-public class NScreenModel {
-    private String mTitle;
-    private int mWidth;
-    private int mHeight;
-    private String mFileName;
-
-    public NScreenModel(String title, int width, int height, String fileName) {
-        mTitle = title;
-        mWidth = width;
-        mHeight = height;
-        mFileName = fileName;
-    }
-
-    public NScreenModel() {
-        this("Basic", 0, 0, "");
-    }
-
-    public String getTitle() {
-        return mTitle;
-    }
-
-    public void setTitle(String title) {
-        mTitle = title;
-    }
-
-    public int getWidth() {
-        return mWidth;
-    }
-
-    public void setWidth(int width) {
-        mWidth = width;
-    }
-
-    public int getHeight() {
-        return mHeight;
-    }
-
-    public void setHeight(int height) {
-        mHeight = height;
-    }
-
-    public String getFileName() {
-        return mFileName;
-    }
-
-    public void setFileName(String fileName) {
-        mFileName = fileName;
-    }
-
-}