You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by hi...@apache.org on 2012/07/15 23:38:08 UTC

svn commit: r1361807 - in /ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse: plugin.xml src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java src/java/org/apache/ivyde/eclipse/ui/IvyDEClasspathContainerDecorator.java

Author: hibou
Date: Sun Jul 15 21:38:07 2012
New Revision: 1361807

URL: http://svn.apache.org/viewvc?rev=1361807&view=rev
Log:
IVYDE-304: better label for the container

Added:
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/IvyDEClasspathContainerDecorator.java   (with props)
Modified:
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml?rev=1361807&r1=1361806&r2=1361807&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml Sun Jul 15 21:38:07 2012
@@ -459,5 +459,17 @@
          </filter>
       </page>
    </extension>
+   <extension
+         point="org.eclipse.ui.decorators">
+      <decorator
+            adaptable="false"
+            class="org.apache.ivyde.eclipse.ui.IvyDEClasspathContainerDecorator"
+            id="org.apache.ivyde.eclipse.decorator"
+            label="IvyDE decorator"
+            lightweight="false"
+            objectClass="org.eclipse.jdt.internal.ui.packageview.ClassPathContainer"
+            state="true">
+      </decorator>
+   </extension>
 
 </plugin>

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java?rev=1361807&r1=1361806&r2=1361807&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainer.java Sun Jul 15 21:38:07 2012
@@ -104,7 +104,7 @@ public class IvyClasspathContainer imple
     }
 
     public String getDescription() {
-        return conf.getIvyXmlPath() + " " + conf.getConfs();
+        return "Ivy";
     }
 
     public int getKind() {

Added: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/IvyDEClasspathContainerDecorator.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/IvyDEClasspathContainerDecorator.java?rev=1361807&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/IvyDEClasspathContainerDecorator.java (added)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/IvyDEClasspathContainerDecorator.java Sun Jul 15 21:38:07 2012
@@ -0,0 +1,57 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You 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.
+ *
+ */
+package org.apache.ivyde.eclipse.ui;
+
+import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainer;
+import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathUtil;
+import org.eclipse.jdt.internal.ui.packageview.ClassPathContainer;
+import org.eclipse.jface.viewers.ILabelDecorator;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.swt.graphics.Image;
+
+public class IvyDEClasspathContainerDecorator implements ILabelDecorator {
+
+    public boolean isLabelProperty(Object element, String property) {
+        return true;
+    }
+
+    public String decorateText(String text, Object element) {
+        IvyClasspathContainer ivycp = IvyClasspathUtil.jdt2IvyCPC((ClassPathContainer) element);
+        if (ivycp == null) {
+            return null;
+        }
+        return text + " " + ivycp.getConf().getIvyXmlPath() + " " + ivycp.getConf().getConfs();
+    }
+
+    public Image decorateImage(Image image, Object element) {
+        return null;
+    }
+
+    public void addListener(ILabelProviderListener listener) {
+        // nothing to do
+    }
+
+    public void dispose() {
+        // nothing to do
+    }
+
+    public void removeListener(ILabelProviderListener listener) {
+        // nothing to do
+    }
+
+}

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/IvyDEClasspathContainerDecorator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/IvyDEClasspathContainerDecorator.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/IvyDEClasspathContainerDecorator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain