org.tizen.uicustomizer.events_1.0.0.201311010051

16:50:28.371 INFO  jd.cli.Main - Decompiling org.tizen.uicustomizer.events_1.0.0.201311010051.jar
package org.tizen.uicustomizer.events;

public class EventData
{
  public EventType type;
  public Object property;
  public Object value;
  public Object source;
  public Object context;
  public String colorName;
  
  public EventData(EventType type, Object property, Object value, Object source)
  {
    this.type = type;
    this.property = property;
    this.value = value;
    this.source = source;
  }
  
  public EventData(EventType type, Object property, Object value, Object source, String colorName)
  {
    this(type, property, value, source);
    this.colorName = colorName;
  }
  
  public EventData() {}
  
  public String toString()
  {
    if ((type != null) && (source != null)) {
      return type.toString() + " " + source.toString();
    }
    return super.toString();
  }
}

/* Location:
 * Qualified Name:     org.tizen.uicustomizer.events.EventData
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.uicustomizer.events;

public enum EventType
{
  UI_CONTROL_COLOR_PROPERTY_CHANGE,  UI_CONTROL_IMAGE_PROPERTY_CHANGE,  UI_CONTROL_COLOR_ALPHA_PROPERTY_CHANGE,  UI_CONTROL_WIDGET_SELECTED,  CLEAR_IMAGE,  PROJECT_OPEN,  PROJECT_CLOSE,  WINSET_ITEM_OPEN,  WINSET_ITEM_CLOSE,  WINSET_ITEM_FOCUS,  XML_EDITOR_OPEN,  XML_EDITOR_CLOSE,  XML_EDITOR_FOCUS,  ANIMATION_FOCUS,  PROJECT_SAVE,  ADD_CONTROL,  REMOVE_CONTROL,  XML_DOCUMENT_CHANGED,  DIRTY_PROP_CHANGED,  IMAGE_DELETED,  CHECK_PALETTE_FOR_COLOR,  PALETTE_CHANGED,  MODEL_UPDATED,  ANIMATION_PROPERTY_CHANGED,  NAVIGATOR_SELECTION;
}

/* Location:
 * Qualified Name:     org.tizen.uicustomizer.events.EventType
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.uicustomizer.events;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class EventsActivator
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.tizen.uicustomizer.events";
  private static EventsActivator plugin;
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    plugin = this;
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    plugin = null;
    super.stop(context);
  }
  
  public static EventsActivator getDefault()
  {
    return plugin;
  }
}

/* Location:
 * Qualified Name:     org.tizen.uicustomizer.events.EventsActivator
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.uicustomizer.events;

public abstract interface IUIControlEventHandler
{
  public abstract void handleEvent(EventData paramEventData);
  
  public abstract Object getContext();
  
  public abstract UIControlEventManager.EventPriority getPriority();
}

/* Location:
 * Qualified Name:     org.tizen.uicustomizer.events.IUIControlEventHandler
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.uicustomizer.events;

import java.util.Comparator;

class UIControlEventManager$1
  implements Comparator<IUIControlEventHandler>
{
  UIControlEventManager$1(UIControlEventManager paramUIControlEventManager) {}
  
  public int compare(IUIControlEventHandler o1, IUIControlEventHandler o2)
  {
    if (o1.getPriority().ordinal() < o2.getPriority().ordinal()) {
      return -1;
    }
    if (o1.getPriority().ordinal() > o2.getPriority().ordinal()) {
      return 1;
    }
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.tizen.uicustomizer.events.UIControlEventManager.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.uicustomizer.events;

public enum UIControlEventManager$EventPriority
{
  WORKBENCH,  MODEL_SYNCHRONIZER,  ANIMATION_MANAGER,  MULTIPAGE_EDITOR,  GRAPHICAL_EDITOR,  XML_EDITOR,  ACTIVE_PREVIEW,  NAVIGATOR,  FILE_EXPLORER,  PALETTE,  PROPERTIES,  CONTROLS,  DISPOSABLES;
}

/* Location:
 * Qualified Name:     org.tizen.uicustomizer.events.UIControlEventManager.EventPriority
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.uicustomizer.events;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Status;

public final class UIControlEventManager
{
  public static enum EventPriority
  {
    WORKBENCH,  MODEL_SYNCHRONIZER,  ANIMATION_MANAGER,  MULTIPAGE_EDITOR,  GRAPHICAL_EDITOR,  XML_EDITOR,  ACTIVE_PREVIEW,  NAVIGATOR,  FILE_EXPLORER,  PALETTE,  PROPERTIES,  CONTROLS,  DISPOSABLES;
  }
  
  private static UIControlEventManager uiControlEventManager = new UIControlEventManager();
  private static Map<EventType, List<IUIControlEventHandler>> eventMap = new HashMap();
  private EventData cachedOpendData = null;
  
  public static UIControlEventManager getInstance()
  {
    return uiControlEventManager;
  }
  
  public void registerEvents(EventType[] types, IUIControlEventHandler handler)
  {
    if ((types != null) && (handler != null))
    {
      synchronized (eventMap)
      {
        EventType[] arrayOfEventType;
        int j = (arrayOfEventType = types).length;
        for (int i = 0; i < j; i++)
        {
          EventType type = arrayOfEventType[i];
          List<IUIControlEventHandler> list = (List)eventMap.get(type);
          if (list == null) {
            list = new ArrayList();
          }
          list.add(handler);
          eventMap.put(type, list);
        }
      }
      if ((cachedOpendData != null) && (Arrays.asList(types).contains(EventType.PROJECT_OPEN))) {
        handler.handleEvent(cachedOpendData);
      }
    }
  }
  
  public boolean deRegisterEventListener(IUIControlEventHandler handler)
  {
    if (handler != null)
    {
      synchronized (eventMap)
      {
        for (List<IUIControlEventHandler> entry : eventMap.values()) {
          entry.remove(handler);
        }
      }
      return true;
    }
    return false;
  }
  
  public void notifyEvents(EventType type, EventData eventData)
  {
    if (type != null)
    {
      if (type == EventType.PROJECT_CLOSE) {
        cachedOpendData = null;
      } else if (type == EventType.PROJECT_OPEN) {
        cachedOpendData = eventData;
      }
      synchronized (eventMap)
      {
        List<IUIControlEventHandler> list = (List)eventMap.get(type);
        if (list != null)
        {
          Collections.sort(list, new Comparator()
          {
            public int compare(IUIControlEventHandler o1, IUIControlEventHandler o2)
            {
              if (o1.getPriority().ordinal() < o2.getPriority().ordinal()) {
                return -1;
              }
              if (o1.getPriority().ordinal() > o2.getPriority().ordinal()) {
                return 1;
              }
              return 0;
            }
          });
          try
          {
            for (IUIControlEventHandler eHandler : list) {
              if (context == null) {
                eHandler.handleEvent(eventData);
              } else if ((context.equals(eHandler.getContext())) || (((eHandler.getContext() instanceof Boolean)) && (((Boolean)eHandler.getContext()).booleanValue()))) {
                eHandler.handleEvent(eventData);
              }
            }
          }
          catch (Throwable e)
          {
            EventsActivator.getDefault().getLog().log(new Status(4, "org.tizen.uicustomizer.events", e.getMessage(), e));
          }
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.uicustomizer.events.UIControlEventManager
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
1

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