mail[Wesnoth-commits] r44378 - in /trunk/utils/java/eclipse_plugin: ./ src/wesnoth_eclipse_plugin/action/ src/wesnoth_eclipse_plugin/handlers/ src...


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by timotei_cluj on July 19, 2010 - 17:43:
Author: timotei
Date: Mon Jul 19 17:43:06 2010
New Revision: 44378

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44378&view=rev
Log:
eclipse plugin: make the wmltools menu entry available for folders too

Added:
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/RunWMLLintOnSelection.java
      - copied, changed from r44377, 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/RunWMLLintOnFile.java
Removed:
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/RunWMLLintOnFile.java
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/WmlTagWizardPage.java
Modified:
    trunk/utils/java/eclipse_plugin/plugin.xml
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/handlers/TestHandler.java
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WMLTools.java
    
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WorkspaceUtils.java

Modified: trunk/utils/java/eclipse_plugin/plugin.xml
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/plugin.xml?rev=44378&r1=44377&r2=44378&view=diff
==============================================================================
--- trunk/utils/java/eclipse_plugin/plugin.xml (original)
+++ trunk/utils/java/eclipse_plugin/plugin.xml Mon Jul 19 17:43:06 2010
@@ -47,27 +47,6 @@
                label="Wesnoth project report"
                menubarPath="_wesnoth">
          </action>
-         <menu
-               icon="icons/wesnoth-icon_16.png"
-               id="plugin.wmltoolsProjMenu"
-               label="WML Tools"
-               path="_wesnoth">
-            <groupMarker
-                  name="wmltoolsProjMenuMarker">
-            </groupMarker>
-         </menu>
-         <action
-               class="wesnoth_eclipse_plugin.action.RunWMLIndentOnSelection"
-               id="action.proj.wmlindent"
-               label="Run &quot;wmlindent&quot; on the project this file"
-               menubarPath="plugin.wmltoolsProjMenu/wmltoolsProjMenuMarker">
-         </action>
-         <action
-               class="wesnoth_eclipse_plugin.action.RunWMLScopeOnSelection"
-               id="action.proj.wmlscope"
-               label="Run &quot;wmlscope&quot; on the project"
-               menubarPath="plugin.wmltoolsProjMenu/wmltoolsProjMenuMarker">
-         </action>
       </objectContribution>
       <objectContribution
             adaptable="false"
@@ -141,7 +120,7 @@
             </groupMarker>
          </menu>
          <action
-               class="wesnoth_eclipse_plugin.action.RunWMLLintOnFile"
+               class="wesnoth_eclipse_plugin.action.RunWMLLintOnSelection"
                id="action.cfg.wmllintOnFile"
                label="Run &quot;wmllint&quot; on this file"
                menubarPath="plugin.wmltoolsCfgMenu/wmltoolsCfgMenuMarker">
@@ -185,6 +164,33 @@
                id="action.container.startCampaign"
                label="Open campaign in game"
                menubarPath="_wesnoth">
+         </action>
+         <menu
+               icon="icons/wesnoth-icon_16.png"
+               id="plugin.wmltoolsContainerMenu"
+               label="WML Tools"
+               path="_wesnoth">
+            <groupMarker
+                  name="wmltoolsContainerMenuMarker">
+            </groupMarker>
+         </menu>
+         <action
+               class="wesnoth_eclipse_plugin.action.RunWMLScopeOnSelection"
+               id="action.container.wmlscope"
+               label="Run &quot;wmlscope&quot; on the container"
+               
menubarPath="plugin.wmltoolsContainerMenu/wmltoolsContainerMenuMarker">
+         </action>
+         <action
+               class="wesnoth_eclipse_plugin.action.RunWMLIndentOnSelection"
+               id="action.container.wmlindent"
+               label="Run &quot;wmlindent&quot; on the container"
+               
menubarPath="plugin.wmltoolsContainerMenu/wmltoolsContainerMenuMarker">
+         </action>
+         <action
+               class="wesnoth_eclipse_plugin.action.RunWMLLintOnSelection"
+               id="action.container.wmllintOnFile"
+               label="Run &quot;wmllint&quot; on the container"
+               
menubarPath="plugin.wmltoolsContainerMenu/wmltoolsContainerMenuMarker">
          </action>
       </objectContribution>
    </extension>

Removed: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/RunWMLLintOnFile.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/RunWMLLintOnFile.java?rev=44377&view=auto
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/RunWMLLintOnFile.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/RunWMLLintOnFile.java
 (removed)
@@ -1,39 +1,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 by Timotei Dolean <timotei21@xxxxxxxxx>
- *
- * This program and the accompanying materials are made available
- * under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- 
*******************************************************************************/
-package wesnoth_eclipse_plugin.action;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-import wesnoth_eclipse_plugin.utils.WMLTools;
-import wesnoth_eclipse_plugin.utils.WMLTools.Tools;
-
-public class RunWMLLintOnFile implements IObjectActionDelegate
-{
-       public RunWMLLintOnFile() {
-       }
-
-       @Override
-       public void setActivePart(IAction action, IWorkbenchPart targetPart)
-       {
-       }
-
-       @Override
-       public void run(IAction action)
-       {
-               WMLTools.runWMLToolAsWorkspaceJob(Tools.WMLLINT, null);
-       }
-
-       @Override
-       public void selectionChanged(IAction action, ISelection selection)
-       {
-       }
-}

Copied: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/RunWMLLintOnSelection.java
 (from r44377, 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/RunWMLLintOnFile.java)
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/RunWMLLintOnSelection.java?p2=trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/RunWMLLintOnSelection.java&p1=trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/RunWMLLintOnFile.java&r1=44377&r2=44378&rev=44378&view=diff
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/RunWMLLintOnFile.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/action/RunWMLLintOnSelection.java
 Mon Jul 19 17:43:06 2010
@@ -16,9 +16,9 @@
 import wesnoth_eclipse_plugin.utils.WMLTools;
 import wesnoth_eclipse_plugin.utils.WMLTools.Tools;
 
-public class RunWMLLintOnFile implements IObjectActionDelegate
+public class RunWMLLintOnSelection implements IObjectActionDelegate
 {
-       public RunWMLLintOnFile() {
+       public RunWMLLintOnSelection() {
        }
 
        @Override

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/handlers/TestHandler.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/handlers/TestHandler.java?rev=44378&r1=44377&r2=44378&view=diff
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/handlers/TestHandler.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/handlers/TestHandler.java
 Mon Jul 19 17:43:06 2010
@@ -24,6 +24,7 @@
        @Override
        public Object execute(ExecutionEvent event) throws ExecutionException
        {
+               //System.out.println(WorkspaceUtils.getSelectedContainer());
 //             MessageConsole con = GUIUtils.createConsole("TIMO", null, 
true);
 //             List<String> arguments = new ArrayList<String>();
 //             
arguments.add(Preferences.getString(Constants.P_WESNOTH_WORKING_DIR));
@@ -42,7 +43,7 @@
 //                     tool.kill(true);
 //             }
                //tool.waitForTool();
-               System.out.println("Exitt");
+               //System.out.println("Exitt");
                //String stdin = EditorUtils.getEditorDocument().get();
                //EditorUtils.replaceEditorText(WMLTools.runWMLIndent(null, 
stdin, false, false, false));
                //              IEditorReference[] files =

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WMLTools.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WMLTools.java?rev=44378&r1=44377&r2=44378&view=diff
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WMLTools.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WMLTools.java
 Mon Jul 19 17:43:06 2010
@@ -175,8 +175,8 @@
                                        {
                                                if (selFile != null)
                                                        location = 
selFile.getLocation().toOSString();
-                                               else //TODO: add container 
instead of project?
-                                                       location = 
WorkspaceUtils.getSelectedProject().getLocation().toOSString();
+                                               else
+                                                       location = 
WorkspaceUtils.getSelectedContainer().getLocation().toOSString();
                                        }
 
                                        switch(tool)

Modified: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WorkspaceUtils.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WorkspaceUtils.java?rev=44378&r1=44377&r2=44378&view=diff
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WorkspaceUtils.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WorkspaceUtils.java
 Mon Jul 19 17:43:06 2010
@@ -16,6 +16,7 @@
 import java.util.Random;
 
 import org.eclipse.core.resources.FileInfoMatcherDescription;
+import org.eclipse.core.resources.IContainer;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IProject;
@@ -114,6 +115,17 @@
                return 
getSelectedStructuredSelection(WorkspaceUtils.getWorkbenchWindow());
        }
 
+       public static IContainer getSelectedContainer()
+       {
+               IStructuredSelection selection = 
getSelectedStructuredSelection();
+               if (selection == null ||
+                       !(selection.getFirstElement() instanceof IFolder ||
+                         selection.getFirstElement() instanceof IProject))
+                       return null;
+
+               return (IContainer) selection.getFirstElement();
+       }
+
        public static IResource getSelectedResource()
        {
                IResource res = getSelectedFile();

Removed: 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/WmlTagWizardPage.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/WmlTagWizardPage.java?rev=44377&view=auto
==============================================================================
--- 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/WmlTagWizardPage.java
 (original)
+++ 
trunk/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/wizards/WmlTagWizardPage.java
 (removed)
@@ -1,50 +1,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 by Timotei Dolean <timotei21@xxxxxxxxx>
- *
- * This program and the accompanying materials are made available
- * under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- 
*******************************************************************************/
-package wesnoth_eclipse_plugin.wizards;
-
-import org.wesnoth.wml.schema.SchemaTag;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author fabi
- *
- */
-public class WmlTagWizardPage extends WizardPage {
-
-       /**
-        * @param pageName
-        */
-       public WmlTagWizardPage(SchemaTag tag, ImageDescriptor titleImage) {
-               super(tag.getName(), tag.getName(), titleImage);
-       }
-
-//     /**
-//      * @param pageName
-//      * @param title
-//      * @param titleImage
-//      */
-//     public WmlTagWizardPage(String pageName, String title,
-//                     ImageDescriptor titleImage) {
-//             super(pageName, title, titleImage);
-//             // TODO Auto-generated constructor stub
-//     }
-
-       /* (non-Javadoc)
-        * @see 
org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
-        */
-       @Override
-       public void createControl(Composite parent) {
-               // TODO Auto-generated method stub
-
-       }
-
-}




Related Messages


Powered by MHonArc, Updated Mon Jul 19 18:00:14 2010