org.eclipse.linuxtools.oprofile.launch_1.3.18.201310312000

16:46:07.923 INFO  jd.cli.Main - Decompiling org.eclipse.linuxtools.oprofile.launch_1.3.18.201310312000.jar
package org.eclipse.linuxtools.oprofile.launch;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class OprofileLaunchMessages
{
  private static final String BUNDLE_NAME = "org.eclipse.linuxtools.oprofile.launch.oprofilelaunch";
  private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("org.eclipse.linuxtools.oprofile.launch.oprofilelaunch");
  
  public static String getString(String paramString)
  {
    try
    {
      return RESOURCE_BUNDLE.getString(paramString);
    }
    catch (MissingResourceException localMissingResourceException) {}
    return '!' + paramString + '!';
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.launch.OprofileLaunchMessages
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.launch;

import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.linuxtools.oprofile.launch.configuration.EventConfigCache;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class OprofileLaunchPlugin
  extends AbstractUIPlugin
{
  private static OprofileLaunchPlugin plugin;
  private static EventConfigCache _eventConfigCache = null;
  private static final String ID_PLUGIN = "org.eclipse.linuxtools.oprofile.launch";
  public static final String ID_LAUNCH_PROFILE = "org.eclipse.linuxtools.oprofile.launch.oprofile";
  public static final String ATTR_KERNEL_IMAGE_FILE = "org.eclipse.linuxtools.oprofile.launch.oprofile.KERNEL_IMAGE";
  public static final String ATTR_SEPARATE_SAMPLES = "org.eclipse.linuxtools.oprofile.launch.oprofile.SEPARATE_SAMPLES";
  public static final String ATTR_USE_DEFAULT_EVENT = "org.eclipse.linuxtools.oprofile.launch.oprofile.USE_DEFAULT_EVENT";
  public static final String ATTR_SELECTED_DEFAULT_SETTING = "org.eclipse.linuxtools.oprofile.launch.oprofile.SELECTED_DEFAULT_SETTING";
  public static final String ICON_PATH = "icons/";
  public static final String ICON_EVENT_TAB = "icons/event_tab.gif";
  public static final String ICON_GLOBAL_TAB = "icons/global_tab.gif";
  
  private static final String ATTR_COUNTER(int paramInt)
  {
    return "org.eclipse.linuxtools.oprofile.launch.oprofile.COUNTER_" + paramInt;
  }
  
  public static final String ATTR_COUNTER_ENABLED(int paramInt)
  {
    return ATTR_COUNTER(paramInt) + ".ENABLED";
  }
  
  public static final String ATTR_COUNTER_EVENT(int paramInt)
  {
    return ATTR_COUNTER(paramInt) + ".EVENT";
  }
  
  public static final String ATTR_COUNTER_PROFILE_KERNEL(int paramInt)
  {
    return ATTR_COUNTER(paramInt) + ".PROFILE_KERNEL";
  }
  
  public static final String ATTR_COUNTER_PROFILE_USER(int paramInt)
  {
    return ATTR_COUNTER(paramInt) + ".PROFILE_USER";
  }
  
  public static final String ATTR_COUNTER_COUNT(int paramInt)
  {
    return ATTR_COUNTER(paramInt) + ".COUNT";
  }
  
  public static final String ATTR_COUNTER_UNIT_MASK(int paramInt)
  {
    return ATTR_COUNTER(paramInt) + ".UNIT_MASK";
  }
  
  public OprofileLaunchPlugin()
  {
    plugin = this;
  }
  
  public void start(BundleContext paramBundleContext)
    throws Exception
  {
    super.start(paramBundleContext);
  }
  
  public void stop(BundleContext paramBundleContext)
    throws Exception
  {
    super.stop(paramBundleContext);
    plugin = null;
  }
  
  public static OprofileLaunchPlugin getDefault()
  {
    return plugin;
  }
  
  public static IWorkspace getWorkspace()
  {
    return ResourcesPlugin.getWorkspace();
  }
  
  public static String getUniqueIdentifier()
  {
    return "org.eclipse.linuxtools.oprofile.launch";
  }
  
  public static ImageDescriptor getImageDescriptor(String paramString)
  {
    return imageDescriptorFromPlugin("org.eclipse.linuxtools.oprofile.launch", paramString);
  }
  
  public static IWorkbenchWindow getActiveWorkbenchWindow()
  {
    return getDefault().getWorkbench().getActiveWorkbenchWindow();
  }
  
  public static Shell getActiveWorkbenchShell()
  {
    IWorkbenchWindow localIWorkbenchWindow = getActiveWorkbenchWindow();
    if (localIWorkbenchWindow != null) {
      return localIWorkbenchWindow.getShell();
    }
    return null;
  }
  
  public static EventConfigCache getCache()
  {
    if (_eventConfigCache == null) {
      _eventConfigCache = new EventConfigCache();
    }
    return _eventConfigCache;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.launch.OprofileLaunchPlugin
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.launch.configuration;

class EventConfigCache$CheckEventEntry
{
  public Integer counterNum;
  public Integer eventNum;
  public Integer maskValue;
  
  public EventConfigCache$CheckEventEntry(EventConfigCache paramEventConfigCache, int paramInt1, int paramInt2, int paramInt3)
  {
    counterNum = new Integer(paramInt1);
    eventNum = new Integer(paramInt2);
    maskValue = new Integer(paramInt3);
  }
  
  public boolean equals(Object paramObject)
  {
    if ((paramObject instanceof CheckEventEntry))
    {
      CheckEventEntry localCheckEventEntry = (CheckEventEntry)paramObject;
      return (counterNum.equals(counterNum)) && (eventNum.equals(eventNum)) && (maskValue.equals(maskValue));
    }
    return false;
  }
  
  public int hashCode()
  {
    int i = 11;
    int j = 3;
    j = i * j + counterNum.hashCode();
    j = i * j + eventNum.hashCode();
    j = i * j + maskValue.hashCode();
    return j;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.launch.configuration.EventConfigCache.CheckEventEntry
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.launch.configuration;

import java.util.HashMap;
import org.eclipse.linuxtools.oprofile.core.Oprofile;

public class EventConfigCache
{
  HashMap<CheckEventEntry, Boolean> validEventCache = new HashMap();
  
  public boolean checkEvent(int paramInt1, int paramInt2, int paramInt3)
  {
    CheckEventEntry localCheckEventEntry = new CheckEventEntry(paramInt1, paramInt2, paramInt3);
    Boolean localBoolean = null;
    localBoolean = (Boolean)validEventCache.get(localCheckEventEntry);
    if (localBoolean == null)
    {
      localBoolean = Oprofile.checkEvent(paramInt1, paramInt2, paramInt3);
      if (localBoolean != null) {
        validEventCache.put(localCheckEventEntry, localBoolean);
      }
    }
    return localBoolean == null ? false : localBoolean.booleanValue();
  }
  
  class CheckEventEntry
  {
    public Integer counterNum;
    public Integer eventNum;
    public Integer maskValue;
    
    public CheckEventEntry(int paramInt1, int paramInt2, int paramInt3)
    {
      counterNum = new Integer(paramInt1);
      eventNum = new Integer(paramInt2);
      maskValue = new Integer(paramInt3);
    }
    
    public boolean equals(Object paramObject)
    {
      if ((paramObject instanceof CheckEventEntry))
      {
        CheckEventEntry localCheckEventEntry = (CheckEventEntry)paramObject;
        return (counterNum.equals(counterNum)) && (eventNum.equals(eventNum)) && (maskValue.equals(maskValue));
      }
      return false;
    }
    
    public int hashCode()
    {
      int i = 11;
      int j = 3;
      j = i * j + counterNum.hashCode();
      j = i * j + eventNum.hashCode();
      j = i * j + maskValue.hashCode();
      return j;
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.launch.configuration.EventConfigCache
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.launch.configuration;

import java.io.File;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.linuxtools.oprofile.core.daemon.OprofileDaemonOptions;

public class LaunchOptions
{
  private OprofileDaemonOptions _options = new OprofileDaemonOptions();
  
  public boolean isValid()
  {
    String str = _options.getKernelImageFile();
    if ((str != null) && (str.length() > 0))
    {
      File localFile = new File(_options.getKernelImageFile());
      return (localFile.exists()) && (localFile.isFile());
    }
    return true;
  }
  
  public void saveConfiguration(ILaunchConfigurationWorkingCopy paramILaunchConfigurationWorkingCopy)
  {
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.oprofile.launch.oprofile.KERNEL_IMAGE", _options.getKernelImageFile());
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.oprofile.launch.oprofile.SEPARATE_SAMPLES", _options.getSeparateProfilesMask());
  }
  
  public void loadConfiguration(ILaunchConfiguration paramILaunchConfiguration)
  {
    try
    {
      _options.setKernelImageFile(paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.oprofile.launch.oprofile.KERNEL_IMAGE", ""));
      _options.setSeparateProfilesMask(paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.oprofile.launch.oprofile.SEPARATE_SAMPLES", 0));
    }
    catch (CoreException localCoreException)
    {
      localCoreException.printStackTrace();
    }
  }
  
  public OprofileDaemonOptions getOprofileDaemonOptions()
  {
    return _options;
  }
  
  public String getKernelImageFile()
  {
    return _options.getKernelImageFile();
  }
  
  public void setKernelImageFile(String paramString)
  {
    _options.setKernelImageFile(paramString);
  }
  
  public int getSeparateSamples()
  {
    return _options.getSeparateProfilesMask();
  }
  
  public void setSeparateSamples(int paramInt)
  {
    _options.setSeparateProfilesMask(paramInt);
  }
  
  public String getBinaryImage()
  {
    return _options.getBinaryImage();
  }
  
  public void setBinaryImage(String paramString)
  {
    _options.setBinaryImage(paramString);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.launch.configuration.LaunchOptions
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.launch.configuration;

import java.text.MessageFormat;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.linuxtools.oprofile.core.Oprofile;
import org.eclipse.linuxtools.oprofile.core.daemon.OpEvent;
import org.eclipse.linuxtools.oprofile.core.daemon.OpUnitMask;
import org.eclipse.linuxtools.oprofile.core.daemon.OprofileDaemonEvent;
import org.eclipse.linuxtools.oprofile.launch.OprofileLaunchMessages;
import org.eclipse.linuxtools.oprofile.launch.OprofileLaunchPlugin;

public class OprofileCounter
{
  private static final String COUNTER_STRING = OprofileLaunchMessages.getString("oprofileCounter.counterString");
  private int _number;
  private boolean _enabled;
  private OprofileDaemonEvent _daemonEvent;
  private OpEvent[] _eventList = null;
  
  public OprofileCounter(int paramInt)
  {
    _number = paramInt;
    _enabled = false;
    _eventList = Oprofile.getEvents(_number);
    _daemonEvent = new OprofileDaemonEvent();
  }
  
  public static OprofileCounter[] getCounters(ILaunchConfiguration paramILaunchConfiguration)
  {
    OprofileCounter[] arrayOfOprofileCounter = new OprofileCounter[Oprofile.getNumberOfCounters()];
    for (int i = 0; i < arrayOfOprofileCounter.length; i++)
    {
      arrayOfOprofileCounter[i] = new OprofileCounter(i);
      if (paramILaunchConfiguration != null) {
        arrayOfOprofileCounter[i].loadConfiguration(paramILaunchConfiguration);
      }
    }
    return arrayOfOprofileCounter;
  }
  
  public void setEnabled(boolean paramBoolean)
  {
    _enabled = paramBoolean;
  }
  
  public void setEvent(OpEvent paramOpEvent)
  {
    _daemonEvent.setEvent(paramOpEvent);
  }
  
  public void setProfileKernel(boolean paramBoolean)
  {
    _daemonEvent.setProfileKernel(paramBoolean);
  }
  
  public void setProfileUser(boolean paramBoolean)
  {
    _daemonEvent.setProfileUser(paramBoolean);
  }
  
  public void setCount(int paramInt)
  {
    _daemonEvent.setResetCount(paramInt);
  }
  
  public void saveConfiguration(ILaunchConfigurationWorkingCopy paramILaunchConfigurationWorkingCopy)
  {
    paramILaunchConfigurationWorkingCopy.setAttribute(OprofileLaunchPlugin.ATTR_COUNTER_ENABLED(_number), _enabled);
    if (_daemonEvent.getEvent() != null)
    {
      paramILaunchConfigurationWorkingCopy.setAttribute(OprofileLaunchPlugin.ATTR_COUNTER_EVENT(_number), _daemonEvent.getEvent().getText());
      paramILaunchConfigurationWorkingCopy.setAttribute(OprofileLaunchPlugin.ATTR_COUNTER_UNIT_MASK(_number), _daemonEvent.getEvent().getUnitMask().getMaskValue());
    }
    paramILaunchConfigurationWorkingCopy.setAttribute(OprofileLaunchPlugin.ATTR_COUNTER_PROFILE_KERNEL(_number), _daemonEvent.getProfileKernel());
    paramILaunchConfigurationWorkingCopy.setAttribute(OprofileLaunchPlugin.ATTR_COUNTER_PROFILE_USER(_number), _daemonEvent.getProfileUser());
    paramILaunchConfigurationWorkingCopy.setAttribute(OprofileLaunchPlugin.ATTR_COUNTER_COUNT(_number), _daemonEvent.getResetCount());
  }
  
  public void loadConfiguration(ILaunchConfiguration paramILaunchConfiguration)
  {
    try
    {
      _enabled = paramILaunchConfiguration.getAttribute(OprofileLaunchPlugin.ATTR_COUNTER_ENABLED(_number), false);
      String str = paramILaunchConfiguration.getAttribute(OprofileLaunchPlugin.ATTR_COUNTER_EVENT(_number), "");
      _daemonEvent.setEvent(_eventFromString(str));
      if (_daemonEvent.getEvent() == null) {
        return;
      }
      int i = paramILaunchConfiguration.getAttribute(OprofileLaunchPlugin.ATTR_COUNTER_UNIT_MASK(_number), -1);
      _daemonEvent.getEvent().getUnitMask().setMaskValue(i);
      _daemonEvent.setProfileKernel(paramILaunchConfiguration.getAttribute(OprofileLaunchPlugin.ATTR_COUNTER_PROFILE_KERNEL(_number), false));
      _daemonEvent.setProfileUser(paramILaunchConfiguration.getAttribute(OprofileLaunchPlugin.ATTR_COUNTER_PROFILE_USER(_number), false));
      _daemonEvent.setResetCount(paramILaunchConfiguration.getAttribute(OprofileLaunchPlugin.ATTR_COUNTER_COUNT(_number), 0));
    }
    catch (CoreException localCoreException)
    {
      localCoreException.printStackTrace();
    }
  }
  
  public OpUnitMask getUnitMask()
  {
    OpEvent localOpEvent = _daemonEvent.getEvent();
    if (localOpEvent != null) {
      return localOpEvent.getUnitMask();
    }
    return null;
  }
  
  public String getText()
  {
    Object[] arrayOfObject = { new Integer(_number) };
    return MessageFormat.format(COUNTER_STRING, arrayOfObject);
  }
  
  public int getNumber()
  {
    return _number;
  }
  
  public boolean getEnabled()
  {
    return _enabled;
  }
  
  public OpEvent getEvent()
  {
    return _daemonEvent.getEvent();
  }
  
  public boolean getProfileKernel()
  {
    return _daemonEvent.getProfileKernel();
  }
  
  public boolean getProfileUser()
  {
    return _daemonEvent.getProfileUser();
  }
  
  public int getCount()
  {
    return _daemonEvent.getResetCount();
  }
  
  public OpEvent[] getValidEvents()
  {
    return _eventList;
  }
  
  public OprofileDaemonEvent getDaemonEvent()
  {
    return _daemonEvent;
  }
  
  private OpEvent _eventFromString(String paramString)
  {
    for (int i = 0; i < _eventList.length; i++) {
      if (_eventList[i].getText().equals(paramString)) {
        return _eventList[i];
      }
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.launch.configuration.OprofileCounter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.launch.configuration;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class OprofileEventConfigTab$1
  extends SelectionAdapter
{
  OprofileEventConfigTab$1(OprofileEventConfigTab paramOprofileEventConfigTab) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    OprofileEventConfigTab.access$3(this$0);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.launch.configuration.OprofileEventConfigTab.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.launch.configuration;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class OprofileEventConfigTab$2
  extends SelectionAdapter
{
  OprofileEventConfigTab$2(OprofileEventConfigTab paramOprofileEventConfigTab) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    OprofileEventConfigTab.access$4(this$0);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.launch.configuration.OprofileEventConfigTab.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.launch.configuration;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;

class OprofileEventConfigTab$CounterSubTab$1
  extends SelectionAdapter
{
  OprofileEventConfigTab$CounterSubTab$1(OprofileEventConfigTab.CounterSubTab paramCounterSubTab) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    OprofileEventConfigTab.CounterSubTab.access$0(this$1).setEnabled(OprofileEventConfigTab.CounterSubTab.access$2(this$1).getSelection());
    OprofileEventConfigTab.CounterSubTab.access$3(this$1, OprofileEventConfigTab.CounterSubTab.access$0(this$1).getEnabled());
    OprofileEventConfigTab.access$0(OprofileEventConfigTab.CounterSubTab.access$8(this$1));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.launch.configuration.OprofileEventConfigTab.CounterSubTab.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.launch.configuration;

import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.linuxtools.oprofile.core.daemon.OpEvent;
import org.eclipse.swt.graphics.Image;

class OprofileEventConfigTab$CounterSubTab$2
  implements ILabelProvider
{
  OprofileEventConfigTab$CounterSubTab$2(OprofileEventConfigTab.CounterSubTab paramCounterSubTab) {}
  
  public String getText(Object paramObject)
  {
    OpEvent localOpEvent = (OpEvent)paramObject;
    return localOpEvent.getText();
  }
  
  public Image getImage(Object paramObject)
  {
    return null;
  }
  
  public void addListener(ILabelProviderListener paramILabelProviderListener) {}
  
  public void dispose() {}
  
  public boolean isLabelProperty(Object paramObject, String paramString)
  {
    return false;
  }
  
  public void removeListener(ILabelProviderListener paramILabelProviderListener) {}
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.launch.configuration.OprofileEventConfigTab.CounterSubTab.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.launch.configuration;

import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

class OprofileEventConfigTab$CounterSubTab$3
  implements IStructuredContentProvider
{
  OprofileEventConfigTab$CounterSubTab$3(OprofileEventConfigTab.CounterSubTab paramCounterSubTab) {}
  
  public Object[] getElements(Object paramObject)
  {
    OprofileCounter localOprofileCounter = (OprofileCounter)paramObject;
    return localOprofileCounter.getValidEvents();
  }
  
  public void dispose() {}
  
  public void inputChanged(Viewer paramViewer, Object paramObject1, Object paramObject2) {}
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.launch.configuration.OprofileEventConfigTab.CounterSubTab.3
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.launch.configuration;

import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;

class OprofileEventConfigTab$CounterSubTab$4
  implements ISelectionChangedListener
{
  OprofileEventConfigTab$CounterSubTab$4(OprofileEventConfigTab.CounterSubTab paramCounterSubTab) {}
  
  public void selectionChanged(SelectionChangedEvent paramSelectionChangedEvent)
  {
    OprofileEventConfigTab.CounterSubTab.access$4(this$1);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.launch.configuration.OprofileEventConfigTab.CounterSubTab.4
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.launch.configuration;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class OprofileEventConfigTab$CounterSubTab$5
  extends SelectionAdapter
{
  OprofileEventConfigTab$CounterSubTab$5(OprofileEventConfigTab.CounterSubTab paramCounterSubTab) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    OprofileEventConfigTab.CounterSubTab.access$5(this$1);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.launch.configuration.OprofileEventConfigTab.CounterSubTab.5
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.launch.configuration;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class OprofileEventConfigTab$CounterSubTab$6
  extends SelectionAdapter
{
  OprofileEventConfigTab$CounterSubTab$6(OprofileEventConfigTab.CounterSubTab paramCounterSubTab) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    OprofileEventConfigTab.CounterSubTab.access$6(this$1);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.launch.configuration.OprofileEventConfigTab.CounterSubTab.6
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.launch.configuration;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;

class OprofileEventConfigTab$CounterSubTab$7
  implements ModifyListener
{
  OprofileEventConfigTab$CounterSubTab$7(OprofileEventConfigTab.CounterSubTab paramCounterSubTab) {}
  
  public void modifyText(ModifyEvent paramModifyEvent)
  {
    OprofileEventConfigTab.CounterSubTab.access$7(this$1);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.launch.configuration.OprofileEventConfigTab.CounterSubTab.7
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.launch.configuration;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;

class OprofileEventConfigTab$CounterSubTab$UnitMaskViewer$1
  extends SelectionAdapter
{
  OprofileEventConfigTab$CounterSubTab$UnitMaskViewer$1(OprofileEventConfigTab.CounterSubTab.UnitMaskViewer paramUnitMaskViewer, int paramInt) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    OprofileEventConfigTab.CounterSubTab.UnitMaskViewer.access$0(this$2, (Button)paramSelectionEvent.getSource(), val$maskButtonIndex);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.launch.configuration.OprofileEventConfigTab.CounterSubTab.UnitMaskViewer.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.launch.configuration;

import java.util.ArrayList;
import org.eclipse.linuxtools.oprofile.core.OprofileCorePlugin;
import org.eclipse.linuxtools.oprofile.core.daemon.OpEvent;
import org.eclipse.linuxtools.oprofile.core.daemon.OpUnitMask;
import org.eclipse.linuxtools.oprofile.launch.OprofileLaunchMessages;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;

class OprofileEventConfigTab$CounterSubTab$UnitMaskViewer
{
  private Label _unitMaskLabel;
  private Composite _top;
  private Composite _maskListComp;
  private Button[] _unitMaskButtons;
  
  public OprofileEventConfigTab$CounterSubTab$UnitMaskViewer(OprofileEventConfigTab.CounterSubTab paramCounterSubTab, Composite paramComposite)
  {
    _unitMaskLabel = new Label(paramComposite, 0);
    _unitMaskLabel.setLayoutData(new GridData(16384, 16777216, false, false));
    _unitMaskLabel.setText(OprofileLaunchMessages.getString("unitmaskViewer.label.text"));
    _unitMaskLabel.setVisible(true);
    Composite localComposite = new Composite(paramComposite, 0);
    localComposite.setLayoutData(new GridData(4, 4, true, true));
    GridLayout localGridLayout = new GridLayout();
    marginHeight = 0;
    marginWidth = 0;
    localComposite.setLayout(localGridLayout);
    _top = localComposite;
    _maskListComp = null;
    _unitMaskButtons = null;
  }
  
  private void _handleToggle(Button paramButton, int paramInt)
  {
    OpUnitMask localOpUnitMask = OprofileEventConfigTab.CounterSubTab.access$0(this$1).getUnitMask();
    if (localOpUnitMask != null) {
      if (paramButton.getSelection()) {
        localOpUnitMask.setMaskFromIndex(paramInt);
      } else {
        localOpUnitMask.unSetMaskFromIndex(paramInt);
      }
    }
    OprofileEventConfigTab.access$0(OprofileEventConfigTab.CounterSubTab.access$8(this$1));
  }
  
  public void displayEvent(OpEvent paramOpEvent)
  {
    OpUnitMask localOpUnitMask = paramOpEvent.getUnitMask();
    int i = localOpUnitMask.getNumMasks();
    if (_maskListComp != null) {
      _maskListComp.dispose();
    }
    Composite localComposite = new Composite(_top, 0);
    localComposite.setLayout(new GridLayout());
    localComposite.setLayoutData(new GridData(16384, 4, false, true));
    _maskListComp = localComposite;
    localOpUnitMask.setDefaultMaskValue();
    ArrayList localArrayList = new ArrayList();
    for (int j = 0; j < i; j++)
    {
      if (localOpUnitMask.getType() == -1)
      {
        OprofileCorePlugin.showErrorDialog("opxmlParse", null);
        return;
      }
      Button localButton;
      if (localOpUnitMask.getType() == 1)
      {
        localButton = new Button(localComposite, 16);
        localButton.setEnabled(false);
        localButton.setText(localOpUnitMask.getText(j));
        localButton.setSelection(true);
      }
      else
      {
        final int m = j;
        boolean bool = localOpUnitMask.isMaskSetFromIndex(m);
        int k;
        if (localOpUnitMask.getType() == 2) {
          k = 16;
        } else {
          k = 32;
        }
        localButton = new Button(localComposite, k);
        localButton.setEnabled(true);
        localButton.setText(localOpUnitMask.getText(j));
        localButton.setSelection(bool);
        localButton.addSelectionListener(new SelectionAdapter()
        {
          public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
          {
            OprofileEventConfigTab.CounterSubTab.UnitMaskViewer.this._handleToggle((Button)paramAnonymousSelectionEvent.getSource(), m);
          }
        });
        localArrayList.add(localButton);
      }
    }
    _unitMaskButtons = new Button[localArrayList.size()];
    localArrayList.toArray(_unitMaskButtons);
    OprofileEventConfigTab.CounterSubTab.access$1(this$1);
  }
  
  public void setEnabled(boolean paramBoolean)
  {
    if (_unitMaskButtons != null)
    {
      Button[] arrayOfButton;
      int j = (arrayOfButton = _unitMaskButtons).length;
      for (int i = 0; i < j; i++)
      {
        Button localButton = arrayOfButton[i];
        localButton.setEnabled(paramBoolean);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.oprofile.launch.configuration.OprofileEventConfigTab.CounterSubTab.UnitMaskViewer
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.launch.configuration;

import java.text.MessageFormat;
import java.util.ArrayList;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ListViewer;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.linuxtools.oprofile.core.OprofileCorePlugin;
import org.eclipse.linuxtools.oprofile.core.daemon.OpEvent;
import org.eclipse.linuxtools.oprofile.core.daemon.OpUnitMask;
import org.eclipse.linuxtools.oprofile.launch.OprofileLaunchMessages;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Text;

class OprofileEventConfigTab$CounterSubTab
{
  private Button _enabledCheck;
  private Button _profileKernelCheck;
  private Button _profileUserCheck;
  private Label _countTextLabel;
  private Text _countText;
  private Label _eventDescLabel;
  private Text _eventDescText;
  private UnitMaskViewer _unitMaskViewer;
  private ListViewer _eventList;
  private OprofileCounter _counter;
  private ScrolledComposite _scrolledTop;
  private Composite _tabTopContainer;
  
  public OprofileEventConfigTab$CounterSubTab(OprofileEventConfigTab paramOprofileEventConfigTab, Composite paramComposite, OprofileCounter paramOprofileCounter)
  {
    _counter = paramOprofileCounter;
    paramComposite.setLayout(new GridLayout());
    ScrolledComposite localScrolledComposite = new ScrolledComposite(paramComposite, 768);
    localScrolledComposite.setLayoutData(new GridData(4, 4, true, true));
    GridLayout localGridLayout = new GridLayout();
    marginHeight = 0;
    marginWidth = 0;
    localScrolledComposite.setLayout(localGridLayout);
    localScrolledComposite.setExpandHorizontal(true);
    localScrolledComposite.setExpandVertical(true);
    Composite localComposite1 = new Composite(localScrolledComposite, 0);
    localScrolledComposite.setContent(localComposite1);
    localGridLayout = new GridLayout();
    marginHeight = 0;
    marginWidth = 0;
    numColumns = 2;
    localComposite1.setLayout(localGridLayout);
    localComposite1.setLayoutData(new GridData(4, 4, true, true));
    Composite localComposite2 = new Composite(localComposite1, 0);
    localGridLayout = new GridLayout();
    marginHeight = 0;
    marginWidth = 0;
    numColumns = 2;
    localComposite2.setLayout(localGridLayout);
    localComposite2.setLayoutData(new GridData(4, 128, true, false, 2, 1));
    createTopCell(localComposite2);
    OprofileEventConfigTab.access$1(paramOprofileEventConfigTab, localComposite1, 2);
    Composite localComposite3 = new Composite(localComposite1, 0);
    localGridLayout = new GridLayout();
    marginHeight = 0;
    marginWidth = 0;
    localComposite3.setLayout(localGridLayout);
    createLeftCell(localComposite3);
    Composite localComposite4 = new Composite(localComposite1, 0);
    localGridLayout = new GridLayout();
    numColumns = 2;
    marginHeight = 0;
    marginWidth = 0;
    localComposite4.setLayout(localGridLayout);
    localComposite4.setLayoutData(new GridData(4, 4, true, false));
    createRightCell(localComposite4);
    GridData localGridData = new GridData(4, 4, false, true);
    heightHint = getSizex;
    localComposite3.setLayoutData(localGridData);
    _scrolledTop = localScrolledComposite;
    _tabTopContainer = localComposite1;
  }
  
  private void createTopCell(Composite paramComposite)
  {
    _enabledCheck = new Button(paramComposite, 32);
    _enabledCheck.setText(OprofileLaunchMessages.getString("tab.event.counterSettings.enabled.button.text"));
    _enabledCheck.setLayoutData(new GridData(16384, 16777216, false, false, 2, 1));
    _enabledCheck.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
      {
        _counter.setEnabled(_enabledCheck.getSelection());
        OprofileEventConfigTab.CounterSubTab.this._setEnabledState(_counter.getEnabled());
        OprofileEventConfigTab.access$0(this$0);
      }
    });
    _enabledCheck.setEnabled(false);
    _eventDescLabel = new Label(paramComposite, 0);
    _eventDescLabel.setText(OprofileLaunchMessages.getString("tab.event.eventDescription.label.text"));
    _eventDescLabel.setLayoutData(new GridData(16384, 16777216, false, false));
    _eventDescText = new Text(paramComposite, 2060);
    _eventDescText.setLayoutData(new GridData(4, 16777216, true, false));
  }
  
  private void createLeftCell(Composite paramComposite)
  {
    _eventList = new ListViewer(paramComposite, 2820);
    _eventList.getList().setLayoutData(new GridData(16384, 4, false, true));
    _eventList.setLabelProvider(new ILabelProvider()
    {
      public String getText(Object paramAnonymousObject)
      {
        OpEvent localOpEvent = (OpEvent)paramAnonymousObject;
        return localOpEvent.getText();
      }
      
      public Image getImage(Object paramAnonymousObject)
      {
        return null;
      }
      
      public void addListener(ILabelProviderListener paramAnonymousILabelProviderListener) {}
      
      public void dispose() {}
      
      public boolean isLabelProperty(Object paramAnonymousObject, String paramAnonymousString)
      {
        return false;
      }
      
      public void removeListener(ILabelProviderListener paramAnonymousILabelProviderListener) {}
    });
    _eventList.setContentProvider(new IStructuredContentProvider()
    {
      public Object[] getElements(Object paramAnonymousObject)
      {
        OprofileCounter localOprofileCounter = (OprofileCounter)paramAnonymousObject;
        return localOprofileCounter.getValidEvents();
      }
      
      public void dispose() {}
      
      public void inputChanged(Viewer paramAnonymousViewer, Object paramAnonymousObject1, Object paramAnonymousObject2) {}
    });
    _eventList.setInput(_counter);
    _eventList.addSelectionChangedListener(new ISelectionChangedListener()
    {
      public void selectionChanged(SelectionChangedEvent paramAnonymousSelectionChangedEvent)
      {
        OprofileEventConfigTab.CounterSubTab.this._handleEventListSelectionChange();
      }
    });
  }
  
  private void createRightCell(Composite paramComposite)
  {
    _profileKernelCheck = new Button(paramComposite, 32);
    _profileKernelCheck.setText(OprofileLaunchMessages.getString("tab.event.counterSettings.profileKernel.check.text"));
    _profileKernelCheck.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
      {
        OprofileEventConfigTab.CounterSubTab.this._handleProfileKernelToggle();
      }
    });
    _profileUserCheck = new Button(paramComposite, 32);
    _profileUserCheck.setText(OprofileLaunchMessages.getString("tab.event.counterSettings.profileUser.check.text"));
    _profileUserCheck.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
      {
        OprofileEventConfigTab.CounterSubTab.this._handleProfileUserToggle();
      }
    });
    _countTextLabel = new Label(paramComposite, 0);
    _countTextLabel.setText(OprofileLaunchMessages.getString("tab.event.counterSettings.count.label.text"));
    _countText = new Text(paramComposite, 2052);
    _countText.setLayoutData(new GridData(4, 16777216, true, false));
    _countText.addModifyListener(new ModifyListener()
    {
      public void modifyText(ModifyEvent paramAnonymousModifyEvent)
      {
        OprofileEventConfigTab.CounterSubTab.this._handleCountTextModify();
      }
    });
    Composite localComposite = new Composite(paramComposite, 0);
    GridLayout localGridLayout = new GridLayout();
    marginHeight = 0;
    marginWidth = 0;
    localComposite.setLayout(localGridLayout);
    localComposite.setLayoutData(new GridData(4, 4, true, false, 2, 1));
    _unitMaskViewer = new UnitMaskViewer(localComposite);
  }
  
  public void initializeTab(ILaunchConfiguration paramILaunchConfiguration)
  {
    setEnabledState(false);
    if (paramILaunchConfiguration != null) {
      _counter.loadConfiguration(paramILaunchConfiguration);
    }
    boolean bool = _counter.getEnabled();
    _enabledCheck.setSelection(bool);
    if (_counter.getEvent() == null) {
      _counter.setEvent(_counter.getValidEvents()[0]);
    }
    _profileKernelCheck.setSelection(_counter.getProfileKernel());
    _profileUserCheck.setSelection(_counter.getProfileUser());
    _countText.setText(Integer.toString(_counter.getCount()));
    _eventDescText.setText(_counter.getEvent().getTextDescription());
    _unitMaskViewer.displayEvent(_counter.getEvent());
    _eventList.setSelection(new StructuredSelection(_counter.getEvent()));
  }
  
  public void performApply(ILaunchConfigurationWorkingCopy paramILaunchConfigurationWorkingCopy)
  {
    _counter.saveConfiguration(paramILaunchConfigurationWorkingCopy);
  }
  
  public void setEnabledState(boolean paramBoolean)
  {
    _enabledCheck.setEnabled(paramBoolean);
    if (paramBoolean) {
      _setEnabledState(_counter.getEnabled());
    } else {
      _setEnabledState(false);
    }
  }
  
  private void _setEnabledState(boolean paramBoolean)
  {
    _profileKernelCheck.setEnabled(paramBoolean);
    _profileUserCheck.setEnabled(paramBoolean);
    _countText.setEnabled(paramBoolean);
    _eventDescText.setEnabled(paramBoolean);
    _unitMaskViewer.setEnabled(paramBoolean);
    _eventList.getList().setEnabled(paramBoolean);
  }
  
  private void _handleEventListSelectionChange()
  {
    int i = _eventList.getList().getSelectionIndex();
    OpEvent localOpEvent = (OpEvent)_eventList.getElementAt(i);
    _counter.setEvent(localOpEvent);
    _eventDescText.setText(localOpEvent.getTextDescription());
    _unitMaskViewer.displayEvent(localOpEvent);
    int j = _counter.getEvent().getMinCount();
    if (_counter.getCount() < j) {
      OprofileEventConfigTab.access$2(this$0, getMinCountErrorMessage(j));
    }
    OprofileEventConfigTab.access$0(this$0);
  }
  
  private void _handleProfileUserToggle()
  {
    _counter.setProfileUser(_profileUserCheck.getSelection());
    OprofileEventConfigTab.access$0(this$0);
  }
  
  private void _handleProfileKernelToggle()
  {
    _counter.setProfileKernel(_profileKernelCheck.getSelection());
    OprofileEventConfigTab.access$0(this$0);
  }
  
  /* Error */
  private void _handleCountTextModify()
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_1
    //   2: aload_0
    //   3: getfield 219	org/eclipse/linuxtools/oprofile/launch/configuration/OprofileEventConfigTab$CounterSubTab:_countText	Lorg/eclipse/swt/widgets/Text;
    //   6: invokevirtual 343	org/eclipse/swt/widgets/Text:getText	()Ljava/lang/String;
    //   9: invokestatic 346	java/lang/Integer:parseInt	(Ljava/lang/String;)
1 2 3

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