incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stefane...@apache.org
Subject svn commit: r1519380 - in /sling/trunk/tooling/ide/eclipse-ui: ./ src/org/apache/sling/ide/eclipse/ui/internal/
Date Mon, 02 Sep 2013 10:08:08 GMT
Author: stefanegli
Date: Mon Sep  2 10:08:08 2013
New Revision: 1519380

URL: http://svn.apache.org/r1519380
Log:
SLING-3009 and SLING-3030 : visually mark sling content/bundle projects with a small 'S'

Added:
    sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/SlingProjectDecorator.java
    sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/slingDecoration.png
  (with props)
Modified:
    sling/trunk/tooling/ide/eclipse-ui/plugin.xml
    sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/SharedImages.java

Modified: sling/trunk/tooling/ide/eclipse-ui/plugin.xml
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-ui/plugin.xml?rev=1519380&r1=1519379&r2=1519380&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-ui/plugin.xml (original)
+++ sling/trunk/tooling/ide/eclipse-ui/plugin.xml Mon Sep  2 10:08:08 2013
@@ -352,6 +352,28 @@
       	</action>
       </objectContribution>
          
+   </extension>
+   <extension
+         point="org.eclipse.ui.decorators">
+      <decorator
+            adaptable="true"
+            class="org.apache.sling.ide.eclipse.ui.internal.SlingProjectDecorator"
+            id="org.apache.sling.ide.eclipse-ui.decorator"
+            label="Sling Project Decorator"
+            lightweight="true"
+            location="BOTTOM_RIGHT"
+            state="true">
+         <enablement>
+            <and>
+               <objectClass
+                     name="org.eclipse.core.resources.IResource">
+               </objectClass>
+               <objectClass
+                     name="org.eclipse.core.resources.IProject">
+               </objectClass>
+            </and>
+         </enablement>
+      </decorator>
    </extension> 
    
 </plugin>    

Modified: sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/SharedImages.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/SharedImages.java?rev=1519380&r1=1519379&r2=1519380&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/SharedImages.java
(original)
+++ sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/SharedImages.java
Mon Sep  2 10:08:08 2013
@@ -35,6 +35,7 @@ public final class SharedImages {
     public static final ImageDescriptor DISCONNECT = DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DISCONNECT);
     public static final ImageDescriptor RUN_CONNECT = new DecorationOverlayIcon(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_ACT_RUN).createImage(),
ImageDescriptor.createFromFile(SharedImages.class, "connectOverlay.png"), IDecoration.BOTTOM_RIGHT);
     public static final ImageDescriptor DEBUG_CONNECT = new DecorationOverlayIcon(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_ACT_DEBUG).createImage(),
ImageDescriptor.createFromFile(SharedImages.class, "connectOverlay.png"), IDecoration.BOTTOM_RIGHT);
+	public static final ImageDescriptor SLING_DECORATION = ImageDescriptor.createFromFile(SharedImages.class,
"slingDecoration.png");
 
     private SharedImages() {
     }

Added: sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/SlingProjectDecorator.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/SlingProjectDecorator.java?rev=1519380&view=auto
==============================================================================
--- sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/SlingProjectDecorator.java
(added)
+++ sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/SlingProjectDecorator.java
Mon Sep  2 10:08:08 2013
@@ -0,0 +1,60 @@
+/*
+ * 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.sling.ide.eclipse.ui.internal;
+
+import org.apache.sling.ide.eclipse.core.internal.ProjectHelper;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.viewers.IDecoration;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ILightweightLabelDecorator;
+
+public class SlingProjectDecorator implements ILightweightLabelDecorator {
+
+	@Override
+	public void addListener(ILabelProviderListener listener) {
+	}
+
+	@Override
+	public void dispose() {
+	}
+
+	@Override
+	public boolean isLabelProperty(Object element, String property) {
+		return false;
+	}
+
+	@Override
+	public void removeListener(ILabelProviderListener listener) {
+	}
+
+	@Override
+	public void decorate(Object element, IDecoration decoration) {
+		if (!(element instanceof IProject)) {
+			return;
+		}
+		IProject project = (IProject)element;
+		if (ProjectHelper.isBundleProject(project) || ProjectHelper.isContentProject(project))
{
+			// then decorate
+			decoration.addOverlay(SharedImages.SLING_DECORATION, IDecoration.BOTTOM_RIGHT);
+		} else {
+			// dont decorate
+			return;
+		}
+	}
+
+
+}

Added: sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/slingDecoration.png
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/slingDecoration.png?rev=1519380&view=auto
==============================================================================
Binary file - no diff available.

Propchange: sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/slingDecoration.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Mime
View raw message