propertysheet

16:51:05.568 INFO  jd.cli.Main - Decompiling propertysheet.jar
package org.eclipse.wb.draw2d;

import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;

final class IColorConstants$Utils$1
  implements Runnable
{
  IColorConstants$Utils$1(Color[] paramArrayOfColor, Display paramDisplay, int paramInt) {}
  
  public void run()
  {
    val$color[0] = val$display.getSystemColor(val$id);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.draw2d.IColorConstants.Utils.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.draw2d;

import org.eclipse.swt.graphics.Cursor;

public abstract interface ICursorConstants
{
  public static final Cursor SIZEWE = new Cursor(null, 9);
  public static final Cursor SIZENS = new Cursor(null, 7);
  public static final Cursor SIZEALL = new Cursor(null, 21);
}

/* Location:
 * Qualified Name:     org.eclipse.wb.draw2d.ICursorConstants
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.draw2d;

import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;

public class IColorConstants$Utils
{
  private static Color getSystemColor(final int paramInt)
  {
    Color[] arrayOfColor = new Color[1];
    final Display localDisplay = Display.getDefault();
    localDisplay.syncExec(new Runnable()
    {
      public void run()
      {
        val$color[0] = localDisplay.getSystemColor(paramInt);
      }
    });
    return arrayOfColor[0];
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.draw2d.IColorConstants.Utils
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.draw2d;

import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;

public abstract interface IColorConstants
{
  public static final Color buttonLightest = Utils.getSystemColor(20);
  public static final Color button = Utils.getSystemColor(22);
  public static final Color buttonDarker = Utils.getSystemColor(18);
  public static final Color listBackground = Utils.getSystemColor(25);
  public static final Color listForeground = Utils.getSystemColor(24);
  public static final Color listSelection = Utils.getSystemColor(26);
  public static final Color listSelectionText = Utils.getSystemColor(27);
  public static final Color tooltipForeground = Utils.getSystemColor(28);
  public static final Color tooltipBackground = Utils.getSystemColor(29);
  public static final Color lightGray = new Color(null, 192, 192, 192);
  public static final Color gray = new Color(null, 128, 128, 128);
  public static final Color darkGray = new Color(null, 64, 64, 64);
  public static final Color black = new Color(null, 0, 0, 0);
  public static final Color lightBlue = new Color(null, 127, 127, 255);
  public static final Color darkBlue = new Color(null, 0, 0, 127);
  
  public static class Utils
  {
    private static Color getSystemColor(final int paramInt)
    {
      Color[] arrayOfColor = new Color[1];
      final Display localDisplay = Display.getDefault();
      localDisplay.syncExec(new Runnable()
      {
        public void run()
        {
          val$color[0] = localDisplay.getSystemColor(paramInt);
        }
      });
      return arrayOfColor[0];
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.draw2d.IColorConstants
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.check;

import java.text.MessageFormat;

public final class Assert
{
  public static boolean isLegal(boolean paramBoolean)
  {
    return isLegal(paramBoolean, "");
  }
  
  public static boolean isLegal(boolean paramBoolean, String paramString)
  {
    if (!paramBoolean) {
      throw new IllegalArgumentException(paramString);
    }
    return paramBoolean;
  }
  
  public static void isNull(Object paramObject)
  {
    isNull(paramObject, "");
  }
  
  public static void isNull(Object paramObject, String paramString)
  {
    if (paramObject != null) {
      throw new AssertionFailedException("null argument expected: " + paramString);
    }
  }
  
  public static void isNull(Object paramObject, String paramString, Object... paramVarArgs)
  {
    if (paramObject != null) {
      fail("null argument expected: " + String.format(paramString, paramVarArgs));
    }
  }
  
  public static void isNull2(Object paramObject, String paramString, Object... paramVarArgs)
  {
    if (paramObject != null)
    {
      String str = "null argument expected: " + MessageFormat.format(paramString, paramVarArgs);
      fail(str);
    }
  }
  
  public static void isNotNull(Object paramObject)
  {
    isNotNull(paramObject, "");
  }
  
  public static void isNotNull(Object paramObject, String paramString)
  {
    if (paramObject == null) {
      fail("null argument: " + paramString);
    }
  }
  
  public static void isNotNull(Object paramObject, String paramString, Object... paramVarArgs)
  {
    if (paramObject == null) {
      fail("null argument: " + String.format(paramString, paramVarArgs));
    }
  }
  
  public static void isNotNull2(Object paramObject, String paramString, Object... paramVarArgs)
  {
    if (paramObject == null)
    {
      String str = "null argument: " + MessageFormat.format(paramString, paramVarArgs);
      fail(str);
    }
  }
  
  public static void fail(String paramString)
  {
    throw new AssertionFailedException(paramString);
  }
  
  public static void fail(String paramString, Object... paramVarArgs)
  {
    String str = MessageFormat.format(paramString, paramVarArgs);
    throw new AssertionFailedException(str);
  }
  
  public static boolean isTrue(boolean paramBoolean)
  {
    return isTrue(paramBoolean, "");
  }
  
  public static boolean isTrue(boolean paramBoolean, String paramString)
  {
    if (!paramBoolean) {
      fail("assertion failed: " + paramString);
    }
    return paramBoolean;
  }
  
  public static boolean isTrue(boolean paramBoolean, String paramString, Object... paramVarArgs)
  {
    if (!paramBoolean) {
      fail("assertion failed: " + String.format(paramString, paramVarArgs));
    }
    return paramBoolean;
  }
  
  public static boolean isTrue2(boolean paramBoolean, String paramString, Object... paramVarArgs)
  {
    if (!paramBoolean) {
      fail(paramString, paramVarArgs);
    }
    return paramBoolean;
  }
  
  public static void equals(int paramInt1, int paramInt2)
  {
    equals(paramInt1, paramInt2, paramInt1 + " expected, but " + paramInt2 + " found");
  }
  
  public static void equals(int paramInt1, int paramInt2, String paramString)
  {
    if (paramInt1 != paramInt2) {
      fail("assertation failed: " + paramString);
    }
  }
  
  public static void instanceOf(Class<?> paramClass, Object paramObject)
  {
    if (paramObject == null) {
      fail(paramClass.getName() + " expected, but 'null' found.");
    }
    if (!paramClass.isAssignableFrom(paramObject.getClass())) {
      fail(paramClass.getName() + " expected, but " + paramObject.getClass().getName() + " found.");
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.check.Assert
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.check;

public final class AssertionFailedException
  extends RuntimeException
{
  private static final long serialVersionUID = 0L;
  
  public AssertionFailedException(String paramString)
  {
    super(paramString);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.check.AssertionFailedException
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.execution;

final class ExecutionUtils$1
  implements RunnableEx
{
  ExecutionUtils$1(int paramInt) {}
  
  public void run()
    throws Exception
  {
    Thread.sleep(val$millis);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.execution.ExecutionUtils.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.execution;

public abstract interface RunnableEx
{
  public abstract void run()
    throws Exception;
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.execution.RunnableEx
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.execution;

final class ExecutionUtils$4
  implements Runnable
{
  ExecutionUtils$4(RunnableEx paramRunnableEx) {}
  
  public void run()
  {
    ExecutionUtils.runLog(val$runnable);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.execution.ExecutionUtils.4
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.execution;

final class ExecutionUtils$3
  implements Runnable
{
  ExecutionUtils$3(RunnableEx paramRunnableEx) {}
  
  public void run()
  {
    ExecutionUtils.runRethrow(val$runnable);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.execution.ExecutionUtils.3
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.execution;

public abstract interface RunnableObjectEx<T>
{
  public abstract T runObject()
    throws Exception;
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.execution.RunnableObjectEx
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.execution;

final class ExecutionUtils$5
  implements RunnableEx
{
  ExecutionUtils$5(Object[] paramArrayOfObject, RunnableObjectEx paramRunnableObjectEx) {}
  
  public void run()
    throws Exception
  {
    val$result[0] = ExecutionUtils.runObject(val$runnable);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.execution.ExecutionUtils.5
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.execution;

final class ExecutionUtils$2
  implements Runnable
{
  ExecutionUtils$2(boolean[] paramArrayOfBoolean, RunnableEx paramRunnableEx) {}
  
  public void run()
  {
    val$success[0] = ExecutionUtils.runLog(val$runnable);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.execution.ExecutionUtils.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.execution;

final class ExecutionUtils$6
  implements Runnable
{
  ExecutionUtils$6(RunnableEx paramRunnableEx) {}
  
  public void run()
  {
    ExecutionUtils.runLog(val$runnable);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.execution.ExecutionUtils.6
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.execution;

import java.beans.Beans;
import org.eclipse.swt.widgets.Display;
import org.eclipse.wb.internal.core.DesignerPlugin;
import org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils;

public class ExecutionUtils
{
  public static void sleep(int paramInt)
  {
    runIgnore(new RunnableEx()
    {
      public void run()
        throws Exception
      {
        Thread.sleep(val$millis);
      }
    });
  }
  
  public static void waitEventLoop(int paramInt)
  {
    Display localDisplay = Display.getCurrent();
    if (localDisplay != null)
    {
      long l1 = paramInt * 1000000L;
      long l2 = System.nanoTime();
      do
      {
        sleep(0);
        while (localDisplay.readAndDispatch()) {}
      } while (System.nanoTime() - l2 < l1);
    }
    else
    {
      sleep(paramInt);
    }
  }
  
  public static boolean runIgnore(RunnableEx paramRunnableEx)
  {
    try
    {
      paramRunnableEx.run();
      return true;
    }
    catch (Throwable localThrowable) {}
    return false;
  }
  
  public static boolean runLog(RunnableEx paramRunnableEx)
  {
    try
    {
      paramRunnableEx.run();
      return true;
    }
    catch (Throwable localThrowable)
    {
      DesignerPlugin.log(localThrowable);
    }
    return false;
  }
  
  public static void runRethrow(RunnableEx paramRunnableEx)
  {
    try
    {
      paramRunnableEx.run();
    }
    catch (Throwable localThrowable)
    {
      throw ReflectionUtils.propagate(localThrowable);
    }
  }
  
  public static void runRethrow(RunnableEx paramRunnableEx, String paramString, Object... paramVarArgs)
  {
    try
    {
      paramRunnableEx.run();
    }
    catch (Throwable localThrowable)
    {
      String str = String.format(paramString, paramVarArgs);
      throw new RuntimeException(str, localThrowable);
    }
  }
  
  public static void runDesignTime(RunnableEx paramRunnableEx)
    throws Exception
  {
    boolean bool = Beans.isDesignTime();
    try
    {
      Beans.setDesignTime(true);
      paramRunnableEx.run();
    }
    finally
    {
      Beans.setDesignTime(bool);
    }
  }
  
  public static <T> T runDesignTime(RunnableObjectEx<T> paramRunnableObjectEx)
    throws Exception
  {
    boolean bool = Beans.isDesignTime();
    try
    {
      Beans.setDesignTime(true);
      return (T)paramRunnableObjectEx.runObject();
    }
    finally
    {
      Beans.setDesignTime(bool);
    }
  }
  
  public static boolean runLogUI(final RunnableEx paramRunnableEx)
  {
    boolean[] arrayOfBoolean = new boolean[1];
    Display.getDefault().syncExec(new Runnable()
    {
      public void run()
      {
        val$success[0] = ExecutionUtils.runLog(paramRunnableEx);
      }
    });
    return arrayOfBoolean[0];
  }
  
  public static void runRethrowUI(RunnableEx paramRunnableEx)
  {
    Display.getDefault().syncExec(new Runnable()
    {
      public void run()
      {
        ExecutionUtils.runRethrow(val$runnable);
      }
    });
  }
  
  public static void runAsync(RunnableEx paramRunnableEx)
  {
    Display.getDefault().asyncExec(new Runnable()
    {
      public void run()
      {
        ExecutionUtils.runLog(val$runnable);
      }
    });
  }
  
  public static <T> T runObjectUI(final RunnableObjectEx<T> paramRunnableObjectEx)
  {
    Object[] arrayOfObject = new Object[1];
    runRethrowUI(new RunnableEx()
    {
      public void run()
        throws Exception
      {
        val$result[0] = ExecutionUtils.runObject(paramRunnableObjectEx);
      }
    });
    return (T)arrayOfObject[0];
  }
  
  public static void runLogLater(RunnableEx paramRunnableEx)
  {
    Display.getDefault().asyncExec(new Runnable()
    {
      public void run()
      {
        ExecutionUtils.runLog(val$runnable);
      }
    });
  }
  
  public static <T> T runObject(RunnableObjectEx<T> paramRunnableObjectEx)
  {
    try
    {
      return (T)paramRunnableObjectEx.runObject();
    }
    catch (Throwable localThrowable)
    {
      throw ReflectionUtils.propagate(localThrowable);
    }
  }
  
  public static <T> T runObject(RunnableObjectEx<T> paramRunnableObjectEx, String paramString, Object... paramVarArgs)
  {
    try
    {
      return (T)paramRunnableObjectEx.runObject();
    }
    catch (Throwable localThrowable)
    {
      String str = String.format(paramString, paramVarArgs);
      throw new Error(str, localThrowable);
    }
  }
  
  public static <T> T runObjectIgnore(RunnableObjectEx<T> paramRunnableObjectEx, T paramT)
  {
    try
    {
      return (T)paramRunnableObjectEx.runObject();
    }
    catch (Throwable localThrowable) {}
    return paramT;
  }
  
  public static <T> T runObjectLog(RunnableObjectEx<T> paramRunnableObjectEx, T paramT)
  {
    try
    {
      return (T)paramRunnableObjectEx.runObject();
    }
    catch (Throwable localThrowable)
    {
      DesignerPlugin.log(localThrowable);
    }
    return paramT;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.execution.ExecutionUtils
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.reflect;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collections;
import java.util.Map;
import java.util.WeakHashMap;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;

public class ClassLoaderLocalMap
  implements Opcodes
{
  private static final String NAME = "GEN$$ClassLoaderProperties";
  private static final Map<Object, Object> globalMap = Collections.synchronizedMap(new WeakHashMap());
  private static Method defineMethod;
  private static Method findLoadedClass;
  
  static
  {
    try
    {
      defineMethod = ClassLoader.class.getDeclaredMethod("defineClass", new Class[] { String.class, byte[].class, Integer.TYPE, Integer.TYPE });
      
      defineMethod.setAccessible(true);
      findLoadedClass = ClassLoader.class.getDeclaredMethod("findLoadedClass", new Class[] { String.class });
      
      findLoadedClass.setAccessible(true);
    }
    catch (NoSuchMethodException localNoSuchMethodException)
    {
      throw new RuntimeException(localNoSuchMethodException);
    }
  }
  
  public static boolean containsKey(ClassLoader paramClassLoader, Object paramObject)
  {
    if (paramClassLoader == null) {
      return globalMap.containsKey(paramObject);
    }
    synchronized (paramClassLoader)
    {
      if (!hasHolder(paramClassLoader)) {
        return false;
      }
      return getLocalMap(paramClassLoader).containsKey(paramObject);
    }
  }
  
  public static void put(ClassLoader paramClassLoader, Object paramObject1, Object paramObject2)
  {
    if (paramClassLoader == null)
    {
      globalMap.put(paramObject1, paramObject2);
      return;
    }
    synchronized (paramClassLoader)
    {
      getLocalMap(paramClassLoader).put(paramObject1, paramObject2);
    }
  }
  
  private static boolean hasHolder(ClassLoader paramClassLoader)
  {
    String str = "GEN$$ClassLoaderProperties";
    try
    {
      Class localClass = (Class)findLoadedClass.invoke(paramClassLoader, new Object[] { str });
      if (localClass == null) {
        return false;
      }
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
      throw new RuntimeException(localIllegalArgumentException);
    }
    catch (IllegalAccessException localIllegalAccessException)
    {
      throw new RuntimeException(localIllegalAccessException);
    }
    catch (InvocationTargetException localInvocationTargetException)
    {
      throw new RuntimeException(localInvocationTargetException.getTargetException());
    }
    return true;
  }
  
  private static Map<Object, Object> getLocalMap(ClassLoader paramClassLoader)
  {
    String str = "GEN$$ClassLoaderProperties";
    Class localClass;
    try
    {
      localClass = (Class)findLoadedClass.invoke(paramClassLoader, new Object[] { str });
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
      throw new RuntimeException(localIllegalArgumentException);
    }
    catch (IllegalAccessException localIllegalAccessException)
    {
      throw new RuntimeException(localIllegalAccessException);
    }
    catch (InvocationTargetException localInvocationTargetException1)
    {
      throw new RuntimeException(localInvocationTargetException1.getTargetException());
    }
    if (localClass == null)
    {
      byte[] arrayOfByte = buildHolderByteCode(str);
      try
      {
        localClass = (Class)defineMethod.invoke(paramClassLoader, new Object[] { str, arrayOfByte, Integer.valueOf(0), Integer.valueOf(arrayOfByte.length) });
      }
      catch (InvocationTargetException localInvocationTargetException2)
      {
        throw new RuntimeException(localInvocationTargetException2.getTargetException());
      }
      catch (Throwable localThrowable2)
      {
        throw new RuntimeException(localThrowable2);
      }
    }
    try
    {
      return (Map)localClass.getDeclaredField("localMap").get(null);
    }
    catch (Throwable localThrowable1)
    {
      throw new RuntimeException(localThrowable1);
    }
  }
  
  private static byte[] buildHolderByteCode(String paramString)
  {
    ClassWriter localClassWriter = new ClassWriter(0);
    
    localClassWriter.visit(46, 33, paramString, null, "java/lang/Object", null);
    
    FieldVisitor localFieldVisitor = localClassWriter.visitField(25, "localMap", "Ljava/util/Map;", null, null);
    
    localFieldVisitor.visitEnd();
    
    MethodVisitor localMethodVisitor = localClassWriter.visitMethod(8, "<clinit>", "()V", null, null);
    localMethodVisitor.visitCode();
    localMethodVisitor.visitTypeInsn(187, "java/util/WeakHashMap");
    localMethodVisitor.visitInsn(89);
    localMethodVisitor.visitMethodInsn(183, "java/util/WeakHashMap", "<init>", "()V");
    localMethodVisitor.visitFieldInsn(179, paramString, "localMap", "Ljava/util/Map;");
    localMethodVisitor.visitInsn(177);
    localMethodVisitor.visitMaxs(2, 0);
    localMethodVisitor.visitEnd();
    
    localMethodVisitor = localClassWriter.visitMethod(1, "<init>", "()V", null, null);
    localMethodVisitor.visitCode();
    localMethodVisitor.visitVarInsn(25, 0);
    localMethodVisitor.visitMethodInsn(183, "java/lang/Object", "<init>", "()V");
    localMethodVisitor.visitInsn(177);
    localMethodVisitor.visitMaxs(1, 1);
    localMethodVisitor.visitEnd();
    
    localClassWriter.visitEnd();
    return localClassWriter.toByteArray();
  }
  
  /* Error */
  public static Object get(ClassLoader paramClassLoader, Object paramObject)
  {
    // Byte code:
    //   0: aload_0
    //   1: ifnonnull +13 -> 14
    //   4: getstatic 2	org/eclipse/wb/internal/core/utils/reflect/ClassLoaderLocalMap:globalMap	Ljava/util/Map;
    //   7: aload_1
    //   8: invokeinterface 7 2 0
    //   13: areturn
    //   14: aload_0
    //   15: dup
    //   16: astore_2
    //   17: monitorenter
    //   18: aload_0
    //   19: invokestatic 5	org/eclipse/wb/internal/core/utils/reflect/ClassLoaderLocalMap:getLocalMap	(Ljava/lang/ClassLoader;)Ljava/util/Map;
    //   22: aload_1
    //   23: invokeinterface 7 2 0
    //   28: aload_2
    //   29: monitorexit
    //   30: areturn
    //   31: astore_3
    //   32: aload_2
    //   33: monitorexit
    //   34: aload_3
    //   35: athrow
    // Line number table:
    //   Java source line #87	-> byte code offset #0
    //   Java source line #88	-> byte code offset #4
    //   Java source line #91	-> byte code offset #14
    //   Java source line #92	-> byte code offset #18
    //   Java source line #93	-> byte code offset #31
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	36	0	paramClassLoader	ClassLoader
    //   0	36	1	paramObject	Object
    //   16	17	2	Ljava/lang/Object;	Object
    //   31	4	3	localObject1	Object
    // Exception table:
    //   from	to	target	type
    //   18	30	31	finally
    //   31	34	31	finally
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.reflect.ClassLoaderLocalMap
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.reflect;

import com.google.common.collect.Maps;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.wb.internal.core.utils.check.Assert;

public class ReflectionUtils
{
  public static String getFullyQualifiedName(Type paramType, boolean paramBoolean)
  {
    Assert.isNotNull(paramType);
    Object localObject2;
    if ((paramType instanceof Class))
    {
      localObject1 = (Class)paramType;
      if (((Class)localObject1).isArray()) {
        return getFullyQualifiedName(((Class)localObject1).getComponentType(), paramBoolean) + "[]";
      }
      localObject2 = ((Class)localObject1).getName();
      if (!paramBoolean) {
        localObject2 = ((String)localObject2).replace('$', '.');
      }
      return (String)localObject2;
    }
    if ((paramType instanceof GenericArrayType))
    {
      localObject1 = (GenericArrayType)paramType;
      return getFullyQualifiedName(((GenericArrayType)localObject1).getGenericComponentType(), paramBoolean) + "[]";
    }
    if ((paramType instanceof ParameterizedType))
    {
      localObject1 = (ParameterizedType)paramType;
      localObject2 = ((ParameterizedType)localObject1).getRawType();
      
      StringBuilder localStringBuilder = new StringBuilder();
      localStringBuilder.append(getFullyQualifiedName((Type)localObject2, paramBoolean));
      
      localStringBuilder.append("<");
      int i = 1;
      for (Type localType : ((ParameterizedType)localObject1).getActualTypeArguments())
      {
        if (i == 0) {
          localStringBuilder.append(",");
        }
        i = 0;
        localStringBuilder.append(getFullyQualifiedName(localType, paramBoolean));
      }
      localStringBuilder.append(">");
      
      return localStringBuilder.toString();
    }
    if ((paramType instanceof WildcardType))
    {
      localObject1 = (WildcardType)paramType;
      return "? extends " + getFullyQualifiedName(localObject1.getUpperBounds()[0], paramBoolean);
    }
    Object localObject1 = (TypeVariable)paramType;
    return ((TypeVariable)localObject1).getName();
  }
  
  private static void appendParameterTypes(StringBuilder paramStringBuilder, Type[] paramArrayOfType)
  {
    paramStringBuilder.append('(');
    int i = 1;
    for (Type localType : paramArrayOfType)
    {
      if (i != 0) {
        i = 0;
      } else {
        paramStringBuilder.append(',');
      }
      paramStringBuilder.append(getFullyQualifiedName(localType, false));
    }
    paramStringBuilder.append(')');
  }
  
  public static Map<String, Method> getMethods(Class<?> paramClass)
  {
    HashMap localHashMap = Maps.newHashMap();
    Object localObject3;
    for (Object localObject1 = paramClass; localObject1 != null; localObject1 = ((Class)localObject1).getSuperclass()) {
      for (localObject3 : ((Class)localObject1).getDeclaredMethods())
      {
        String str1 = getMethodSignature((Method)localObject3);
        if (!localHashMap.containsKey(str1))
        {
          ((Method)localObject3).setAccessible(true);
          localHashMap.put(str1, localObject3);
        }
      }
    }
    for (Object localObject2 : paramClass.getInterfaces()) {
      for (Method localMethod : ((Class)localObject2).getDeclaredMethods())
      {
        String str2 = getMethodSignature(localMethod);
        if (!localHashMap.containsKey(str2))
        {
          localMethod.setAccessible(true);
          localHashMap.put(str2, localMethod);
        }
      }
    }
    return localHashMap;
  }
  
  public static String getMethodSignature(Method paramMethod)
  {
    Assert.isNotNull(paramMethod);
    return getMethodSignature(paramMethod.getName(), paramMethod.getParameterTypes());
  }
  
  public static String getMethodSignature(String paramString, Type... paramVarArgs)
  {
    Assert.isNotNull(paramString);
    Assert.isNotNull(paramVarArgs);
    
    StringBuilder localStringBuilder = new StringBuilder();
    localStringBuilder.append(paramString);
    appendParameterTypes(localStringBuilder, paramVarArgs);
    return localStringBuilder.toString();
  }
  
  private static final ClassMap<Map<String, Method>> m_getMethodBySignature = ;
  
  public static Method getMethodBySignature(Class<?> paramClass, String paramString)
  {
    Assert.isNotNull(paramClass);
    Assert.isNotNull(paramString);
    
    Map localMap = (Map)m_getMethodBySignature.get(paramClass);
    if (localMap == null)
    {
      localMap = getMethods(paramClass);
      m_getMethodBySignature.put(paramClass, localMap);
    }
    return (Method)localMap.get(paramString);
  }
  
  public static Object invokeMethod(Object paramObject, String paramString, Object... paramVarArgs)
    throws Exception
  {
    Assert.isNotNull(paramObject);
    Assert.isNotNull(paramVarArgs);
    
    Class localClass = getRefClass(paramObject);
    Object localObject = getRefObject(paramObject);
    
    Method localMethod = getMethodBySignature(localClass, paramString);
    Assert.isNotNull(localMethod, "Can not find method " + paramString + " in " + localClass);
    try
    {
      return localMethod.invoke(localObject, paramVarArgs);
    }
    catch (InvocationTargetException localInvocationTargetException)
    {
      throw propagate(localInvocationTargetException.getCause());
    }
  }
  
  public static Object invokeMethod2(Object paramObject, String paramString, Class<?>[] paramArrayOfClass, Object[] paramArrayOfObject)
    throws Exception
  {
    Assert.equals(paramArrayOfClass.length, paramArrayOfObject.length);
    String str = getMethodSignature(paramString, paramArrayOfClass);
    return invokeMethod(paramObject, str, paramArrayOfObject);
  }
  
  private static Class<?> getRefClass(Object paramObject)
  {
    return (paramObject instanceof Class) ? (Class)paramObject : paramObject.getClass();
  }
  
  private static Object getRefObject(Object paramObject)
  {
    return (paramObject instanceof Class) ? null : paramObject;
  }
  
  private static class ExceptionThrower
  {
    private static Throwable throwable;
    
    private ExceptionThrower()
      throws Throwable
    {
      if (System.getProperty("wbp.ReflectionUtils.propagate().InstantiationException") != null) {
        throw new InstantiationException();
      }
      if (System.getProperty("wbp.ReflectionUtils.propagate().IllegalAccessException") != null) {
        throw new IllegalAccessException();
      }
      throw throwable;
    }
    
    public static synchronized void spit(Throwable paramThrowable)
    {
      if (System.getProperty("wbp.ReflectionUtils.propagate().dontThrow") == null)
      {
        throwable = paramThrowable;
        try
        {
          ExceptionThrower.class.newInstance();
        }
        catch (InstantiationException localInstantiationException) {}catch (IllegalAccessException localIllegalAccessException) {}finally
        {
          throwable = null;
        }
      }
    }
  }
  
  public static RuntimeException propagate(Throwable paramThrowable)
  {
    if (System.getProperty("wbp.ReflectionUtils.propagate().forceReturn") == null) {
      ExceptionThrower.spit(paramThrowable);
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.reflect;

class ReflectionUtils$ExceptionThrower
{
  private static Throwable throwable;
  
  private ReflectionUtils$ExceptionThrower()
    throws Throwable
  {
    if (System.getProperty("wbp.ReflectionUtils.propagate().InstantiationException") != null) {
      throw new InstantiationException();
    }
    if (System.getProperty("wbp.ReflectionUtils.propagate().IllegalAccessException") != null) {
      throw new IllegalAccessException();
    }
    throw throwable;
  }
  
  public static synchronized void spit(Throwable paramThrowable)
  {
    if (System.getProperty("wbp.ReflectionUtils.propagate().dontThrow") == null)
    {
      throwable = paramThrowable;
      try
      {
        ExceptionThrower.class.newInstance();
      }
      catch (InstantiationException localInstantiationException) {}catch (IllegalAccessException localIllegalAccessException) {}finally
      {
        throwable = null;
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils.ExceptionThrower
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.reflect;

import java.util.HashMap;
import java.util.Map;

public final class ClassMap<V>
{
  public static <V> ClassMap<V> create()
  {
    return new ClassMap();
  }
  
  public void put(Class<?> paramClass, V paramV)
  {
    getMap(paramClass).put(paramClass, paramV);
  }
  
  public V get(Class<?> paramClass)
  {
    return (V)getMap(paramClass).get(paramClass);
  }
  
  public void remove(Class<?> paramClass)
  {
    getMap(paramClass).remove(paramClass);
  }
  
  public void clear(ClassLoader paramClassLoader)
  {
    getMap(paramClassLoader).clear();
  }
  
  private Map<Class<?>, V> getMap(Class<?> paramClass)
  {
    ClassLoader localClassLoader = paramClass.getClassLoader();
    return getMap(localClassLoader);
  }
  
  private Map<Class<?>, V> getMap(ClassLoader paramClassLoader)
  {
    Object localObject = ClassLoaderLocalMap.get(paramClassLoader, this);
    if (localObject == null)
    {
      localObject = new HashMap();
      ClassLoaderLocalMap.put(paramClassLoader, this, localObject);
    }
    return (Map)localObject;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.reflect.ClassMap
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.binding.editors.controls;

import com.google.common.collect.Lists;
import java.util.List;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.core.expressions.EvaluationResult;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.ExpressionInfo;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.handlers.IHandlerActivation;
import org.eclipse.ui.handlers.IHandlerService;

public abstract class AbstractControlActionsManager
{
  protected final Object[] COMMAND_HANDLER_IDS = { "org.eclipse.ui.edit.copy", "org.eclipse.ui.edit.cut", "org.eclipse.ui.edit.paste", "org.eclipse.ui.edit.delete", "org.eclipse.ui.edit.selectAll", "org.eclipse.ui.edit.undo", "org.eclipse.ui.edit.redo" };
  protected final Control m_control;
  private boolean m_active = false;
  
  public AbstractControlActionsManager(Control paramControl)
  {
    m_control = paramControl;
    m_control.addFocusListener(new FocusListener()
    {
      public void focusGained(FocusEvent paramAnonymousFocusEvent)
      {
        activateHandlers();
        m_active = true;
      }
      
      public void focusLost(FocusEvent paramAnonymousFocusEvent)
      {
        deactivateHandlers();
        m_active = false;
      }
    });
    m_control.addDisposeListener(new DisposeListener()
    {
      public void widgetDisposed(DisposeEvent paramAnonymousDisposeEvent)
      {
        if (m_active) {
          deactivateHandlers();
        }
      }
    });
  }
  
  protected static final IHandler EMPTY_HANDLER = new AbstractHandler()
  {
    public Object execute(ExecutionEvent paramAnonymousExecutionEvent)
      throws ExecutionException
    {
      return null;
    }
    
    public boolean isEnabled()
    {
      return true;
    }
    
    public boolean isHandled()
    {
      return false;
    }
  };
  
  public static IHandlerService getHandlerService()
  {
    return (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
  }
  
  protected void activateHandlers()
  {
    IHandlerService localIHandlerService = getHandlerService();
    for (int i = 0; i < COMMAND_HANDLER_IDS.length; i++)
    {
      String str = (String)COMMAND_HANDLER_IDS[i];
      IHandler localIHandler = getHandlerFor(str);
      activateHandler(str, localIHandlerService, localIHandler, new Expression()
      {
        public EvaluationResult evaluate(IEvaluationContext paramAnonymousIEvaluationContext)
          throws CoreException
        {
          return EvaluationResult.TRUE;
        }
        
        public void collectExpressionInfo(ExpressionInfo paramAnonymousExpressionInfo)
        {
          paramAnonymousExpressionInfo.markSystemPropertyAccessed();
          paramAnonymousExpressionInfo.markDefaultVariableAccessed();
          paramAnonymousExpressionInfo.addVariableNameAccess("activeMenu");
        }
      });
    }
  }
  
  protected IHandler getHandlerFor(String paramString)
  {
    return EMPTY_HANDLER;
  }
  
  private final List<IHandlerActivation> m_activations = Lists.newLinkedList();
  
  private void activateHandler(String paramString, IHandlerService paramIHandlerService, IHandler paramIHandler, Expression paramExpression)
  {
    m_activations.add(paramIHandlerService.activateHandler(paramString, paramIHandler, paramExpression));
  }
  
  protected void deactivateHandlers()
  {
    getHandlerService().deactivateHandlers(m_activations);
    m_activations.clear();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.binding.editors.controls.AbstractControlActionsManager
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.binding.editors.controls;

import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;

class AbstractControlActionsManager$2
  implements DisposeListener
{
  AbstractControlActionsManager$2(AbstractControlActionsManager paramAbstractControlActionsManager) {}
  
  public void widgetDisposed(DisposeEvent paramDisposeEvent)
  {
    if (AbstractControlActionsManager.access$000(this$0)) {
      this$0.deactivateHandlers();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.binding.editors.controls.AbstractControlActionsManager.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.binding.editors.controls;

import org.eclipse.core.expressions.EvaluationResult;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.ExpressionInfo;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.CoreException;

class AbstractControlActionsManager$4
  extends Expression
{
  AbstractControlActionsManager$4(AbstractControlActionsManager paramAbstractControlActionsManager) {}
  
  public EvaluationResult evaluate(IEvaluationContext paramIEvaluationContext)
    throws CoreException
  {
    return EvaluationResult.TRUE;
  }
  
  public void collectExpressionInfo(ExpressionInfo paramExpressionInfo)
  {
    paramExpressionInfo.markSystemPropertyAccessed();
    paramExpressionInfo.markDefaultVariableAccessed();
    paramExpressionInfo.addVariableNameAccess("activeMenu");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.binding.editors.controls.AbstractControlActionsManager.4
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.binding.editors.controls;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;

class DefaultControlActionsManager$1
  extends AbstractHandler
{
  DefaultControlActionsManager$1(DefaultControlActionsManager paramDefaultControlActionsManager) {}
  
  public Object execute(ExecutionEvent paramExecutionEvent)
    throws ExecutionException
  {
    this$0.selectAllExecuted();
    return null;
  }
  
  public boolean isEnabled()
  {
    return true;
  }
  
  public boolean isHandled()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wb.internal.core.utils.binding.editors.controls.DefaultControlActionsManager.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wb.internal.core.utils.binding.editors.controls;

import org.eclipse.cor
1 2 3 4 5 6 7 8 9 10 11 12

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd