Author: timotei
Date: Mon Aug 1 20:53:38 2011
New Revision: 50538
URL: http://svn.gna.org/viewcvs/wesnoth?rev=50538&view=rev
Log:
eclipse plugin: Implement proper naming for
WMLRoot and XtextDocument elements
Modified:
trunk/utils/umc_dev/org.wesnoth.ui/src/org/wesnoth/ui/labeling/WMLLabelProvider.java
trunk/utils/umc_dev/org.wesnoth.ui/src/org/wesnoth/ui/outline/WMLOutlineTreeProvider.java
Modified:
trunk/utils/umc_dev/org.wesnoth.ui/src/org/wesnoth/ui/labeling/WMLLabelProvider.java
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/umc_dev/org.wesnoth.ui/src/org/wesnoth/ui/labeling/WMLLabelProvider.java?rev=50538&r1=50537&r2=50538&view=diff
==============================================================================
---
trunk/utils/umc_dev/org.wesnoth.ui/src/org/wesnoth/ui/labeling/WMLLabelProvider.java
(original)
+++
trunk/utils/umc_dev/org.wesnoth.ui/src/org/wesnoth/ui/labeling/WMLLabelProvider.java
Mon Aug 1 20:53:38 2011
@@ -13,6 +13,7 @@
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.xtext.ui.editor.model.XtextDocument;
import org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider;
import com.google.inject.Inject;
@@ -25,6 +26,7 @@
public class WMLLabelProvider extends DefaultEObjectLabelProvider
{
private static WMLLabelProvider instance_;
+
@Inject
public WMLLabelProvider(AdapterFactoryLabelProvider delegate) {
super(delegate);
@@ -51,4 +53,14 @@
return null;
return instance_.getImage(fileName);
}
+
+ @Override
+ public String getText( Object element )
+ {
+ if ( element instanceof XtextDocument ) {
+ return "Document";
+ }
+
+ return super.getText( element );
+ }
}
Modified:
trunk/utils/umc_dev/org.wesnoth.ui/src/org/wesnoth/ui/outline/WMLOutlineTreeProvider.java
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/umc_dev/org.wesnoth.ui/src/org/wesnoth/ui/outline/WMLOutlineTreeProvider.java?rev=50538&r1=50537&r2=50538&view=diff
==============================================================================
---
trunk/utils/umc_dev/org.wesnoth.ui/src/org/wesnoth/ui/outline/WMLOutlineTreeProvider.java
(original)
+++
trunk/utils/umc_dev/org.wesnoth.ui/src/org/wesnoth/ui/outline/WMLOutlineTreeProvider.java
Mon Aug 1 20:53:38 2011
@@ -3,12 +3,21 @@
*/
package org.wesnoth.ui.outline;
+import org.wesnoth.wml.WMLRoot;
+
import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider;
/**
* customization of the default outline structure
- *
+ *
*/
public class WMLOutlineTreeProvider extends DefaultOutlineTreeProvider {
-
+ @Override
+ protected Object _text( Object modelElement )
+ {
+ if ( modelElement instanceof WMLRoot ) {
+ return "Root";
+ }
+ return super._text( modelElement );
+ }
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits