org.eclipse.linuxtools.oprofile.ui_1.3.18.201310312000

16:46:08.475 INFO  jd.cli.Main - Decompiling org.eclipse.linuxtools.oprofile.ui_1.3.18.201310312000.jar
package org.eclipse.linuxtools.oprofile.ui;

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

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

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

import java.text.DecimalFormat;
import java.text.NumberFormat;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.linuxtools.oprofile.ui.view.OprofileView;
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 OprofileUiPlugin
  extends AbstractUIPlugin
{
  private static OprofileUiPlugin plugin;
  private OprofileView _oprofileview = null;
  public static final String ID_PLUGIN = "org.eclipse.linuxtools.oprofile.ui";
  public static final String ID_OPROFILE_VIEW = "org.eclipse.linuxtools.oprofile.ui.OProfileView";
  private static final String ICON_PATH = "icons/";
  public static final String SESSION_ICON = "icons/session.gif";
  public static final String EVENT_ICON = "icons/event.gif";
  public static final String IMAGE_ICON = "icons/image.gif";
  public static final String DEPENDENT_ICON = "icons/dependent.gif";
  public static final String SYMBOL_ICON = "icons/symbol.gif";
  public static final String SAMPLE_ICON = "icons/sample.gif";
  public static final double MINIMUM_SAMPLE_PERCENTAGE = 1.0E-4D;
  public static final double MINIMUM_CHART_PERCENTAGE = 0.01D;
  public static final String ANNOTATION_TYPE_LT_MIN_PERCENTAGE = "org.eclipse.linuxtools.oprofile.ui.annotation.lt.min.pct";
  public static final String ANNOTATION_TYPE_LT_05 = "org.eclipse.linuxtools.oprofile.ui.annotation.lt.05.pct";
  public static final String ANNOTATION_TYPE_LT_10 = "org.eclipse.linuxtools.oprofile.ui.annotation.lt.10.pct";
  public static final String ANNOTATION_TYPE_LT_20 = "org.eclipse.linuxtools.oprofile.ui.annotation.lt.20.pct";
  public static final String ANNOTATION_TYPE_LT_30 = "org.eclipse.linuxtools.oprofile.ui.annotation.lt.30.pct";
  public static final String ANNOTATION_TYPE_LT_40 = "org.eclipse.linuxtools.oprofile.ui.annotation.lt.40.pct";
  public static final String ANNOTATION_TYPE_LT_50 = "org.eclipse.linuxtools.oprofile.ui.annotation.lt.50.pct";
  public static final String ANNOTATION_TYPE_GT_50 = "org.eclipse.linuxtools.oprofile.ui.annotation.gt.50.pct";
  
  public OprofileUiPlugin()
  {
    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 OprofileUiPlugin getDefault()
  {
    return plugin;
  }
  
  public static IWorkspace getWorkspace()
  {
    return ResourcesPlugin.getWorkspace();
  }
  
  public static ImageDescriptor getImageDescriptor(String paramString)
  {
    return imageDescriptorFromPlugin("org.eclipse.linuxtools.oprofile.ui", paramString);
  }
  
  public OprofileView getOprofileView()
  {
    return _oprofileview;
  }
  
  public void setOprofileView(OprofileView paramOprofileView)
  {
    _oprofileview = paramOprofileView;
  }
  
  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 String getPercentageString(double paramDouble)
  {
    NumberFormat localNumberFormat = NumberFormat.getPercentInstance();
    if ((localNumberFormat instanceof DecimalFormat))
    {
      localNumberFormat.setMinimumFractionDigits(2);
      localNumberFormat.setMaximumFractionDigits(2);
    }
    if (paramDouble < 1.0E-4D) {
      return "<" + localNumberFormat.format(1.0E-4D);
    }
    return localNumberFormat.format(paramDouble);
  }
  
  public static String getPercentage(double paramDouble)
  {
    String str = null;
    if (paramDouble < 1.0E-4D) {
      str = "< " + getDoubleFloor(0.01D, 2);
    } else {
      str = String.valueOf(getDoubleFloor(paramDouble * 100.0D, 2));
    }
    return str;
  }
  
  public static double getDoubleFloor(double paramDouble, int paramInt)
  {
    double d = Math.pow(10.0D, paramInt);
    return (int)(paramDouble * (int)d) / d;
  }
}

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

import org.eclipse.swt.graphics.Image;

public abstract interface IUiModelElement
{
  public abstract String getLabelText();
  
  public abstract IUiModelElement[] getChildren();
  
  public abstract boolean hasChildren();
  
  public abstract IUiModelElement getParent();
  
  public abstract Image getLabelImage();
  
  public abstract double getPercentage();
  
  public abstract String getName();
}

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

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.linuxtools.oprofile.core.model.OpModelImage;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiMessages;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiPlugin;
import org.eclipse.swt.graphics.Image;

public class UiModelDependent
  implements IUiModelElement
{
  private IUiModelElement _parent;
  private OpModelImage[] _dataModelDependents;
  private UiModelImage[] _dependents;
  private int _totalCount;
  private int _depCount;
  
  public UiModelDependent(IUiModelElement paramIUiModelElement, OpModelImage[] paramArrayOfOpModelImage, int paramInt1, int paramInt2)
  {
    _parent = paramIUiModelElement;
    _dataModelDependents = paramArrayOfOpModelImage;
    _dependents = null;
    _totalCount = paramInt1;
    _depCount = paramInt2;
    refreshModel();
  }
  
  private void refreshModel()
  {
    _dependents = new UiModelImage[_dataModelDependents.length];
    for (int i = 0; i < _dataModelDependents.length; i++) {
      _dependents[i] = new UiModelImage(this, _dataModelDependents[i], _totalCount, 0);
    }
  }
  
  public String toString()
  {
    double d = _depCount / _totalCount;
    String str = OprofileUiPlugin.getPercentageString(d);
    return str + " " + OprofileUiMessages.getString("uimodel.percentage.in") + OprofileUiMessages.getString("uimodel.dependent.dependent.images");
  }
  
  public String getLabelText()
  {
    return toString();
  }
  
  public IUiModelElement[] getChildren()
  {
    return _dependents;
  }
  
  public boolean hasChildren()
  {
    return true;
  }
  
  public IUiModelElement getParent()
  {
    return _parent;
  }
  
  public Image getLabelImage()
  {
    return OprofileUiPlugin.getImageDescriptor("icons/dependent.gif").createImage();
  }
  
  public String getName()
  {
    return null;
  }
  
  public double getPercentage()
  {
    return _depCount / _totalCount;
  }
}

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

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.linuxtools.oprofile.core.model.OpModelEvent;
import org.eclipse.linuxtools.oprofile.core.model.OpModelSession;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiPlugin;
import org.eclipse.swt.graphics.Image;

public class UiModelEvent
  implements IUiModelElement
{
  private IUiModelElement _parent = null;
  private OpModelEvent _event;
  private UiModelSession[] _sessions;
  
  public UiModelEvent(OpModelEvent paramOpModelEvent)
  {
    if (paramOpModelEvent != null)
    {
      _event = paramOpModelEvent;
      refreshModel();
    }
  }
  
  private void refreshModel()
  {
    OpModelSession[] arrayOfOpModelSession = _event.getSessions();
    _sessions = new UiModelSession[arrayOfOpModelSession.length];
    for (int i = 0; i < arrayOfOpModelSession.length; i++) {
      _sessions[i] = new UiModelSession(this, arrayOfOpModelSession[i]);
    }
  }
  
  public String toString()
  {
    return _event == null ? "" : _event.getName();
  }
  
  public String getLabelText()
  {
    return toString();
  }
  
  public IUiModelElement[] getChildren()
  {
    return _sessions;
  }
  
  public boolean hasChildren()
  {
    return (_sessions != null) && (_sessions.length != 0);
  }
  
  public IUiModelElement getParent()
  {
    return _parent;
  }
  
  public Image getLabelImage()
  {
    return OprofileUiPlugin.getImageDescriptor("icons/event.gif").createImage();
  }
  
  public String getName()
  {
    return null;
  }
  
  public double getPercentage()
  {
    return -1.0D;
  }
}

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

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.linuxtools.oprofile.core.model.OpModelImage;
import org.eclipse.linuxtools.oprofile.core.model.OpModelSymbol;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiMessages;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiPlugin;
import org.eclipse.swt.graphics.Image;

public class UiModelImage
  implements IUiModelElement
{
  private IUiModelElement _parent;
  private OpModelImage _image;
  private UiModelSymbol[] _symbols;
  private int _totalCount;
  private int _depCount;
  
  public UiModelImage(IUiModelElement paramIUiModelElement, OpModelImage paramOpModelImage, int paramInt1, int paramInt2)
  {
    _parent = paramIUiModelElement;
    _image = paramOpModelImage;
    _symbols = null;
    _totalCount = paramInt1;
    _depCount = paramInt2;
    refreshModel();
  }
  
  private void refreshModel()
  {
    OpModelSymbol[] arrayOfOpModelSymbol = _image.getSymbols();
    if (arrayOfOpModelSymbol != null)
    {
      _symbols = new UiModelSymbol[arrayOfOpModelSymbol.length];
      for (int i = 0; i < arrayOfOpModelSymbol.length; i++) {
        _symbols[i] = new UiModelSymbol(this, arrayOfOpModelSymbol[i], _totalCount);
      }
    }
  }
  
  public String toString()
  {
    if (_image.getCount() == -1) {
      return OprofileUiMessages.getString("opxmlParse.error.multipleImages");
    }
    double d = (_image.getCount() - _depCount) / _totalCount;
    String str = OprofileUiPlugin.getPercentageString(d);
    return str + " " + OprofileUiMessages.getString("uimodel.percentage.in") + _image.getName();
  }
  
  public String getLabelText()
  {
    return toString();
  }
  
  public IUiModelElement[] getChildren()
  {
    IUiModelElement[] arrayOfIUiModelElement = (IUiModelElement[])null;
    if (_symbols != null)
    {
      arrayOfIUiModelElement = new IUiModelElement[_symbols.length];
      for (int i = 0; i < _symbols.length; i++) {
        arrayOfIUiModelElement[i] = _symbols[i];
      }
    }
    return arrayOfIUiModelElement;
  }
  
  public boolean hasChildren()
  {
    return (_symbols != null) && (_symbols.length != 0);
  }
  
  public IUiModelElement getParent()
  {
    return _parent;
  }
  
  public Image getLabelImage()
  {
    return OprofileUiPlugin.getImageDescriptor("icons/image.gif").createImage();
  }
  
  public double getPercentage()
  {
    return (_image.getCount() - _depCount) / _totalCount;
  }
  
  public String getName()
  {
    return _image.getName();
  }
}

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

import org.eclipse.linuxtools.oprofile.core.model.OpModelEvent;
import org.eclipse.linuxtools.oprofile.core.model.OpModelRoot;
import org.eclipse.linuxtools.oprofile.core.model.OpModelSession;
import org.eclipse.swt.graphics.Image;

public class UiModelRoot
  implements IUiModelElement
{
  private UiModelEvent[] _events = null;
  private String xmlStr;
  
  public String getLabelText()
  {
    return null;
  }
  
  public IUiModelElement[] getChildren()
  {
    return _events;
  }
  
  public boolean hasChildren()
  {
    return (_events != null) && (_events.length != 0);
  }
  
  public IUiModelElement getParent()
  {
    return null;
  }
  
  public Image getLabelImage()
  {
    return null;
  }
  
  public String getName()
  {
    return null;
  }
  
  public double getPercentage()
  {
    return -1.0D;
  }
  
  public void refreshModel(OpModelRoot paramOpModelRoot)
  {
    setXML(paramOpModelRoot.getXML());
    OpModelEvent[] arrayOfOpModelEvent = paramOpModelRoot.getEvents();
    if (arrayOfOpModelEvent != null)
    {
      _events = new UiModelEvent[arrayOfOpModelEvent.length];
      for (int i = 0; i < arrayOfOpModelEvent.length; i++) {
        _events[i] = new UiModelEvent(arrayOfOpModelEvent[i]);
      }
    }
    else
    {
      String str = "There is no sample data.";
      _events = new UiModelEvent[1];
      OpModelEvent localOpModelEvent = new OpModelEvent(str);
      localOpModelEvent._setSessions(new OpModelSession[0]);
      _events[0] = new UiModelEvent(localOpModelEvent);
    }
  }
  
  public void setXML(String paramString)
  {
    xmlStr = paramString;
  }
  
  public String getXML()
  {
    return xmlStr;
  }
}

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

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.linuxtools.oprofile.core.model.OpModelSample;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiMessages;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiPlugin;
import org.eclipse.swt.graphics.Image;

public class UiModelSample
  implements IUiModelElement
{
  private IUiModelElement _parent;
  private OpModelSample _sample;
  private int _totalCount;
  
  public UiModelSample(IUiModelElement paramIUiModelElement, OpModelSample paramOpModelSample, int paramInt)
  {
    _parent = paramIUiModelElement;
    _sample = paramOpModelSample;
    _totalCount = paramInt;
  }
  
  public String toString()
  {
    double d = _sample.getCount() / _totalCount;
    String str = OprofileUiPlugin.getPercentageString(d);
    return str + " " + OprofileUiMessages.getString("uimodel.sample.on.line") + Integer.toString(_sample.getLine());
  }
  
  public int getLine()
  {
    return _sample.getLine();
  }
  
  public double getCountPercentage()
  {
    return _sample.getCount() / _totalCount;
  }
  
  public String getLabelText()
  {
    return toString();
  }
  
  public IUiModelElement[] getChildren()
  {
    return null;
  }
  
  public boolean hasChildren()
  {
    return false;
  }
  
  public IUiModelElement getParent()
  {
    return _parent;
  }
  
  public Image getLabelImage()
  {
    return OprofileUiPlugin.getImageDescriptor("icons/sample.gif").createImage();
  }
  
  public double getPercentage()
  {
    return _sample.getCount() / _totalCount;
  }
  
  public String getName()
  {
    return ((UiModelSymbol)_parent).getShortFileName() + " : " + Integer.toString(_sample.getLine());
  }
}

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

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.linuxtools.oprofile.core.model.OpModelImage;
import org.eclipse.linuxtools.oprofile.core.model.OpModelSession;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiPlugin;
import org.eclipse.swt.graphics.Image;

public class UiModelSession
  implements IUiModelElement
{
  private IUiModelElement _parent;
  private OpModelSession _session;
  private UiModelImage _image;
  private UiModelDependent _dependent;
  private static final String DEFAULT_SESSION_NAME = "current";
  
  public UiModelSession(IUiModelElement paramIUiModelElement, OpModelSession paramOpModelSession)
  {
    _parent = paramIUiModelElement;
    _session = paramOpModelSession;
    _image = null;
    _dependent = null;
    refreshModel();
  }
  
  private void refreshModel()
  {
    OpModelImage localOpModelImage = _session.getImage();
    if (localOpModelImage != null)
    {
      _image = new UiModelImage(this, localOpModelImage, localOpModelImage.getCount(), localOpModelImage.getDepCount());
      if (localOpModelImage.hasDependents()) {
        _dependent = new UiModelDependent(this, localOpModelImage.getDependents(), localOpModelImage.getCount(), localOpModelImage.getDepCount());
      }
    }
  }
  
  public String toString()
  {
    return _session.getName();
  }
  
  public boolean isDefaultSession()
  {
    return _session.getName().equalsIgnoreCase("current");
  }
  
  public String getLabelText()
  {
    return toString();
  }
  
  public IUiModelElement[] getChildren()
  {
    if (_dependent != null) {
      return new IUiModelElement[] { _image, _dependent };
    }
    return new IUiModelElement[] { _image };
  }
  
  public boolean hasChildren()
  {
    return _image != null;
  }
  
  public IUiModelElement getParent()
  {
    return _parent;
  }
  
  public Image getLabelImage()
  {
    return OprofileUiPlugin.getImageDescriptor("icons/session.gif").createImage();
  }
  
  public String getName()
  {
    return null;
  }
  
  public double getPercentage()
  {
    return -1.0D;
  }
}

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

import java.io.File;
import java.util.ArrayList;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.linuxtools.oprofile.core.model.OpModelSample;
import org.eclipse.linuxtools.oprofile.core.model.OpModelSymbol;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiMessages;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiPlugin;
import org.eclipse.swt.graphics.Image;

public class UiModelSymbol
  implements IUiModelElement
{
  private IUiModelElement _parent;
  private OpModelSymbol _symbol;
  private UiModelSample[] _samples;
  private int _totalCount;
  
  public UiModelSymbol(IUiModelElement paramIUiModelElement, OpModelSymbol paramOpModelSymbol, int paramInt)
  {
    _parent = paramIUiModelElement;
    _symbol = paramOpModelSymbol;
    _samples = null;
    _totalCount = paramInt;
    refreshModel();
  }
  
  private void refreshModel()
  {
    ArrayList localArrayList = new ArrayList();
    OpModelSample[] arrayOfOpModelSample = _symbol.getSamples();
    for (int i = 0; i < arrayOfOpModelSample.length; i++) {
      if (arrayOfOpModelSample[i].getLine() != 0) {
        localArrayList.add(new UiModelSample(this, arrayOfOpModelSample[i], _totalCount));
      }
    }
    _samples = new UiModelSample[localArrayList.size()];
    localArrayList.toArray(_samples);
  }
  
  public String toString()
  {
    double d = _symbol.getCount() / _totalCount;
    String str1 = OprofileUiPlugin.getPercentageString(d);
    String str2 = new File(_symbol.getFile()).getName();
    return str1 + " " + OprofileUiMessages.getString("uimodel.percentage.in") + _symbol.getName() + (str2.length() == 0 ? "" : new StringBuilder(" [").append(str2).append("]").toString());
  }
  
  public String getFileName()
  {
    return _symbol.getFile();
  }
  
  public String getLabelText()
  {
    return toString();
  }
  
  public IUiModelElement[] getChildren()
  {
    return _samples;
  }
  
  public boolean hasChildren()
  {
    return (_samples != null) && (_samples.length != 0);
  }
  
  public IUiModelElement getParent()
  {
    return _parent;
  }
  
  public Image getLabelImage()
  {
    return OprofileUiPlugin.getImageDescriptor("icons/symbol.gif").createImage();
  }
  
  public double getPercentage()
  {
    return _symbol.getCount() / _totalCount;
  }
  
  public String getName()
  {
    String str = getShortFileName();
    return _symbol.getName() + (str.length() == 0 ? "" : new StringBuilder(" [").append(str).append("]").toString());
  }
  
  public String getShortFileName()
  {
    return new File(getFileName()).getName();
  }
}

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

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.linuxtools.oprofile.core.Oprofile;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiMessages;

class LogReader
  implements Runnable, IRunnableWithProgress
{
  private static long _lastModified = -1L;
  private static String _contents = null;
  
  public void run()
  {
    File localFile = new File(Oprofile.getLogFile());
    long l = localFile.lastModified();
    if (l != _lastModified)
    {
      _lastModified = l;
      _contents = new String();
      try
      {
        BufferedReader localBufferedReader = new BufferedReader(new FileReader(localFile));
        String str;
        while ((str = localBufferedReader.readLine()) != null) {
          _contents = _contents + str + "\n";
        }
      }
      catch (FileNotFoundException localFileNotFoundException)
      {
        _contents = OprofileUiMessages.getString("oprofiled.logreader.error.fileNotFound");
      }
      catch (IOException localIOException)
      {
        _lastModified = 0L;
        _contents = OprofileUiMessages.getString("oprofiled.logreader.error.io");
      }
    }
  }
  
  public String getLogContents()
  {
    return _contents;
  }
  
  public void run(IProgressMonitor paramIProgressMonitor)
    throws InvocationTargetException, InterruptedException
  {
    run();
  }
}

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

import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.swt.widgets.TreeItem;

class OprofileView$1
  implements Listener
{
  OprofileView$1(OprofileView paramOprofileView, TreeColumn[] paramArrayOfTreeColumn) {}
  
  public void handleEvent(Event paramEvent)
  {
    if (index == 1)
    {
      GC localGC = gc;
      String str = ((TreeItem)item).getText(1);
      int i = 0;
      if ((str != null) && (str.length() > 0) && (!str.startsWith("<"))) {
        i = (int)Double.parseDouble(str);
      }
      int j = val$column[1].getWidth() * i / 100;
      if (j > 5)
      {
        Display localDisplay = Display.getCurrent();
        localGC.setForeground(localDisplay.getSystemColor(5));
        localGC.setBackground(localDisplay.getSystemColor(14));
        localGC.fillGradientRectangle(x + 40, y, j - 5, height, true);
        Rectangle localRectangle = new Rectangle(x + 40, y, j - 5, height - 1);
        localGC.drawRectangle(localRectangle);
        localGC.setForeground(localDisplay.getSystemColor(24));
      }
    }
  }
}

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

import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiPlugin;
import org.eclipse.linuxtools.oprofile.ui.model.UiModelRoot;

class OprofileView$2$1
  implements Runnable
{
  OprofileView$2$1(OprofileView.2 param2, UiModelRoot paramUiModelRoot) {}
  
  public void run()
  {
    OprofileView.access$0(OprofileUiPlugin.getDefault().getOprofileView()).setInput(val$UiRoot);
  }
}

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

import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.linuxtools.oprofile.core.model.OpModelRoot;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiMessages;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiPlugin;
import org.eclipse.linuxtools.oprofile.ui.model.UiModelRoot;
import org.eclipse.swt.widgets.Display;
import org.tizen.oprofile.core.OprofileComm;

class OprofileView$2
  implements IRunnableWithProgress
{
  OprofileView$2(OprofileView paramOprofileView) {}
  
  public void run(IProgressMonitor paramIProgressMonitor)
    throws InvocationTargetException, InterruptedException
  {
    paramIProgressMonitor.beginTask(OprofileUiMessages.getString("view.dialog.parsing.text"), 2);
    OpModelRoot localOpModelRoot = OprofileComm.getModelData();
    paramIProgressMonitor.worked(1);
    final UiModelRoot localUiModelRoot = new UiModelRoot();
    localUiModelRoot.refreshModel(localOpModelRoot);
    Display.getDefault().asyncExec(new Runnable()
    {
      public void run()
      {
        OprofileView.access$0(OprofileUiPlugin.getDefault().getOprofileView()).setInput(localUiModelRoot);
      }
    });
    paramIProgressMonitor.worked(1);
    paramIProgressMonitor.done();
  }
}

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

import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.linuxtools.oprofile.core.model.OpModelRoot;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiMessages;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiPlugin;
import org.eclipse.linuxtools.oprofile.ui.model.UiModelRoot;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.ui.part.ViewPart;
import org.tizen.oprofile.core.OprofileComm;
import org.tizen.oprofile.ui.view.OprofileViewLabelProvider;

public class OprofileView
  extends ViewPart
{
  private TreeViewer _viewer;
  private FormToolkit toolkit;
  
  public void createPartControl(Composite paramComposite)
  {
    Display localDisplay = paramComposite.getDisplay();
    toolkit = new FormToolkit(localDisplay);
    paramComposite.setLayout(new GridLayout(1, false));
    paramComposite.setBackground(localDisplay.getSystemColor(1));
    createTitle(paramComposite);
    createTreeViewer(paramComposite);
    OprofileUiPlugin.getDefault().setOprofileView(this);
  }
  
  private void createTitle(Composite paramComposite)
  {
    Section localSection = toolkit.createSection(paramComposite, 256);
    localSection.setText("Profiling Information");
    localSection.setLayoutData(new GridData(768));
    toolkit.createCompositeSeparator(localSection);
  }
  
  private void createTreeViewer(Composite paramComposite)
  {
    _viewer = new TreeViewer(paramComposite, 65796);
    Tree localTree = _viewer.getTree();
    localTree.setHeaderVisible(true);
    localTree.setLinesVisible(true);
    localTree.setLayoutData(new GridData(1808));
    String[] arrayOfString = { "Type", "Percent(%)", "Name" };
    int[] arrayOfInt = { 250, 100, 100 };
    final TreeColumn[] arrayOfTreeColumn = new TreeColumn[arrayOfString.length];
    for (int i = 0; i < arrayOfTreeColumn.length; i++)
    {
      arrayOfTreeColumn[i] = new TreeColumn(localTree, 16384);
      arrayOfTreeColumn[i].setText(arrayOfString[i]);
      arrayOfTreeColumn[i].setWidth(arrayOfInt[i]);
    }
    localTree.addListener(42, new Listener()
    {
      public void handleEvent(Event paramAnonymousEvent)
      {
        if (index == 1)
        {
          GC localGC = gc;
          String str = ((TreeItem)item).getText(1);
          int i = 0;
          if ((str != null) && (str.length() > 0) && (!str.startsWith("<"))) {
            i = (int)Double.parseDouble(str);
          }
          int j = arrayOfTreeColumn[1].getWidth() * i / 100;
          if (j > 5)
          {
            Display localDisplay = Display.getCurrent();
            localGC.setForeground(localDisplay.getSystemColor(5));
            localGC.setBackground(localDisplay.getSystemColor(14));
            localGC.fillGradientRectangle(x + 40, y, j - 5, height, true);
            Rectangle localRectangle = new Rectangle(x + 40, y, j - 5, height - 1);
            localGC.drawRectangle(localRectangle);
            localGC.setForeground(localDisplay.getSystemColor(24));
          }
        }
      }
    });
    _viewer.setContentProvider(new OprofileViewContentProvider());
    _viewer.setLabelProvider(new OprofileViewLabelProvider());
    _viewer.addDoubleClickListener(new OprofileViewDoubleClickListener());
    _viewer.setAutoExpandLevel(4);
    getSite().setSelectionProvider(_viewer);
  }
  
  private TreeViewer getTreeViewer()
  {
    return _viewer;
  }
  
  public void refreshView()
  {
    try
    {
      PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.linuxtools.oprofile.ui.OProfileView");
    }
    catch (PartInitException localPartInitException)
    {
      localPartInitException.printStackTrace();
    }
    IRunnableWithProgress local2 = new IRunnableWithProgress()
    {
      public void run(IProgressMonitor paramAnonymousIProgressMonitor)
        throws InvocationTargetException, InterruptedException
      {
        paramAnonymousIProgressMonitor.beginTask(OprofileUiMessages.getString("view.dialog.parsing.text"), 2);
        OpModelRoot localOpModelRoot = OprofileComm.getModelData();
        paramAnonymousIProgressMonitor.worked(1);
        final UiModelRoot localUiModelRoot = new UiModelRoot();
        localUiModelRoot.refreshModel(localOpModelRoot);
        Display.getDefault().asyncExec(new Runnable()
        {
          public void run()
          {
            OprofileUiPlugin.getDefault().getOprofileView().getTreeViewer().setInput(localUiModelRoot);
          }
        });
        paramAnonymousIProgressMonitor.worked(1);
        paramAnonymousIProgressMonitor.done();
      }
    };
    ProgressMonitorDialog localProgressMonitorDialog = new ProgressMonitorDialog(null);
    try
    {
      localProgressMonitorDialog.run(true, false, local2);
    }
    catch (InvocationTargetException localInvocationTargetException)
    {
      localInvocationTargetException.printStackTrace();
    }
    catch (InterruptedException localInterruptedException)
    {
      localInterruptedException.printStackTrace();
    }
  }
  
  public void setFocus() {}
}

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

import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.linuxtools.oprofile.ui.model.IUiModelElement;

public class OprofileViewContentProvider
  implements ITreeContentProvider
{
  public Object[] getChildren(Object paramObject)
  {
    Assert.isLegal(paramObject instanceof IUiModelElement, "in OprofileViewContentProvider");
    return ((IUiModelElement)paramObject).getChildren();
  }
  
  public Object getParent(Object paramObject)
  {
    Assert.isLegal(paramObject instanceof IUiModelElement, "in OprofileViewContentProvider");
    return ((IUiModelElement)paramObject).getParent();
  }
  
  public boolean hasChildren(Object paramObject)
  {
    Assert.isLegal(paramObject instanceof IUiModelElement, "in OprofileViewContentProvider");
    return ((IUiModelElement)paramObject).hasChildren();
  }
  
  public Object[] getElements(Object paramObject)
  {
    return getChildren(paramObject);
  }
  
  public void dispose() {}
  
  public void inputChanged(Viewer paramViewer, Object paramObject1, Object paramObject2) {}
}

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

import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.linuxtools.oprofile.ui.model.IUiModelElement;
import org.eclipse.linuxtools.oprofile.ui.model.UiModelSample;
import org.eclipse.linuxtools.oprofile.ui.model.UiModelSymbol;
import org.eclipse.linuxtools.profiling.ui.ProfileUIUtils;
import org.eclipse.ui.PartInitException;

public class OprofileViewDoubleClickListener
  implements IDoubleClickListener
{
  public void doubleClick(DoubleClickEvent paramDoubleClickEvent)
  {
    IUiModelElement localIUiModelElement = (IUiModelElement)((TreeSelection)((TreeViewer)paramDoubleClickEvent.getSource()).getSelection()).getFirstElement();
    if ((localIUiModelElement instanceof UiModelSample))
    {
      UiModelSample localUiModelSample = (UiModelSample)localIUiModelElement;
      int i = localUiModelSample.getLine();
      String str1 = ((UiModelSymbol)localUiModelSample.getParent()).getFileName();
      String str2 = str1;
      try
      {
        ProfileUIUtils.openEditorAndSelect(str2, i);
      }
      catch (PartInitException localPartInitException)
      {
        localPartInitException.printStackTrace();
      }
      catch (BadLocationException localBadLocationException)
      {
        localBadLocationException.printStackTrace();
      }
    }
  }
}

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

import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.linuxtools.oprofile.ui.model.IUiModelElement;
import org.eclipse.swt.graphics.Image;

public class OprofileViewLabelProvider
  implements ILabelProvider
{
  public Image getImage(Object paramObject)
  {
    Assert.isLegal(paramObject instanceof IUiModelElement, "in OprofileViewLabelProvider");
    return ((IUiModelElement)paramObject).getLabelImage();
  }
  
  public String getText(Object paramObject)
  {
    Assert.isLegal(paramObject instanceof IUiModelElement, "in OprofileViewLabelProvider");
    return ((IUiModelElement)paramObject).getLabelText();
  }
  
  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.ui.view.OprofileViewLabelProvider
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.oprofile.ui.view;

import java.lang.reflect.InvocationTargetException;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiMessages;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;

public class OprofileViewLogReaderAction
  extends Action
{
  public OprofileViewLogReaderAction()
  {
    super(OprofileUiMessages.getString("view.actions.logreader.label"));
  }
  
  public void run()
  {
    Shell localShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
    LogReader localLogReader = new LogReader();
    try
    {
      new ProgressMonitorDialog(localShell).run(true, false, localLogReader);
    }
    catch (InvocationTargetException localInvocationTargetException)
    {
      localInvocationTargetException.printStackTrace();
    }
    catch (InterruptedException localInterruptedException)
    {
      localInterruptedException.printStackTrace();
    }
    OprofiledLogDialog localOprofiledLogDialog = new OprofiledLogDialog(localShell, localLogReader.getLogContents());
    localOprofiledLogDialog.open();
  }
}

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

import org.eclipse.jface.action.Action;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiMessages;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiPlugin;

public class OprofileViewRefreshAction
  extends Action
{
  public OprofileViewRefreshAction()
  {
    super(OprofileUiMessages.getString("view.actions.refresh.label"));
  }
  
  public void run()
  {
    OprofileUiPlugin.getDefault().getOprofileView().refreshView();
  }
}

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

import java.io.File;
import java.text.MessageFormat;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.linuxtools.oprofile.core.Oprofile;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiMessages;

class OprofileViewSaveDefaultSessionAction$SaveSessionValidator
  implements IInputValidator
{
  private OprofileViewSaveDefaultSessionAction$SaveSessionValid
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