/**
* Run the long getValue() method test.
*/
- @SuppressWarnings("deprecation")
@Test
public void testGetValue() {
singleFixture.setValue(2.0);
import org.eclipse.linuxtools.ctf.core.event.types.IDefinitionScope;
import org.eclipse.linuxtools.ctf.core.event.types.IntegerDeclaration;
import org.eclipse.linuxtools.ctf.core.event.types.IntegerDefinition;
-import org.eclipse.linuxtools.ctf.core.event.types.StructDefinition;
import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
import org.eclipse.linuxtools.internal.ctf.core.event.io.BitBuffer;
import org.junit.After;
@Before
public void setUp() throws CTFReaderException {
- StructDefinition structDef = null;
- boolean found = false;
+// StructDefinition structDef = null;
+// boolean found = false;
IntegerDeclaration id = new IntegerDeclaration( 1, true, 1, ByteOrder.BIG_ENDIAN, Encoding.NONE, clockName, 8);
fixture = id.createDefinition(null, name);
}
private static final String TAG_ID = "a"; //$NON-NLS-1$
- private static final String INT_ID = "_id"; //$NON-NLS-1$
-
- private static final String STRING_ID = "_args"; //$NON-NLS-1$
-
- private static final String ENUM_ID = "_enumArgs"; //$NON-NLS-1$
-
- private static final String SEQUENCE_ID = "_seq"; //$NON-NLS-1$
+// private static final String INT_ID = "_id"; //$NON-NLS-1$
+//
+// private static final String STRING_ID = "_args"; //$NON-NLS-1$
+//
+// private static final String ENUM_ID = "_enumArgs"; //$NON-NLS-1$
+//
+// private static final String SEQUENCE_ID = "_seq"; //$NON-NLS-1$
private static final String LENGTH_SEQ = "_len"; //$NON-NLS-1$
- private static final String VAR_FIELD_NAME = "var";
+ private static final String VAR_FIELD_NAME = "var"; //$NON-NLS-1$
private static final String ENUM_8 = null;
/**
* Perform pre-test initialization.
class MetadataComparator implements Comparator<File>, Serializable {
+ private static final long serialVersionUID = 1L;
+
@Override
public int compare(File o1, File o2) {
return o1.getName().compareTo(o2.getName());
import org.antlr.runtime.tree.RewriteRuleTokenStream;
import org.antlr.runtime.tree.TreeAdaptor;
-@SuppressWarnings({ "nls", "unused", "unchecked", "rawtypes", "null" })
+@SuppressWarnings({ "nls", "unused", "unchecked", "rawtypes" })
public class CTFParser extends Parser {
public static final String[] tokenNames = new String[] { "<invalid>",
"<EOR>", "<DOWN>", "<UP>", "ALIGNTOK", "CONSTTOK", "CHARTOK",
LttngTimestamp safeTimestamp = null;
TmfTimeRange timeRange = null;
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({ "unchecked", "restriction" })
@Override
public void run() {
while (!fExecutor.isShutdown()) {
case TRAP_MODE:\r
retColor = trapStateToColor.get(stateMode);\r
break;\r
+\r
+ case PROPERTY:\r
+ case UNKNOWN:\r
+ break;\r
}\r
}\r
\r
package org.eclipse.linuxtools.tmf.core.tests;
-import org.eclipse.linuxtools.internal.tmf.core.TmfCorePlugin;
-
import junit.framework.TestCase;
+import org.eclipse.linuxtools.internal.tmf.core.Activator;
+
/**
* <b><u>TmfCorePluginTest</u></b>
* <p>
* Test the TMF core plug-in activator
*/
-@SuppressWarnings("nls")
+@SuppressWarnings({ "nls", "restriction" })
public class TmfCorePluginTest extends TestCase {
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
// Plug-in instantiation
- static final TmfCorePlugin fPlugin = new TmfCorePlugin();
+ static final Activator fPlugin = new Activator();
// ------------------------------------------------------------------------
// Housekeping
// ------------------------------------------------------------------------
public void testTmfCorePluginId() throws Exception {
- assertEquals("Plugin ID", "org.eclipse.linuxtools.tmf.core", TmfCorePlugin.PLUGIN_ID);
+ assertEquals("Plugin ID", "org.eclipse.linuxtools.tmf.core", Activator.PLUGIN_ID);
}
public void testGetDefault() throws Exception {
- TmfCorePlugin plugin = TmfCorePlugin.getDefault();
+ Activator plugin = Activator.getDefault();
assertEquals("getDefault()", plugin, fPlugin);
}
* <p>
* The activator class controls the plug-in life cycle
*/
-@SuppressWarnings("nls")
+@SuppressWarnings({ "nls", "restriction" })
public class TmfCoreTestPlugin extends Plugin {
// ------------------------------------------------------------------------
import junit.framework.TestCase;
+import org.eclipse.linuxtools.internal.tmf.core.component.TmfProviderManager;
import org.eclipse.linuxtools.tmf.core.component.ITmfDataProvider;
-import org.eclipse.linuxtools.tmf.core.component.TmfProviderManager;
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
* <p>
* Test suite for the TmfEventProvider class.
*/
-@SuppressWarnings("nls")
+@SuppressWarnings({ "nls", "restriction" })
public class TmfEventProviderTest extends TestCase {
TmfEventProviderStub fEventProvider;
import junit.framework.TestCase;
+import org.eclipse.linuxtools.internal.tmf.core.component.TmfProviderManager;
import org.eclipse.linuxtools.tmf.core.component.TmfDataProvider;
-import org.eclipse.linuxtools.tmf.core.component.TmfProviderManager;
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest;
import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
* <p>
* Test suite for the TmfProviderManager class.
*/
-@SuppressWarnings("nls")
+@SuppressWarnings({ "nls", "restriction" })
public class TmfProviderManagerTest extends TestCase {
public TmfProviderManagerTest(String name) {
package org.eclipse.linuxtools.tmf.core.tests.ctfadaptor;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfContent;
import org.eclipse.linuxtools.tmf.core.event.ITmfEventField;
-import org.junit.*;
-import static org.junit.Assert.*;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
/**
* The class <code>CtfTmfContentTest</code> contains tests for the class <code>{@link CtfTmfContent}</code>.
@Test
public void testCtfTmfContent_1()
throws Exception {
- String name = "";
+ String name = ""; //$NON-NLS-1$
ITmfEventField[] fields = new ITmfEventField[] {};
CtfTmfContent result = new CtfTmfContent(name, fields);
// add additional test code here
assertNotNull(result);
- assertEquals("", result.toString());
- assertEquals("", result.getName());
+ assertEquals("", result.toString()); //$NON-NLS-1$
+ assertEquals("", result.getName()); //$NON-NLS-1$
assertEquals(null, result.getValue());
}
@Test
public void testToString_1()
throws Exception {
- CtfTmfContent fixture = new CtfTmfContent("", new ITmfEventField[] {});
+ CtfTmfContent fixture = new CtfTmfContent("", new ITmfEventField[] {}); //$NON-NLS-1$
String result = fixture.toString();
// add additional test code here
- assertEquals("", result);
+ assertEquals("", result); //$NON-NLS-1$
}
/**
@Test
public void testToString_2()
throws Exception {
- CtfTmfContent fixture = new CtfTmfContent("", new ITmfEventField[] {});
+ CtfTmfContent fixture = new CtfTmfContent("", new ITmfEventField[] {}); //$NON-NLS-1$
String result = fixture.toString();
// add additional test code here
- assertEquals("", result);
+ assertEquals("", result); //$NON-NLS-1$
}
/**
*/
@Test
public void testCtfTmfEventType_1() {
- String contextId = ""; //$NON-NLS-1$
+// String contextId = ""; //$NON-NLS-1$
String eventName = ""; //$NON-NLS-1$
ITmfEventField content = new TmfEventField("", new ITmfEventField[] {}); //$NON-NLS-1$
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.linuxtools.internal.tmf.core.request.TmfCoalescedEventRequest;
import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfLocation;
import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent;
import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTimestamp;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest;
-import org.eclipse.linuxtools.tmf.core.request.TmfCoalescedEventRequest;
import org.eclipse.linuxtools.tmf.core.signal.TmfEndSynchSignal;
import org.eclipse.linuxtools.tmf.core.signal.TmfSignal;
import org.eclipse.linuxtools.tmf.core.statesystem.IStateSystemQuerier;
* @author ematkho
* @version $Revision: 1.0 $
*/
+@SuppressWarnings("restriction")
public class CtfTmfTraceTest {
private static final String PATH = TestParams.getPath();
public void testArmRequest_1()
throws Exception {
CtfTmfTrace fixture = initTrace();
+ @SuppressWarnings({ "rawtypes", "unchecked" })
ITmfDataRequest<CtfTmfEvent> request = new TmfCoalescedEventRequest(ITmfEvent.class);
ITmfContext result = fixture.armRequest(request);
public void testArmRequest_2()
throws Exception {
CtfTmfTrace fixture = initTrace();
+ @SuppressWarnings({ "rawtypes", "unchecked" })
ITmfDataRequest<CtfTmfEvent> request = new TmfCoalescedEventRequest(ITmfEvent.class);
ITmfContext result = fixture.armRequest(request);
public void testArmRequest_3()
throws Exception {
CtfTmfTrace fixture = initTrace();
+ @SuppressWarnings({ "rawtypes", "unchecked" })
ITmfDataRequest<CtfTmfEvent> request = new TmfCoalescedEventRequest(ITmfEvent.class);
ITmfContext result = fixture.armRequest(request);
public void testArmRequest_4()
throws Exception {
CtfTmfTrace fixture = initTrace();
+ @SuppressWarnings({ "rawtypes", "unchecked" })
ITmfDataRequest<CtfTmfEvent> request = new TmfCoalescedEventRequest(ITmfEvent.class);
ITmfContext result = fixture.armRequest(request);
*******************************************************************************/
package org.eclipse.linuxtools.tmf.core.tests.ctfadaptor.headless;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
import java.util.Vector;
import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfIterator;
}
- /**
- * @param timestamp
- * the timestamp in UTC to convert to nanoseconds.
- * @return formatted string.
- */
- private static String formatDate(final long timestamp) {
- final Date d = new Date(timestamp / 1000000);
- final DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss."); //$NON-NLS-1$
- final String output = df.format(d) + (timestamp % 1000000000);
- return output;
- }
+// /**
+// * @param timestamp
+// * the timestamp in UTC to convert to nanoseconds.
+// * @return formatted string.
+// */
+// private static String formatDate(final long timestamp) {
+// final Date d = new Date(timestamp / 1000000);
+// final DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss."); //$NON-NLS-1$
+// final String output = df.format(d) + (timestamp % 1000000000);
+// return output;
+// }
}
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.eclipse.linuxtools.internal.tmf.core.TmfCorePlugin;
+import org.eclipse.linuxtools.internal.tmf.core.Activator;
/**
* Test suite for org.eclipse.linuxtools.tmf.core.event
*/
-@SuppressWarnings("nls")
+@SuppressWarnings({ "nls", "restriction" })
public class AllTests {
public static Test suite() {
- final TestSuite suite = new TestSuite("Test suite for " + TmfCorePlugin.PLUGIN_ID + ".event"); //$NON-NLS-1$;
+ final TestSuite suite = new TestSuite("Test suite for " + Activator.PLUGIN_ID + ".event"); //$NON-NLS-1$;
//$JUnit-BEGIN$
suite.addTestSuite(TmfTimestampTest.class);
suite.addTestSuite(TmfSimpleTimestampTest.class);
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.eclipse.linuxtools.internal.tmf.core.TmfCorePlugin;
+import org.eclipse.linuxtools.internal.tmf.core.Activator;
-@SuppressWarnings("nls")
+@SuppressWarnings({ "nls", "restriction" })
public class AllTests {
public static Test suite() {
- TestSuite suite = new TestSuite("Test suite for " + TmfCorePlugin.PLUGIN_ID + ".request"); //$NON-NLS-1$);
+ TestSuite suite = new TestSuite("Test suite for " + Activator.PLUGIN_ID + ".request"); //$NON-NLS-1$);
//$JUnit-BEGIN$
suite.addTestSuite(TmfDataRequestTest.class);
suite.addTestSuite(TmfEventRequestTest.class);
import junit.framework.TestCase;
+import org.eclipse.linuxtools.internal.tmf.core.request.TmfCoalescedDataRequest;
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
-import org.eclipse.linuxtools.tmf.core.request.TmfCoalescedDataRequest;
import org.eclipse.linuxtools.tmf.core.request.TmfDataRequest;
import org.eclipse.linuxtools.tmf.tests.stubs.request.TmfDataRequestStub;
* <p>
* Test suite for the TmfCoalescedDataRequest class.
*/
-@SuppressWarnings("nls")
+@SuppressWarnings({ "nls", "restriction" })
public class TmfCoalescedDataRequestTest extends TestCase {
// ------------------------------------------------------------------------
super(name);
}
- @Override
+ @Override
public void setUp() throws Exception {
super.setUp();
TmfDataRequest.reset();
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
+import org.eclipse.linuxtools.internal.tmf.core.component.TmfProviderManager;
+import org.eclipse.linuxtools.internal.tmf.core.request.TmfCoalescedDataRequest;
+import org.eclipse.linuxtools.internal.tmf.core.request.TmfCoalescedEventRequest;
import org.eclipse.linuxtools.tmf.core.component.ITmfDataProvider;
-import org.eclipse.linuxtools.tmf.core.component.TmfProviderManager;
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest.ExecutionType;
-import org.eclipse.linuxtools.tmf.core.request.TmfCoalescedDataRequest;
-import org.eclipse.linuxtools.tmf.core.request.TmfCoalescedEventRequest;
import org.eclipse.linuxtools.tmf.core.request.TmfEventRequest;
import org.eclipse.linuxtools.tmf.core.signal.TmfSignal;
import org.eclipse.linuxtools.tmf.core.signal.TmfSignalHandler;
* <p>
* Test suite for the TmfCoalescedEventRequest class.
*/
-@SuppressWarnings("nls")
+@SuppressWarnings({ "nls", "restriction" })
public class TmfCoalescedEventRequestTest extends TestCase {
// ------------------------------------------------------------------------
import junit.framework.TestCase;
-import org.eclipse.linuxtools.tmf.core.request.TmfRequestExecutor;
+import org.eclipse.linuxtools.internal.tmf.core.request.TmfRequestExecutor;
/**
* <b><u>TmfRequestExecutorTest</u></b>
*
* Test suite for the TmfRequestExecutor class.
*/
-@SuppressWarnings("nls")
+@SuppressWarnings({ "nls", "restriction" })
public class TmfRequestExecutorTest extends TestCase {
// ------------------------------------------------------------------------
// ------------------------------------------------------------------------
/**
- * Test method for {@link org.eclipse.linuxtools.tmf.core.request.TmfRequestExecutor#TmfRequestExecutor()}.
+ * Test method for {@link org.eclipse.linuxtools.internal.tmf.core.request.TmfRequestExecutor#TmfRequestExecutor()}.
*/
public void testTmfRequestExecutor() {
TmfRequestExecutor executor = new TmfRequestExecutor();
}
/**
- * Test method for {@link org.eclipse.linuxtools.tmf.core.request.TmfRequestExecutor#TmfRequestExecutor(java.util.concurrent.ExecutorService)}.
+ * Test method for {@link org.eclipse.linuxtools.internal.tmf.core.request.TmfRequestExecutor#TmfRequestExecutor(java.util.concurrent.ExecutorService)}.
*/
public void testTmfRequestExecutorExecutorService() {
TmfRequestExecutor executor = new TmfRequestExecutor(Executors.newCachedThreadPool());
}
/**
- * Test method for {@link org.eclipse.linuxtools.tmf.core.request.TmfRequestExecutor#stop()}.
+ * Test method for {@link org.eclipse.linuxtools.internal.tmf.core.request.TmfRequestExecutor#stop()}.
*/
public void testStop() {
TmfRequestExecutor executor = new TmfRequestExecutor();
// ------------------------------------------------------------------------
/**
- * Test method for {@link org.eclipse.linuxtools.tmf.core.request.TmfRequestExecutor#execute(java.lang.Runnable)}.
+ * Test method for {@link org.eclipse.linuxtools.internal.tmf.core.request.TmfRequestExecutor#execute(java.lang.Runnable)}.
*/
public void testExecute() {
// fail("Not yet implemented");
// ------------------------------------------------------------------------
/**
- * Test method for {@link org.eclipse.linuxtools.tmf.core.request.TmfRequestExecutor#toString()}.
+ * Test method for {@link org.eclipse.linuxtools.internal.tmf.core.request.TmfRequestExecutor#toString()}.
*/
public void testToString() {
// TmfRequestExecutor executor1 = new TmfRequestExecutor();
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.eclipse.linuxtools.internal.tmf.core.TmfCorePlugin;
+import org.eclipse.linuxtools.internal.tmf.core.Activator;
/**
* Test suite for org.eclipse.linuxtools.tmf.core.trace
*/
-@SuppressWarnings("nls")
+@SuppressWarnings({ "nls", "restriction" })
public class AllTests {
public static Test suite() {
- TestSuite suite = new TestSuite("Test suite for " + TmfCorePlugin.PLUGIN_ID + ".trace"); //$NON-NLS-1$);
+ TestSuite suite = new TestSuite("Test suite for " + Activator.PLUGIN_ID + ".trace"); //$NON-NLS-1$);
//$JUnit-BEGIN$
suite.addTestSuite(TmfLocationTest.class);
suite.addTestSuite(TmfContextTest.class);
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
+import org.eclipse.linuxtools.internal.tmf.core.component.TmfProviderManager;
import org.eclipse.linuxtools.tmf.core.component.ITmfDataProvider;
-import org.eclipse.linuxtools.tmf.core.component.TmfProviderManager;
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
/**
* Test suite for the TmfTrace class.
*/
-@SuppressWarnings("nls")
+@SuppressWarnings({ "nls", "restriction" })
public class TmfTraceTest extends TestCase {
// ------------------------------------------------------------------------
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.eclipse.linuxtools.internal.tmf.core.TmfCorePlugin;
+import org.eclipse.linuxtools.internal.tmf.core.Activator;
-@SuppressWarnings("nls")
+@SuppressWarnings({ "nls", "restriction" })
public class AllTests {
public static Test suite() {
- TestSuite suite = new TestSuite("Test suite for " + TmfCorePlugin.PLUGIN_ID + ".uml2sd"); //$NON-NLS-1$);
+ TestSuite suite = new TestSuite("Test suite for " + Activator.PLUGIN_ID + ".uml2sd"); //$NON-NLS-1$);
//$JUnit-BEGIN$
suite.addTestSuite(TmfSyncSequenceDiagramEventTest.class);
suite.addTestSuite(TmfAsyncSequenceDiagramEventTest.class);
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.eclipse.linuxtools.internal.tmf.core.TmfCorePlugin;
+import org.eclipse.linuxtools.internal.tmf.core.Activator;
-@SuppressWarnings("nls")
+@SuppressWarnings({ "nls", "restriction" })
public class AllTests {
public static Test suite() {
- TestSuite suite = new TestSuite("Test suite for " + TmfCorePlugin.PLUGIN_ID + ".util"); //$NON-NLS-1$);
+ TestSuite suite = new TestSuite("Test suite for " + Activator.PLUGIN_ID + ".util"); //$NON-NLS-1$);
//$JUnit-BEGIN$
suite.addTestSuite(TmfFixedArrayTest.class);
//$JUnit-END$
package org.eclipse.linuxtools.tmf.tests.stubs.component;
+import org.eclipse.linuxtools.internal.tmf.core.component.TmfProviderManager;
import org.eclipse.linuxtools.tmf.core.component.TmfComponent;
import org.eclipse.linuxtools.tmf.core.component.TmfDataProvider;
-import org.eclipse.linuxtools.tmf.core.component.TmfProviderManager;
import org.eclipse.linuxtools.tmf.tests.stubs.event.TmfSyntheticEventStub;
/**
* <p>
* TODO: Implement me. Please.
*/
-@SuppressWarnings("nls")
+@SuppressWarnings({ "nls", "restriction" })
public class TmfClientStub extends TmfComponent {
private TmfDataProvider<TmfSyntheticEventStub>[] fProviders;
import java.util.concurrent.TimeUnit;
+import org.eclipse.linuxtools.internal.tmf.core.component.TmfProviderManager;
import org.eclipse.linuxtools.tmf.core.component.ITmfDataProvider;
import org.eclipse.linuxtools.tmf.core.component.TmfEventProvider;
-import org.eclipse.linuxtools.tmf.core.component.TmfProviderManager;
import org.eclipse.linuxtools.tmf.core.event.TmfEvent;
import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest;
* <p>
* TODO: Implement me. Please.
*/
-@SuppressWarnings("nls")
+@SuppressWarnings({ "nls", "restriction" })
public class TmfSyntheticEventProviderStub extends TmfEventProvider<TmfSyntheticEventStub> {
public static final int BLOCK_SIZE = 100;
Bundle-Version: 0.5.0.qualifier
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.linuxtools.tmf.core;singleton:=true
-Bundle-Activator: org.eclipse.linuxtools.internal.tmf.core.TmfCorePlugin
+Bundle-Activator: org.eclipse.linuxtools.internal.tmf.core.Activator
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
org.eclipse.linuxtools.ctf.core;bundle-version="0.1.0",
org.eclipse.core.filesystem;bundle-version="1.3.100"
Export-Package: org.eclipse.linuxtools.internal.tmf.core;x-internal:=true,
+ org.eclipse.linuxtools.internal.tmf.core.component;x-internal:=true,
+ org.eclipse.linuxtools.internal.tmf.core.request;x-internal:=true,
org.eclipse.linuxtools.internal.tmf.core.statesystem;x-internal:=true,
org.eclipse.linuxtools.internal.tmf.core.trace;x-internal:=true,
org.eclipse.linuxtools.tmf.core,
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2009, 2010, 2011 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Francois Chouinard - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.tmf.core;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+import org.osgi.framework.BundleContext;
+
+/**
+ * <b><u>TmfCorePlugin</u></b>
+ * <p>
+ * The activator class controls the plug-in life cycle. No more than one such
+ * plug-in can exist at any time.
+ */
+public class Activator extends Plugin {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ /**
+ * The plug-in ID
+ */
+ public static final String PLUGIN_ID = "org.eclipse.linuxtools.tmf.core"; //$NON-NLS-1$
+
+ /**
+ * The shared instance
+ */
+ private static Activator fPlugin;
+
+ // ------------------------------------------------------------------------
+ // Constructors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Constructor
+ */
+ public Activator() {
+ setDefault(this);
+ }
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns the TMF UI plug-in instance.
+ *
+ * @return the TMF UI plug-in instance.
+ */
+ public static Activator getDefault() {
+ return fPlugin;
+ }
+
+ // Sets plug-in instance
+ private static void setDefault(Activator plugin) {
+ fPlugin = plugin;
+ }
+
+ // ------------------------------------------------------------------------
+ // Plugin
+ // ------------------------------------------------------------------------
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ setDefault(this);
+ Tracer.init();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ Tracer.stop();
+ setDefault(null);
+ super.stop(context);
+ }
+
+ /**
+ * Logs a message with severity INFO in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ */
+ public void logInfo(String message) {
+ getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message));
+ }
+
+ /**
+ * Logs a message and exception with severity INFO in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ * @param exception A exception to log
+ */
+ public void logInfo(String message, Throwable exception) {
+ getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message, exception));
+ }
+
+ /**
+ * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ */
+ public void logWarning(String message) {
+ getLog().log(new Status(IStatus.WARNING, PLUGIN_ID, message));
+ }
+
+ /**
+ * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ * @param exception A exception to log
+ */
+ public void logWarning(String message, Throwable exception) {
+ getLog().log(new Status(IStatus.WARNING, PLUGIN_ID, message, exception));
+ }
+
+ /**
+ * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ */
+ public void logError(String message) {
+ getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message));
+ }
+
+ /**
+ * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ * @param exception A exception to log
+ */
+ public void logError(String message, Throwable exception) {
+ getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, exception));
+ }
+
+}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2009, 2010, 2011 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Francois Chouinard - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.internal.tmf.core;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.BundleContext;
-
-/**
- * <b><u>TmfCorePlugin</u></b>
- * <p>
- * The activator class controls the plug-in life cycle. No more than one such
- * plug-in can exist at any time.
- */
-public class TmfCorePlugin extends Plugin {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
-
- /**
- * The plug-in ID
- */
- public static final String PLUGIN_ID = "org.eclipse.linuxtools.tmf.core"; //$NON-NLS-1$
-
- /**
- * The shared instance
- */
- private static TmfCorePlugin fPlugin;
-
- // ------------------------------------------------------------------------
- // Constructors
- // ------------------------------------------------------------------------
-
- /**
- * Constructor
- */
- public TmfCorePlugin() {
- setDefault(this);
- }
-
- // ------------------------------------------------------------------------
- // Accessors
- // ------------------------------------------------------------------------
-
- /**
- * Returns the TMF UI plug-in instance.
- *
- * @return the TMF UI plug-in instance.
- */
- public static TmfCorePlugin getDefault() {
- return fPlugin;
- }
-
- // Sets plug-in instance
- private static void setDefault(TmfCorePlugin plugin) {
- fPlugin = plugin;
- }
-
- // ------------------------------------------------------------------------
- // Plugin
- // ------------------------------------------------------------------------
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- setDefault(this);
- Tracer.init();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- Tracer.stop();
- setDefault(null);
- super.stop(context);
- }
-
- /**
- * Logs a message with severity INFO in the runtime log of the plug-in.
- *
- * @param message A message to log
- */
- public void logInfo(String message) {
- getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message));
- }
-
- /**
- * Logs a message and exception with severity INFO in the runtime log of the plug-in.
- *
- * @param message A message to log
- * @param exception A exception to log
- */
- public void logInfo(String message, Throwable exception) {
- getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message, exception));
- }
-
- /**
- * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
- *
- * @param message A message to log
- */
- public void logWarning(String message) {
- getLog().log(new Status(IStatus.WARNING, PLUGIN_ID, message));
- }
-
- /**
- * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
- *
- * @param message A message to log
- * @param exception A exception to log
- */
- public void logWarning(String message, Throwable exception) {
- getLog().log(new Status(IStatus.WARNING, PLUGIN_ID, message, exception));
- }
-
- /**
- * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
- *
- * @param message A message to log
- */
- public void logError(String message) {
- getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message));
- }
-
- /**
- * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
- *
- * @param message A message to log
- * @param exception A exception to log
- */
- public void logError(String message, Throwable exception) {
- getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, exception));
- }
-
-}
@SuppressWarnings("nls")\r
public class Tracer {\r
\r
- private static String pluginID = TmfCorePlugin.PLUGIN_ID;\r
+ private static String pluginID = Activator.PLUGIN_ID;\r
\r
static Boolean ERROR = Boolean.FALSE;\r
static Boolean WARNING = Boolean.FALSE;\r
try {\r
outfile = new BufferedWriter(new FileWriter(filename));\r
} catch (IOException e) {\r
- TmfCorePlugin.getDefault().logError("Error opening log file " + filename, e);\r
+ Activator.getDefault().logError("Error opening log file " + filename, e);\r
}\r
return outfile;\r
}\r
fTraceLog.close();\r
fTraceLog = null;\r
} catch (IOException e) {\r
- TmfCorePlugin.getDefault().logError("Error closing log file", e);\r
+ Activator.getDefault().logError("Error closing log file", e);\r
}\r
}\r
\r
fTraceLog.newLine();\r
fTraceLog.flush();\r
} catch (IOException e) {\r
- TmfCorePlugin.getDefault().logError("Error writing to log file", e);\r
+ Activator.getDefault().logError("Error writing to log file", e);\r
}\r
}\r
}\r
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Francois Chouinard - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.tmf.core.component;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.linuxtools.tmf.core.component.TmfDataProvider;
+import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
+
+/**
+ * Singleton that keeps track of the event providers.
+ *
+ * @version 1.0
+ * @author Francois Chouinard
+ */
+public class TmfProviderManager {
+
+ // ------------------------------------------------------------------------
+ // No constructor
+ // ------------------------------------------------------------------------
+
+ private TmfProviderManager() {}
+
+ // ------------------------------------------------------------------------
+ // Keeps track of the providers for each event type
+ // ------------------------------------------------------------------------
+
+ private static Map<Class<? extends ITmfEvent>, List<TmfDataProvider<? extends ITmfEvent>>> fProviders =
+ new HashMap<Class<? extends ITmfEvent>, List<TmfDataProvider<? extends ITmfEvent>>>();
+
+ /**
+ * Registers [provider] as a provider of [eventType]
+ *
+ * @param eventType
+ * @param provider
+ */
+ public static <T extends ITmfEvent> void register(Class<T> eventType, TmfDataProvider<? extends ITmfEvent> provider) {
+ if (fProviders.get(eventType) == null)
+ fProviders.put(eventType, new ArrayList<TmfDataProvider<? extends ITmfEvent>>());
+ fProviders.get(eventType).add(provider);
+ }
+
+ /**
+ * Re-registers [provider] as a provider of [eventType]
+ *
+ * @param eventType
+ * @param provider
+ */
+ public static <T extends ITmfEvent> void deregister(Class<T> eventType, TmfDataProvider<? extends ITmfEvent> provider) {
+ List<TmfDataProvider<? extends ITmfEvent>> list = fProviders.get(eventType);
+ if (list != null) {
+ list.remove(provider);
+ if (list.size() == 0)
+ fProviders.remove(eventType);
+ }
+ }
+
+ /**
+ * Returns the list of components that provide [eventType]
+ *
+ * @param eventType
+ * @return the list of components that provide [eventType]
+ */
+ @SuppressWarnings("unchecked")
+ public static TmfDataProvider<? extends ITmfEvent>[] getProviders(Class<? extends ITmfEvent> eventType) {
+ List<TmfDataProvider<? extends ITmfEvent>> list = fProviders.get(eventType);
+ if (list == null)
+ list = new ArrayList<TmfDataProvider<? extends ITmfEvent>>();
+ TmfDataProvider<? extends ITmfEvent>[] result = new TmfDataProvider[list.size()];
+ return list.toArray(result);
+ }
+
+ /**
+ * Returns the list of components of type [providerType] that provide [eventType]
+ *
+ * @param eventType
+ * @param providerType
+ * @return the list of components of type [providerType] that provide [eventType]
+ */
+ @SuppressWarnings("unchecked")
+ public static TmfDataProvider<? extends ITmfEvent>[] getProviders(Class<? extends ITmfEvent> eventType, Class<? extends TmfDataProvider<? extends ITmfEvent>> providerType) {
+ if (providerType == null) {
+ return getProviders(eventType);
+ }
+ TmfDataProvider<? extends ITmfEvent>[] list = getProviders(eventType);
+ List<TmfDataProvider<? extends ITmfEvent>> result = new ArrayList<TmfDataProvider<? extends ITmfEvent>>();
+ if (list != null) {
+ for (TmfDataProvider<? extends ITmfEvent> provider : list) {
+ if (provider.getClass() == providerType) {
+ result.add(provider);
+ }
+ }
+ }
+ TmfDataProvider<? extends ITmfEvent>[] array = new TmfDataProvider[result.size()];
+ return result.toArray(array);
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2010 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Francois Chouinard - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.tmf.core.component;
+
+import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest.ExecutionType;
+
+/**
+ * Utility class to add an execution class to a simple Java thread
+ *
+ * @version 1.0
+ * @author Francois Chouinard
+ */
+public class TmfThread extends Thread {
+
+ private final ExecutionType fExecType;
+
+ public TmfThread(ExecutionType execType) {
+ fExecType = execType;
+ }
+
+ public ExecutionType getExecType() {
+ return fExecType;
+ }
+
+ public void cancel() {
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Francois Chouinard - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.tmf.core.request;
+
+import java.util.Vector;
+
+import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
+import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest;
+import org.eclipse.linuxtools.tmf.core.request.TmfDataRequest;
+
+/**
+ * The TMF coalesced data request
+ *
+ * @version 1.0
+ * @author Francois Chouinard
+ */
+public class TmfCoalescedDataRequest<T extends ITmfEvent> extends TmfDataRequest<T> {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ /**
+ * The list of coalesced requests
+ */
+ protected Vector<ITmfDataRequest<T>> fRequests = new Vector<ITmfDataRequest<T>>();
+
+ // ------------------------------------------------------------------------
+ // Constructor
+ // ------------------------------------------------------------------------
+
+ /**
+ * Request all the events of a given type (high priority)
+ * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
+ *
+ * @param dataType the requested data type
+ */
+ public TmfCoalescedDataRequest(Class<T> dataType) {
+ this(dataType, 0, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
+ }
+
+ /**
+ * Request all the events of a given type (given priority)
+ * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
+ *
+ * @param dataType the requested data type
+ * @param priority the requested execution priority
+ */
+ public TmfCoalescedDataRequest(Class<T> dataType, ExecutionType priority) {
+ this(dataType, 0, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
+ }
+
+ /**
+ * Request all the events of a given type from the given index (high priority)
+ * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
+ *
+ * @param dataType the requested data type
+ * @param index the index of the first event to retrieve
+ */
+ public TmfCoalescedDataRequest(Class<T> dataType, long index) {
+ this(dataType, index, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
+ }
+
+ /**
+ * Request all the events of a given type from the given index (given priority)
+ * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
+ *
+ * @param dataType the requested data type
+ * @param index the index of the first event to retrieve
+ * @param priority the requested execution priority
+ */
+ public TmfCoalescedDataRequest(Class<T> dataType, long index, ExecutionType priority) {
+ this(dataType, index, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
+ }
+
+ /**
+ * Request 'n' events of a given type from the given index (high priority)
+ * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
+ *
+ * @param dataType the requested data type
+ * @param index the index of the first event to retrieve
+ * @param nbRequested the number of events requested
+ */
+ public TmfCoalescedDataRequest(Class<T> dataType, long index, int nbRequested) {
+ this(dataType, index, nbRequested, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
+ }
+
+ /**
+ * Request 'n' events of a given type from the given index (given priority)
+ * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
+ *
+ * @param dataType the requested data type
+ * @param index the index of the first event to retrieve
+ * @param nbRequested the number of events requested
+ * @param priority the requested execution priority
+ */
+ public TmfCoalescedDataRequest(Class<T> dataType, long index, int nbRequested, ExecutionType priority) {
+ this(dataType, index, nbRequested, DEFAULT_BLOCK_SIZE, priority);
+ }
+
+ /**
+ * Request 'n' events of a given type from the given index (high priority).
+ * Events are returned in blocks of the given size.
+ *
+ * @param dataType the requested data type
+ * @param index the index of the first event to retrieve
+ * @param nbRequested the number of events requested
+ * @param blockSize the number of events per block
+ */
+ public TmfCoalescedDataRequest(Class<T> dataType, long index, int nbRequested, int blockSize) {
+ super(dataType, index, nbRequested, blockSize, ExecutionType.FOREGROUND);
+ }
+
+ /**
+ * Request 'n' events of a given type from the given index (given priority).
+ * Events are returned in blocks of the given size.
+ *
+ * @param dataType the requested data type
+ * @param index the index of the first event to retrieve
+ * @param nbRequested the number of events requested
+ * @param blockSize the number of events per block
+ * @param priority the requested execution priority
+ */
+ public TmfCoalescedDataRequest(Class<T> dataType, long index, int nbRequested, int blockSize, ExecutionType priority) {
+ super(dataType, index, nbRequested, blockSize, priority);
+ }
+
+ // ------------------------------------------------------------------------
+ // Management
+ // ------------------------------------------------------------------------
+
+ public void addRequest(ITmfDataRequest<T> request) {
+ fRequests.add(request);
+ merge(request);
+ }
+
+ public boolean isCompatible(ITmfDataRequest<T> request) {
+ if (request.getExecType() == getExecType()) {
+ return overlaps(request);
+ }
+ return false;
+ }
+
+ private boolean overlaps(ITmfDataRequest<T> request) {
+ long start = request.getIndex();
+ long end = start + request.getNbRequested();
+
+ // Return true if either the start or end index falls within
+ // the coalesced request boundaries
+ return (start <= (fIndex + fNbRequested + 1) && (end >= fIndex - 1));
+ }
+
+ private void merge(ITmfDataRequest<T> request) {
+ long start = request.getIndex();
+ long end = Math.min(start + request.getNbRequested(), TmfDataRequest.ALL_DATA);
+
+ if (start < fIndex) {
+ if (fNbRequested != TmfDataRequest.ALL_DATA) {
+ fNbRequested += (fIndex - start);
+ }
+ fIndex = start;
+ }
+ if ((request.getNbRequested() == TmfDataRequest.ALL_DATA) ||
+ (fNbRequested == TmfDataRequest.ALL_DATA))
+ {
+ fNbRequested = TmfDataRequest.ALL_DATA;
+ } else {
+ fNbRequested = (int) Math.max(end - fIndex, fNbRequested);
+ }
+ }
+
+ @SuppressWarnings("nls")
+ public String getSubRequestIds() {
+ StringBuffer result = new StringBuffer("[");
+ for (int i = 0; i < fRequests.size(); i++) {
+ if (i != 0) result.append(", ");
+ result.append(fRequests.get(i).getRequestId());
+ }
+ result.append("]");
+ return result.toString();
+ }
+
+ // ------------------------------------------------------------------------
+ // ITmfDataRequest
+ // ------------------------------------------------------------------------
+
+ @Override
+ public void handleData(T data) {
+ super.handleData(data);
+ // Don't call sub-requests handleData() unless this is a
+ // TmfCoalescedDataRequest; extended classes should call
+ // the sub-requests handleData().
+ if (getClass() == TmfCoalescedDataRequest.class) {
+ long index = getNbRead();
+ for (ITmfDataRequest<T> request : fRequests) {
+ if (!request.isCompleted()) {
+ if (request.getDataType().isInstance(data)) {
+ long start = request.getIndex();
+ long end = start + request.getNbRequested() - 1;
+ if (index >= start && index < end) {
+ request.handleData(data);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void start() {
+ for (ITmfDataRequest<T> request : fRequests) {
+ if (!request.isCompleted()) {
+ request.start();
+ }
+ }
+ super.start();
+ }
+
+ @Override
+ public void done() {
+ for (ITmfDataRequest<T> request : fRequests) {
+ if (!request.isCompleted()) {
+ request.done();
+ }
+ }
+ super.done();
+ }
+
+ @Override
+ public void fail() {
+ for (ITmfDataRequest<T> request : fRequests) {
+ request.fail();
+ }
+ super.fail();
+ }
+
+ @Override
+ public void cancel() {
+ for (ITmfDataRequest<T> request : fRequests) {
+ if (!request.isCompleted()) {
+ request.cancel();
+ }
+ }
+ super.cancel();
+ }
+
+ @Override
+ public boolean isCompleted() {
+ // Firstly, check if coalescing request is completed
+ if (super.isCompleted()) {
+ return true;
+ }
+
+ // Secondly, check if all sub-requests are finished
+ if (fRequests.size() > 0) {
+ // If all sub requests are completed the coalesced request is
+ // treated as completed, too.
+ for (ITmfDataRequest<T> request : fRequests) {
+ if (!request.isCompleted()) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ // Coalescing request is not finished if there are no sub-requests
+ return false;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ // Firstly, check if coalescing request is canceled
+ if (super.isCancelled()) {
+ return true;
+ }
+
+ // Secondly, check if all sub-requests are canceled
+ if (fRequests.size() > 0) {
+ // If all sub requests are canceled the coalesced request is
+ // treated as completed, too.
+ for (ITmfDataRequest<T> request : fRequests) {
+ if (!request.isCancelled()) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ // Coalescing request is not canceled if there are no sub-requests
+ return false;
+
+ }
+
+
+ // ------------------------------------------------------------------------
+ // Object
+ // ------------------------------------------------------------------------
+
+ @Override
+ // All requests have a unique id
+ public int hashCode() {
+ return super.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other instanceof TmfCoalescedDataRequest<?>) {
+ TmfCoalescedDataRequest<?> request = (TmfCoalescedDataRequest<?>) other;
+ return (request.getDataType() == getDataType()) &&
+ (request.getIndex() == getIndex()) &&
+ (request.getNbRequested() == getNbRequested() &&
+ (request.getExecType() == getExecType()));
+ }
+ return false;
+ }
+
+ @Override
+ @SuppressWarnings("nls")
+ public String toString() {
+ return "[TmfCoalescedDataRequest(" + getRequestId() + "," + getDataType().getSimpleName()
+ + "," + getIndex() + "," + getNbRequested() + "," + getBlockSize() + ")]";
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Francois Chouinard - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.tmf.core.request;
+
+import org.eclipse.linuxtools.internal.tmf.core.Tracer;
+import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
+import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
+import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest;
+import org.eclipse.linuxtools.tmf.core.request.ITmfEventRequest;
+import org.eclipse.linuxtools.tmf.core.request.TmfDataRequest;
+import org.eclipse.linuxtools.tmf.core.request.TmfEventRequest;
+
+/**
+ * The TMF coalesced event request
+ *
+ * @version 1.0
+ * @author Francois Chouinard
+ */
+public class TmfCoalescedEventRequest<T extends ITmfEvent> extends TmfCoalescedDataRequest<T> implements ITmfEventRequest<T> {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ private TmfTimeRange fRange; // The requested events time range
+
+ // ------------------------------------------------------------------------
+ // Constructor
+ // ------------------------------------------------------------------------
+
+ /**
+ * Request all the events of a given type (high priority)
+ * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
+ *
+ * @param dataType the requested data type
+ */
+ public TmfCoalescedEventRequest(Class<T> dataType) {
+ this(dataType, TmfTimeRange.ETERNITY, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
+ }
+
+ /**
+ * Request all the events of a given type (given priority)
+ * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
+ *
+ * @param dataType the requested data type
+ * @param priority the requested execution priority
+ */
+ public TmfCoalescedEventRequest(Class<T> dataType, ExecutionType priority) {
+ this(dataType, TmfTimeRange.ETERNITY, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
+ }
+
+ /**
+ * Request all the events of a given type for the given time range (high priority)
+ * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
+ *
+ * @param dataType the requested data type
+ * @param range the time range of the requested events
+ */
+ public TmfCoalescedEventRequest(Class<T> dataType, TmfTimeRange range) {
+ this(dataType, range, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
+ }
+
+ /**
+ * Request all the events of a given type for the given time range (given priority)
+ * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
+ *
+ * @param dataType the requested data type
+ * @param range the time range of the requested events
+ * @param priority the requested execution priority
+ */
+ public TmfCoalescedEventRequest(Class<T> dataType, TmfTimeRange range, ExecutionType priority) {
+ this(dataType, range, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
+ }
+
+ /**
+ * Request 'n' events of a given type from the given time range (high priority)
+ * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
+ *
+ * @param dataType the requested data type
+ * @param range the time range of the requested events
+ * @param nbRequested the number of events requested
+ */
+ public TmfCoalescedEventRequest(Class<T> dataType, TmfTimeRange range, int nbRequested) {
+ this(dataType, range, nbRequested, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
+ }
+
+ /**
+ * Request 'n' events of a given type for the given time range (given priority)
+ * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
+ *
+ * @param dataType the requested data type
+ * @param range the time range of the requested events
+ * @param nbRequested the number of events requested
+ * @param priority the requested execution priority
+ */
+ public TmfCoalescedEventRequest(Class<T> dataType, TmfTimeRange range, int nbRequested, ExecutionType priority) {
+ this(dataType, range, nbRequested, DEFAULT_BLOCK_SIZE, priority);
+ }
+
+ /**
+ * Request 'n' events of a given type for the given time range (high priority).
+ * Events are returned in blocks of the given size.
+ *
+ * @param dataType the requested data type
+ * @param range the time range of the requested events
+ * @param nbRequested the number of events requested
+ * @param blockSize the number of events per block
+ */
+ public TmfCoalescedEventRequest(Class<T> dataType, TmfTimeRange range, int nbRequested, int blockSize) {
+ this(dataType, range, 0, nbRequested, blockSize, ExecutionType.FOREGROUND);
+ }
+
+ /**
+ * Request 'n' events of a given type for the given time range (given priority).
+ * Events are returned in blocks of the given size.
+ *
+ * @param dataType the requested data type
+ * @param range the time range of the requested events
+ * @param nbRequested the number of events requested
+ * @param blockSize the number of events per block
+ * @param priority the requested execution priority
+ */
+ public TmfCoalescedEventRequest(Class<T> dataType, TmfTimeRange range, int nbRequested, int blockSize, ExecutionType priority) {
+ this(dataType, range, 0, nbRequested, blockSize, priority);
+ }
+
+ /**
+ * Request 'n' events of a given type for the given time range (given priority).
+ * Events are returned in blocks of the given size.
+ *
+ * @param dataType the requested data type
+ * @param range the time range of the requested events
+ * @param index the index of the first event to retrieve
+ * @param nbRequested the number of events requested
+ * @param blockSize the number of events per block
+ * @param priority the requested execution priority
+ */
+ public TmfCoalescedEventRequest(Class<T> dataType, TmfTimeRange range, long index, int nbRequested, int blockSize, ExecutionType priority) {
+ super(dataType, index, nbRequested, blockSize, priority);
+ fRange = range;
+
+ if (Tracer.isRequestTraced()) {
+ String type = getClass().getName();
+ type = type.substring(type.lastIndexOf('.') + 1);
+ @SuppressWarnings("nls")
+ String message = "CREATED "
+ + (getExecType() == ITmfDataRequest.ExecutionType.BACKGROUND ? "(BG)" : "(FG)")
+ + " Type=" + type + " Index=" + getIndex() + " NbReq=" + getNbRequested()
+ + " Range=" + getRange()
+ + " DataType=" + getDataType().getSimpleName();
+ Tracer.traceRequest(this, message);
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Management
+ // ------------------------------------------------------------------------
+
+ @Override
+ public void addRequest(ITmfDataRequest<T> request) {
+ super.addRequest(request);
+ if (request instanceof ITmfEventRequest<?>) {
+ merge((ITmfEventRequest<T>) request);
+ }
+ }
+
+ @Override
+ public boolean isCompatible(ITmfDataRequest<T> request) {
+ if (request instanceof ITmfEventRequest<?>) {
+ if (super.isCompatible(request)) {
+ return overlaps((ITmfEventRequest<T>) request);
+ }
+ }
+ return false;
+ }
+
+ private boolean overlaps(ITmfEventRequest<T> request) {
+ ITmfTimestamp startTime = ((ITmfEventRequest<T>) request).getRange().getStartTime();
+ ITmfTimestamp endTime = ((ITmfEventRequest<T>) request).getRange().getEndTime();
+ return (startTime.compareTo(endTime) <= 0) && (fRange.getStartTime().compareTo(fRange.getEndTime()) <= 0);
+ }
+
+ private void merge(ITmfEventRequest<T> request) {
+ ITmfTimestamp startTime = ((ITmfEventRequest<T>) request).getRange().getStartTime();
+ ITmfTimestamp endTime = ((ITmfEventRequest<T>) request).getRange().getEndTime();
+ if (!fRange.contains(startTime) && fRange.getStartTime().compareTo(startTime) > 0) {
+ fRange = new TmfTimeRange(startTime, fRange.getEndTime());
+ }
+ if (!fRange.contains(endTime) && fRange.getEndTime().compareTo(endTime) < 0) {
+ fRange = new TmfTimeRange(fRange.getStartTime(), endTime);
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // ITmfDataRequest
+ // ------------------------------------------------------------------------
+
+ @Override
+ public void handleData(T data) {
+ super.handleData(data);
+ for (ITmfDataRequest<T> request : fRequests) {
+ if (data == null) {
+ request.handleData(null);
+ } else {
+ if (request instanceof TmfEventRequest<?>) {
+ TmfEventRequest<T> req = (TmfEventRequest<T>) request;
+ if (!req.isCompleted() && (getNbRead() > request.getIndex())) {
+ ITmfTimestamp ts = data.getTimestamp();
+ if (req.getRange().contains(ts)) {
+ if (req.getDataType().isInstance(data)) {
+ req.handleData(data);
+ }
+ }
+ }
+ }
+ else {
+ TmfDataRequest<T> req = (TmfDataRequest<T>) request;
+ if (!req.isCompleted()) {
+ if (req.getDataType().isInstance(data)) {
+ req.handleData(data);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // ITmfEventRequest
+ // ------------------------------------------------------------------------
+
+ @Override
+ public TmfTimeRange getRange() {
+ return fRange;
+ }
+
+ @Override
+ public void setStartIndex(int index) {
+ setIndex(index);
+ }
+
+ // ------------------------------------------------------------------------
+ // Object
+ // ------------------------------------------------------------------------
+
+ @Override
+ // All requests have a unique id
+ public int hashCode() {
+ return super.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other instanceof TmfCoalescedEventRequest<?>) {
+ TmfCoalescedEventRequest<?> request = (TmfCoalescedEventRequest<?>) other;
+ return (request.getDataType() == getDataType()) &&
+ (request.getIndex() == getIndex()) &&
+ (request.getNbRequested() == getNbRequested()) &&
+ (request.getRange().equals(getRange()));
+ }
+ if (other instanceof TmfCoalescedDataRequest<?>) {
+ return super.equals(other);
+ }
+ return false;
+ }
+
+ @Override
+ @SuppressWarnings("nls")
+ public String toString() {
+ return "[TmfCoalescedEventRequest(" + getRequestId() + "," + getDataType().getSimpleName()
+ + "," + getRange() + "," + getIndex() + "," + getNbRequested() + "," + getBlockSize() + ")]";
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Francois Chouinard - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.tmf.core.request;
+
+import java.util.Comparator;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.PriorityBlockingQueue;
+
+import org.eclipse.linuxtools.internal.tmf.core.Tracer;
+import org.eclipse.linuxtools.internal.tmf.core.component.TmfThread;
+import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest.ExecutionType;
+
+/**
+ * A simple, straightforward request executor.
+ *
+ * @version 1.0
+ * @author Francois Chouinard
+ */
+public class TmfRequestExecutor implements Executor {
+
+ private final ExecutorService fExecutor;
+ private final String fExecutorName;
+ private final PriorityBlockingQueue<TmfThread> fRequestQueue = new PriorityBlockingQueue<TmfThread>(100, new Comparator<TmfThread>() {
+ @Override
+ public int compare(TmfThread o1, TmfThread o2) {
+ if (o1.getExecType() == o2.getExecType())
+ return 0;
+ if (o1.getExecType() == ExecutionType.BACKGROUND)
+ return 1;
+ return -1;
+ }
+ });
+ private TmfThread fCurrentRequest;
+
+ // ------------------------------------------------------------------------
+ // Constructors
+ // ------------------------------------------------------------------------
+
+ public TmfRequestExecutor() {
+ this(Executors.newSingleThreadExecutor());
+ }
+
+ public TmfRequestExecutor(ExecutorService executor) {
+ fExecutor = executor;
+ String canonicalName = fExecutor.getClass().getCanonicalName();
+ fExecutorName = canonicalName.substring(canonicalName.lastIndexOf('.') + 1);
+ if (Tracer.isComponentTraced()) Tracer.trace(fExecutor + " created"); //$NON-NLS-1$
+ }
+
+ /**
+ * @return the number of pending requests
+ */
+ public synchronized int getNbPendingRequests() {
+ return fRequestQueue.size();
+ }
+
+ /**
+ * @return the shutdown state (i.e. if it is accepting new requests)
+ */
+ public synchronized boolean isShutdown() {
+ return fExecutor.isShutdown();
+ }
+
+ /**
+ * @return the termination state
+ */
+ public synchronized boolean isTerminated() {
+ return fExecutor.isTerminated();
+ }
+
+ /**
+ * Stops the executor
+ */
+ public synchronized void stop() {
+ if (fCurrentRequest != null) {
+ fCurrentRequest.cancel();
+ }
+
+ while ((fCurrentRequest = fRequestQueue.poll()) != null) {
+ fCurrentRequest.cancel();
+ }
+
+ fExecutor.shutdown();
+ if (Tracer.isComponentTraced()) Tracer.trace(fExecutor + " terminated"); //$NON-NLS-1$
+ }
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ /* (non-Javadoc)
+ * @see java.util.concurrent.Executor#execute(java.lang.Runnable)
+ */
+ @Override
+ public synchronized void execute(final Runnable requestThread) {
+ fRequestQueue.offer(new TmfThread(((TmfThread) requestThread).getExecType()) {
+ @Override
+ public void run() {
+ try {
+ requestThread.run();
+ } finally {
+ scheduleNext();
+ }
+ }
+ @Override
+ public void cancel() {
+ ((TmfThread) requestThread).cancel();
+ }
+ });
+ if (fCurrentRequest == null) {
+ scheduleNext();
+ }
+ }
+
+ /**
+ * Executes the next pending request, if applicable.
+ */
+ protected synchronized void scheduleNext() {
+ if ((fCurrentRequest = fRequestQueue.poll()) != null) {
+ if (!isShutdown())
+ fExecutor.execute(fCurrentRequest);
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Object
+ // ------------------------------------------------------------------------
+
+ @Override
+ @SuppressWarnings("nls")
+ public String toString() {
+ return "[TmfRequestExecutor(" + fExecutorName + ")]";
+ }
+
+}
/**
* This class provides a common container for TMF constants.
*
+ * @version 1.0
* @author Bernd Hufmann
*/
public class TmfCommonConstants {
import org.eclipse.core.runtime.CoreException;
/**
- * <b><u>TmfProjectNature</u></b>
- * <p>
- * This is really a marker for the tracing projects.
+ * The TMF basic tracing project nature.
+ *
+ * @version 1.0
+ * @author Francois Chouinard
*/
public class TmfProjectNature implements IProjectNature {
+ // ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+
+ /**
+ * The nature ID
+ */
public static final String ID = "org.eclipse.linuxtools.tmf.project.nature"; //$NON-NLS-1$
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
private IProject fProject;
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.IProjectNature#configure()
+ */
@Override
public void configure() throws CoreException {
}
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.IProjectNature#deconfigure()
+ */
@Override
public void deconfigure() throws CoreException {
}
return fProject;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.IProjectNature#setProject(org.eclipse.core.resources.IProject)
+ */
@Override
public void setProject(IProject project) {
fProject = project;
import org.eclipse.linuxtools.tmf.core.signal.TmfSignal;
/**
- * <b><u>ITmfComponent</u></b>
- * <p>
* This is the basic interface of all the TMF components.
* <p>
- * Currently, it only addresses the inter-component signaling.
+ * Currently, it only addresses the inter-component signalling.
+ *
+ * @version 1.0
+ * @author Francois Chouinard
+ *
+ * @see TmfComponent
*/
public interface ITmfComponent {
import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
/**
- * <b><u>ITmfDataRequest</u></b>
- * <p>
- * TODO: Implement me. Please.
+ * This is the interface of the data providers in TMF. Data providers have the
+ * capability of handling data requests.
+ *
+ * @version 1.0
+ * @author Francois Chouinard
+ *
+ * @see TmfDataProvider
+ * @see TmfEventProvider
*/
public interface ITmfDataProvider<T extends ITmfEvent> extends ITmfComponent {
/**
- * Queues the request for processing.
- *
- * If the request can't be serviced, it will fail (i.e. isFailed() will be set).
+ * Queue the request for processing.
*
* @param request The request to process
*/
public void sendRequest(ITmfDataRequest<T> request);
+
public void fireRequest();
public void notifyPendingRequest(boolean isIncrement);
import org.eclipse.linuxtools.tmf.core.signal.TmfSignalManager;
/**
- * <b><u>TmfComponent</u></b>
- * <p>
* This is the base class of the TMF components.
* <p>
- * Currently, it only addresses the inter-component signaling.
+ * Currently, it only addresses the inter-component signaling.
+ *
+ * @version 1.0
+ * @author Francois Chouinard
*/
public abstract class TmfComponent implements ITmfComponent {
// Constructor
// ------------------------------------------------------------------------
+ /**
+ * Default constructor. To be used in conjunction with init()
+ */
public TmfComponent() {
this(""); //$NON-NLS-1$
}
+ /**
+ * Perform component initialization and register it as a signal listener.
+ * Need to be called when the default constructor was used.
+ *
+ * @param name the component name
+ */
public void init(String name) {
fName = name;
TmfSignalManager.register(this);
}
+ /**
+ * The standard constructor
+ *
+ * @param name the component name
+ */
public TmfComponent(String name) {
init(name);
}
+ /**
+ * The copy constructor
+ *
+ * @param other the other component
+ */
public TmfComponent(TmfComponent other) {
init(other.fName);
}
// ------------------------------------------------------------------------
- // Accessors
+ // Getters/setters
// ------------------------------------------------------------------------
+ /* (non-Javadoc)
+ * @see org.eclipse.linuxtools.tmf.core.component.ITmfComponent#getName()
+ */
+ @Override
+ public String getName() {
+ return fName;
+ }
+
+ /**
+ * @param name the new component name
+ */
protected void setName(String name) {
fName = name;
}
// ITmfComponent
// ------------------------------------------------------------------------
- @Override
- public String getName() {
- return fName;
- }
-
+ /* (non-Javadoc)
+ * @see org.eclipse.linuxtools.tmf.core.component.ITmfComponent#dispose()
+ */
@Override
public void dispose() {
TmfSignalManager.deregister(this);
// if (Tracer.isComponentTraced()) Tracer.traceComponent(this, "terminated");
}
+ /* (non-Javadoc)
+ * @see org.eclipse.linuxtools.tmf.core.component.ITmfComponent#broadcast(org.eclipse.linuxtools.tmf.core.signal.TmfSignal)
+ */
@Override
public void broadcast(TmfSignal signal) {
TmfSignalManager.dispatchSignal(signal);
import java.util.concurrent.SynchronousQueue;
import org.eclipse.linuxtools.internal.tmf.core.Tracer;
+import org.eclipse.linuxtools.internal.tmf.core.component.TmfProviderManager;
+import org.eclipse.linuxtools.internal.tmf.core.component.TmfThread;
+import org.eclipse.linuxtools.internal.tmf.core.request.TmfCoalescedDataRequest;
+import org.eclipse.linuxtools.internal.tmf.core.request.TmfRequestExecutor;
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest;
import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest.ExecutionType;
-import org.eclipse.linuxtools.tmf.core.request.TmfCoalescedDataRequest;
import org.eclipse.linuxtools.tmf.core.request.TmfDataRequest;
-import org.eclipse.linuxtools.tmf.core.request.TmfRequestExecutor;
import org.eclipse.linuxtools.tmf.core.signal.TmfEndSynchSignal;
import org.eclipse.linuxtools.tmf.core.signal.TmfSignalHandler;
import org.eclipse.linuxtools.tmf.core.signal.TmfStartSynchSignal;
import org.eclipse.linuxtools.tmf.core.trace.ITmfContext;
/**
- * <b><u>TmfProvider</u></b>
+ * An abstract base class that implements ITmfDataProvider.
* <p>
- * The TmfProvider<T> is a provider for a data of type <T>.
+ * This abstract class implements the housekeeping methods to register/
+ * de-register the event provider and to handle generically the event requests.
* <p>
- * This abstract class implements the housekeeking methods to register/ deregister the event provider and to handle
- * generically the event requests.
- * <p>
- * The concrete class can either re-implement processRequest() entirely or just implement the hooks (initializeContext()
- * and getNext()).
+ * The concrete class can either re-implement processRequest() entirely or just
+ * implement the hooks (initializeContext() and getNext()).
* <p>
* TODO: Add support for providing multiple data types.
+ *
+ * @version 1.0
+ * @author Francois Chouinard
*/
public abstract class TmfDataProvider<T extends ITmfEvent> extends TmfComponent implements ITmfDataProvider<T> {
package org.eclipse.linuxtools.tmf.core.component;
import org.eclipse.linuxtools.internal.tmf.core.Tracer;
+import org.eclipse.linuxtools.internal.tmf.core.request.TmfCoalescedEventRequest;
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest;
import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest.ExecutionType;
import org.eclipse.linuxtools.tmf.core.request.ITmfEventRequest;
-import org.eclipse.linuxtools.tmf.core.request.TmfCoalescedEventRequest;
import org.eclipse.linuxtools.tmf.core.request.TmfEventRequest;
/**
- * <b><u>TmfEventProvider</u></b>
- * <p>
+ * An extension of TmfDataProvider timestamped events providers.
+ *
+ * @version 1.0
+ * @author Francois Chouinard
*/
public abstract class TmfEventProvider<T extends ITmfEvent> extends TmfDataProvider<T> {
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Francois Chouinard - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.component;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
-
-/**
- * <b><u>TmfProviderManager.java</u></b>
- * <p>
- * Singleton that keeps track of the event providers.
- */
-public class TmfProviderManager {
-
- // ------------------------------------------------------------------------
- // No constructor
- // ------------------------------------------------------------------------
-
- private TmfProviderManager() {}
-
- // ------------------------------------------------------------------------
- // Keeps track of the providers for each event type
- // ------------------------------------------------------------------------
-
- private static Map<Class<? extends ITmfEvent>, List<TmfDataProvider<? extends ITmfEvent>>> fProviders =
- new HashMap<Class<? extends ITmfEvent>, List<TmfDataProvider<? extends ITmfEvent>>>();
-
- /**
- * Registers [provider] as a provider of [eventType]
- *
- * @param eventType
- * @param provider
- */
- public static <T extends ITmfEvent> void register(Class<T> eventType, TmfDataProvider<? extends ITmfEvent> provider) {
- if (fProviders.get(eventType) == null)
- fProviders.put(eventType, new ArrayList<TmfDataProvider<? extends ITmfEvent>>());
- fProviders.get(eventType).add(provider);
- }
-
- /**
- * Re-registers [provider] as a provider of [eventType]
- *
- * @param eventType
- * @param provider
- */
- public static <T extends ITmfEvent> void deregister(Class<T> eventType, TmfDataProvider<? extends ITmfEvent> provider) {
- List<TmfDataProvider<? extends ITmfEvent>> list = fProviders.get(eventType);
- if (list != null) {
- list.remove(provider);
- if (list.size() == 0)
- fProviders.remove(eventType);
- }
- }
-
- /**
- * Returns the list of components that provide [eventType]
- *
- * @param eventType
- * @return the list of components that provide [eventType]
- */
- @SuppressWarnings("unchecked")
- public static TmfDataProvider<? extends ITmfEvent>[] getProviders(Class<? extends ITmfEvent> eventType) {
- List<TmfDataProvider<? extends ITmfEvent>> list = fProviders.get(eventType);
- if (list == null)
- list = new ArrayList<TmfDataProvider<? extends ITmfEvent>>();
- TmfDataProvider<? extends ITmfEvent>[] result = new TmfDataProvider[list.size()];
- return list.toArray(result);
- }
-
- /**
- * Returns the list of components of type [providerType] that provide [eventType]
- *
- * @param eventType
- * @param providerType
- * @return the list of components of type [providerType] that provide [eventType]
- */
- @SuppressWarnings("unchecked")
- public static TmfDataProvider<? extends ITmfEvent>[] getProviders(Class<? extends ITmfEvent> eventType, Class<? extends TmfDataProvider<? extends ITmfEvent>> providerType) {
- if (providerType == null) {
- return getProviders(eventType);
- }
- TmfDataProvider<? extends ITmfEvent>[] list = getProviders(eventType);
- List<TmfDataProvider<? extends ITmfEvent>> result = new ArrayList<TmfDataProvider<? extends ITmfEvent>>();
- if (list != null) {
- for (TmfDataProvider<? extends ITmfEvent> provider : list) {
- if (provider.getClass() == providerType) {
- result.add(provider);
- }
- }
- }
- TmfDataProvider<? extends ITmfEvent>[] array = new TmfDataProvider[result.size()];
- return result.toArray(array);
- }
-
-}
+++ /dev/null
-package org.eclipse.linuxtools.tmf.core.component;
-
-import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest.ExecutionType;
-
-public class TmfThread extends Thread { // implements Comparator<ITmfDataRequest<?>> {
-
- private final ExecutionType fExecType;
-
- public TmfThread(ExecutionType execType) {
- fExecType = execType;
- }
-
- public ExecutionType getExecType() {
- return fExecType;
- }
-
- public void cancel() {
- }
-
-}
* @return String
* @see org.eclipse.linuxtools.tmf.core.event.ITmfEventField#getFieldName(int)
*/
- @SuppressWarnings("unused")
@Override
public String getFieldName(int index) {
return null;
* @return ITmfEventField
* @see org.eclipse.linuxtools.tmf.core.event.ITmfEventField#getField(String)
*/
- @SuppressWarnings("unused")
@Override
public ITmfEventField getField(String fieldName) {
return null;
* @return ITmfEventField
* @see org.eclipse.linuxtools.tmf.core.event.ITmfEventField#getField(int)
*/
- @SuppressWarnings("unused")
@Override
public ITmfEventField getField(int index) {
return null;
* sub-classes.
* @throws TmfTraceException
*/
- @SuppressWarnings({ "static-method", "unused" })
+ @SuppressWarnings("static-method")
protected void buildStateSystem() throws TmfTraceException {
/*
* Nothing is done in the basic implementation, please specify
/**
* TMF trace related exception
+ *
+ * @version 1.0
+ * @author Francois Chouinard
*/
public class TmfTraceException extends Exception {
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
/**
- * <b><u>ITmfDataRequest</u></b>
- * <p>
- * TODO: Implement me. Please.
+ * The TMF data request
+ *
+ * @version 1.0
+ * @author Francois Chouinard
*/
public interface ITmfDataRequest<T extends ITmfEvent> {
import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
/**
- * <b><u>ITmfEventRequest</u></b>
- * <p>
- * TODO: Implement me. Please.
+ * The TMF event request
+ *
+ * @version 1.0
+ * @author Francois Chouinard
*/
public interface ITmfEventRequest<T extends ITmfEvent> extends ITmfDataRequest<T> {
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Francois Chouinard - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.request;
-
-import java.util.Vector;
-
-import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
-
-/**
- * <b><u>TmfCoalescedDataRequest</u></b>
- * <p>
- */
-public class TmfCoalescedDataRequest<T extends ITmfEvent> extends TmfDataRequest<T> {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
-
- /**
- * The list of coalesced requests
- */
- protected Vector<ITmfDataRequest<T>> fRequests = new Vector<ITmfDataRequest<T>>();
-
- // ------------------------------------------------------------------------
- // Constructor
- // ------------------------------------------------------------------------
-
- /**
- * Request all the events of a given type (high priority)
- * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
- *
- * @param dataType the requested data type
- */
- public TmfCoalescedDataRequest(Class<T> dataType) {
- this(dataType, 0, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
- }
-
- /**
- * Request all the events of a given type (given priority)
- * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
- *
- * @param dataType the requested data type
- * @param priority the requested execution priority
- */
- public TmfCoalescedDataRequest(Class<T> dataType, ExecutionType priority) {
- this(dataType, 0, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
- }
-
- /**
- * Request all the events of a given type from the given index (high priority)
- * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
- *
- * @param dataType the requested data type
- * @param index the index of the first event to retrieve
- */
- public TmfCoalescedDataRequest(Class<T> dataType, long index) {
- this(dataType, index, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
- }
-
- /**
- * Request all the events of a given type from the given index (given priority)
- * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
- *
- * @param dataType the requested data type
- * @param index the index of the first event to retrieve
- * @param priority the requested execution priority
- */
- public TmfCoalescedDataRequest(Class<T> dataType, long index, ExecutionType priority) {
- this(dataType, index, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
- }
-
- /**
- * Request 'n' events of a given type from the given index (high priority)
- * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
- *
- * @param dataType the requested data type
- * @param index the index of the first event to retrieve
- * @param nbRequested the number of events requested
- */
- public TmfCoalescedDataRequest(Class<T> dataType, long index, int nbRequested) {
- this(dataType, index, nbRequested, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
- }
-
- /**
- * Request 'n' events of a given type from the given index (given priority)
- * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
- *
- * @param dataType the requested data type
- * @param index the index of the first event to retrieve
- * @param nbRequested the number of events requested
- * @param priority the requested execution priority
- */
- public TmfCoalescedDataRequest(Class<T> dataType, long index, int nbRequested, ExecutionType priority) {
- this(dataType, index, nbRequested, DEFAULT_BLOCK_SIZE, priority);
- }
-
- /**
- * Request 'n' events of a given type from the given index (high priority).
- * Events are returned in blocks of the given size.
- *
- * @param dataType the requested data type
- * @param index the index of the first event to retrieve
- * @param nbRequested the number of events requested
- * @param blockSize the number of events per block
- */
- public TmfCoalescedDataRequest(Class<T> dataType, long index, int nbRequested, int blockSize) {
- super(dataType, index, nbRequested, blockSize, ExecutionType.FOREGROUND);
- }
-
- /**
- * Request 'n' events of a given type from the given index (given priority).
- * Events are returned in blocks of the given size.
- *
- * @param dataType the requested data type
- * @param index the index of the first event to retrieve
- * @param nbRequested the number of events requested
- * @param blockSize the number of events per block
- * @param priority the requested execution priority
- */
- public TmfCoalescedDataRequest(Class<T> dataType, long index, int nbRequested, int blockSize, ExecutionType priority) {
- super(dataType, index, nbRequested, blockSize, priority);
- }
-
- // ------------------------------------------------------------------------
- // Management
- // ------------------------------------------------------------------------
-
- public void addRequest(ITmfDataRequest<T> request) {
- fRequests.add(request);
- merge(request);
- }
-
- public boolean isCompatible(ITmfDataRequest<T> request) {
- if (request.getExecType() == getExecType()) {
- return overlaps(request);
- }
- return false;
- }
-
- private boolean overlaps(ITmfDataRequest<T> request) {
- long start = request.getIndex();
- long end = start + request.getNbRequested();
-
- // Return true if either the start or end index falls within
- // the coalesced request boundaries
- return (start <= (fIndex + fNbRequested + 1) && (end >= fIndex - 1));
- }
-
- private void merge(ITmfDataRequest<T> request) {
- long start = request.getIndex();
- long end = Math.min(start + request.getNbRequested(), TmfDataRequest.ALL_DATA);
-
- if (start < fIndex) {
- if (fNbRequested != TmfDataRequest.ALL_DATA) {
- fNbRequested += (fIndex - start);
- }
- fIndex = start;
- }
- if ((request.getNbRequested() == TmfDataRequest.ALL_DATA) ||
- (fNbRequested == TmfDataRequest.ALL_DATA))
- {
- fNbRequested = TmfDataRequest.ALL_DATA;
- } else {
- fNbRequested = (int) Math.max(end - fIndex, fNbRequested);
- }
- }
-
- @SuppressWarnings("nls")
- public String getSubRequestIds() {
- StringBuffer result = new StringBuffer("[");
- for (int i = 0; i < fRequests.size(); i++) {
- if (i != 0) result.append(", ");
- result.append(fRequests.get(i).getRequestId());
- }
- result.append("]");
- return result.toString();
- }
-
- // ------------------------------------------------------------------------
- // ITmfDataRequest
- // ------------------------------------------------------------------------
-
- @Override
- public void handleData(T data) {
- super.handleData(data);
- // Don't call sub-requests handleData() unless this is a
- // TmfCoalescedDataRequest; extended classes should call
- // the sub-requests handleData().
- if (getClass() == TmfCoalescedDataRequest.class) {
- long index = getNbRead();
- for (ITmfDataRequest<T> request : fRequests) {
- if (!request.isCompleted()) {
- if (request.getDataType().isInstance(data)) {
- long start = request.getIndex();
- long end = start + request.getNbRequested() - 1;
- if (index >= start && index < end) {
- request.handleData(data);
- }
- }
- }
- }
- }
- }
-
- @Override
- public void start() {
- for (ITmfDataRequest<T> request : fRequests) {
- if (!request.isCompleted()) {
- request.start();
- }
- }
- super.start();
- }
-
- @Override
- public void done() {
- for (ITmfDataRequest<T> request : fRequests) {
- if (!request.isCompleted()) {
- request.done();
- }
- }
- super.done();
- }
-
- @Override
- public void fail() {
- for (ITmfDataRequest<T> request : fRequests) {
- request.fail();
- }
- super.fail();
- }
-
- @Override
- public void cancel() {
- for (ITmfDataRequest<T> request : fRequests) {
- if (!request.isCompleted()) {
- request.cancel();
- }
- }
- super.cancel();
- }
-
- @Override
- public boolean isCompleted() {
- // Firstly, check if coalescing request is completed
- if (super.isCompleted()) {
- return true;
- }
-
- // Secondly, check if all sub-requests are finished
- if (fRequests.size() > 0) {
- // If all sub requests are completed the coalesced request is
- // treated as completed, too.
- for (ITmfDataRequest<T> request : fRequests) {
- if (!request.isCompleted()) {
- return false;
- }
- }
- return true;
- }
-
- // Coalescing request is not finished if there are no sub-requests
- return false;
- }
-
- @Override
- public boolean isCancelled() {
- // Firstly, check if coalescing request is canceled
- if (super.isCancelled()) {
- return true;
- }
-
- // Secondly, check if all sub-requests are canceled
- if (fRequests.size() > 0) {
- // If all sub requests are canceled the coalesced request is
- // treated as completed, too.
- for (ITmfDataRequest<T> request : fRequests) {
- if (!request.isCancelled()) {
- return false;
- }
- }
- return true;
- }
-
- // Coalescing request is not canceled if there are no sub-requests
- return false;
-
- }
-
-
- // ------------------------------------------------------------------------
- // Object
- // ------------------------------------------------------------------------
-
- @Override
- // All requests have a unique id
- public int hashCode() {
- return super.hashCode();
- }
-
- @Override
- public boolean equals(Object other) {
- if (other instanceof TmfCoalescedDataRequest<?>) {
- TmfCoalescedDataRequest<?> request = (TmfCoalescedDataRequest<?>) other;
- return (request.getDataType() == getDataType()) &&
- (request.getIndex() == getIndex()) &&
- (request.getNbRequested() == getNbRequested() &&
- (request.getExecType() == getExecType()));
- }
- return false;
- }
-
- @Override
- @SuppressWarnings("nls")
- public String toString() {
- return "[TmfCoalescedDataRequest(" + getRequestId() + "," + getDataType().getSimpleName()
- + "," + getIndex() + "," + getNbRequested() + "," + getBlockSize() + ")]";
- }
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Francois Chouinard - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.request;
-
-import org.eclipse.linuxtools.internal.tmf.core.Tracer;
-import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
-import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
-
-/**
- * <b><u>TmfCoalescedEventRequest</u></b>
- * <p>
- */
-public class TmfCoalescedEventRequest<T extends ITmfEvent> extends TmfCoalescedDataRequest<T> implements ITmfEventRequest<T> {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
-
- private TmfTimeRange fRange; // The requested events time range
-
- // ------------------------------------------------------------------------
- // Constructor
- // ------------------------------------------------------------------------
-
- /**
- * Request all the events of a given type (high priority)
- * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
- *
- * @param dataType the requested data type
- */
- public TmfCoalescedEventRequest(Class<T> dataType) {
- this(dataType, TmfTimeRange.ETERNITY, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
- }
-
- /**
- * Request all the events of a given type (given priority)
- * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
- *
- * @param dataType the requested data type
- * @param priority the requested execution priority
- */
- public TmfCoalescedEventRequest(Class<T> dataType, ExecutionType priority) {
- this(dataType, TmfTimeRange.ETERNITY, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
- }
-
- /**
- * Request all the events of a given type for the given time range (high priority)
- * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
- *
- * @param dataType the requested data type
- * @param range the time range of the requested events
- */
- public TmfCoalescedEventRequest(Class<T> dataType, TmfTimeRange range) {
- this(dataType, range, ALL_DATA, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
- }
-
- /**
- * Request all the events of a given type for the given time range (given priority)
- * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
- *
- * @param dataType the requested data type
- * @param range the time range of the requested events
- * @param priority the requested execution priority
- */
- public TmfCoalescedEventRequest(Class<T> dataType, TmfTimeRange range, ExecutionType priority) {
- this(dataType, range, ALL_DATA, DEFAULT_BLOCK_SIZE, priority);
- }
-
- /**
- * Request 'n' events of a given type from the given time range (high priority)
- * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
- *
- * @param dataType the requested data type
- * @param range the time range of the requested events
- * @param nbRequested the number of events requested
- */
- public TmfCoalescedEventRequest(Class<T> dataType, TmfTimeRange range, int nbRequested) {
- this(dataType, range, nbRequested, DEFAULT_BLOCK_SIZE, ExecutionType.FOREGROUND);
- }
-
- /**
- * Request 'n' events of a given type for the given time range (given priority)
- * Events are returned in blocks of the default size (DEFAULT_BLOCK_SIZE).
- *
- * @param dataType the requested data type
- * @param range the time range of the requested events
- * @param nbRequested the number of events requested
- * @param priority the requested execution priority
- */
- public TmfCoalescedEventRequest(Class<T> dataType, TmfTimeRange range, int nbRequested, ExecutionType priority) {
- this(dataType, range, nbRequested, DEFAULT_BLOCK_SIZE, priority);
- }
-
- /**
- * Request 'n' events of a given type for the given time range (high priority).
- * Events are returned in blocks of the given size.
- *
- * @param dataType the requested data type
- * @param range the time range of the requested events
- * @param nbRequested the number of events requested
- * @param blockSize the number of events per block
- */
- public TmfCoalescedEventRequest(Class<T> dataType, TmfTimeRange range, int nbRequested, int blockSize) {
- this(dataType, range, 0, nbRequested, blockSize, ExecutionType.FOREGROUND);
- }
-
- /**
- * Request 'n' events of a given type for the given time range (given priority).
- * Events are returned in blocks of the given size.
- *
- * @param dataType the requested data type
- * @param range the time range of the requested events
- * @param nbRequested the number of events requested
- * @param blockSize the number of events per block
- * @param priority the requested execution priority
- */
- public TmfCoalescedEventRequest(Class<T> dataType, TmfTimeRange range, int nbRequested, int blockSize, ExecutionType priority) {
- this(dataType, range, 0, nbRequested, blockSize, priority);
- }
-
- /**
- * Request 'n' events of a given type for the given time range (given priority).
- * Events are returned in blocks of the given size.
- *
- * @param dataType the requested data type
- * @param range the time range of the requested events
- * @param index the index of the first event to retrieve
- * @param nbRequested the number of events requested
- * @param blockSize the number of events per block
- * @param priority the requested execution priority
- */
- public TmfCoalescedEventRequest(Class<T> dataType, TmfTimeRange range, long index, int nbRequested, int blockSize, ExecutionType priority) {
- super(dataType, index, nbRequested, blockSize, priority);
- fRange = range;
-
- if (Tracer.isRequestTraced()) {
- String type = getClass().getName();
- type = type.substring(type.lastIndexOf('.') + 1);
- @SuppressWarnings("nls")
- String message = "CREATED "
- + (getExecType() == ITmfDataRequest.ExecutionType.BACKGROUND ? "(BG)" : "(FG)")
- + " Type=" + type + " Index=" + getIndex() + " NbReq=" + getNbRequested()
- + " Range=" + getRange()
- + " DataType=" + getDataType().getSimpleName();
- Tracer.traceRequest(this, message);
- }
- }
-
- // ------------------------------------------------------------------------
- // Management
- // ------------------------------------------------------------------------
-
- @Override
- public void addRequest(ITmfDataRequest<T> request) {
- super.addRequest(request);
- if (request instanceof ITmfEventRequest<?>) {
- merge((ITmfEventRequest<T>) request);
- }
- }
-
- @Override
- public boolean isCompatible(ITmfDataRequest<T> request) {
- if (request instanceof ITmfEventRequest<?>) {
- if (super.isCompatible(request)) {
- return overlaps((ITmfEventRequest<T>) request);
- }
- }
- return false;
- }
-
- private boolean overlaps(ITmfEventRequest<T> request) {
- ITmfTimestamp startTime = ((ITmfEventRequest<T>) request).getRange().getStartTime();
- ITmfTimestamp endTime = ((ITmfEventRequest<T>) request).getRange().getEndTime();
- return (startTime.compareTo(endTime) <= 0) && (fRange.getStartTime().compareTo(fRange.getEndTime()) <= 0);
- }
-
- private void merge(ITmfEventRequest<T> request) {
- ITmfTimestamp startTime = ((ITmfEventRequest<T>) request).getRange().getStartTime();
- ITmfTimestamp endTime = ((ITmfEventRequest<T>) request).getRange().getEndTime();
- if (!fRange.contains(startTime) && fRange.getStartTime().compareTo(startTime) > 0) {
- fRange = new TmfTimeRange(startTime, fRange.getEndTime());
- }
- if (!fRange.contains(endTime) && fRange.getEndTime().compareTo(endTime) < 0) {
- fRange = new TmfTimeRange(fRange.getStartTime(), endTime);
- }
- }
-
- // ------------------------------------------------------------------------
- // ITmfDataRequest
- // ------------------------------------------------------------------------
-
- @Override
- public void handleData(T data) {
- super.handleData(data);
- for (ITmfDataRequest<T> request : fRequests) {
- if (data == null) {
- request.handleData(null);
- } else {
- if (request instanceof TmfEventRequest<?>) {
- TmfEventRequest<T> req = (TmfEventRequest<T>) request;
- if (!req.isCompleted() && (getNbRead() > request.getIndex())) {
- ITmfTimestamp ts = data.getTimestamp();
- if (req.getRange().contains(ts)) {
- if (req.getDataType().isInstance(data)) {
- req.handleData(data);
- }
- }
- }
- }
- else {
- TmfDataRequest<T> req = (TmfDataRequest<T>) request;
- if (!req.isCompleted()) {
- if (req.getDataType().isInstance(data)) {
- req.handleData(data);
- }
- }
- }
- }
- }
- }
-
- // ------------------------------------------------------------------------
- // ITmfEventRequest
- // ------------------------------------------------------------------------
-
- @Override
- public TmfTimeRange getRange() {
- return fRange;
- }
-
- @Override
- public void setStartIndex(int index) {
- setIndex(index);
- }
-
- // ------------------------------------------------------------------------
- // Object
- // ------------------------------------------------------------------------
-
- @Override
- // All requests have a unique id
- public int hashCode() {
- return super.hashCode();
- }
-
- @Override
- public boolean equals(Object other) {
- if (other instanceof TmfCoalescedEventRequest<?>) {
- TmfCoalescedEventRequest<?> request = (TmfCoalescedEventRequest<?>) other;
- return (request.getDataType() == getDataType()) &&
- (request.getIndex() == getIndex()) &&
- (request.getNbRequested() == getNbRequested()) &&
- (request.getRange().equals(getRange()));
- }
- if (other instanceof TmfCoalescedDataRequest<?>) {
- return super.equals(other);
- }
- return false;
- }
-
- @Override
- @SuppressWarnings("nls")
- public String toString() {
- return "[TmfCoalescedEventRequest(" + getRequestId() + "," + getDataType().getSimpleName()
- + "," + getRange() + "," + getIndex() + "," + getNbRequested() + "," + getBlockSize() + ")]";
- }
-
-}
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
/**
- * <b><u>TmfDataRequest</u></b>
- * <p>
* TmfDataRequests are used to obtain blocks of contiguous data from a data provider. Open ranges can be used,
* especially for continuous streaming.
* <p>
* it would prepare us well for the coming generation of analysis tools.
*
* TODO: Implement request failures (codes, etc...)
+ *
+ * @version 1.0
+ * @author Francois Chouinard
*/
public abstract class TmfDataRequest<T extends ITmfEvent> implements ITmfDataRequest<T> {
import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
/**
- * <b><u>TmfEventRequest</u></b>
- * <p>
- * Implement me. Please.
+ * An extension of TmfDataRequest for timestamped events.
+ *
+ * @version 1.0
+ * @author Francois Chouinard
*/
public abstract class TmfEventRequest<T extends ITmfEvent> extends TmfDataRequest<T> implements ITmfEventRequest<T> {
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Francois Chouinard - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.tmf.core.request;
-
-import java.util.Comparator;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.PriorityBlockingQueue;
-
-import org.eclipse.linuxtools.internal.tmf.core.Tracer;
-import org.eclipse.linuxtools.tmf.core.component.TmfThread;
-import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest.ExecutionType;
-
-/**
- * <b><u>TmfRequestExecutor</u></b>
- *
- * A simple, straightforward request executor.
- */
-public class TmfRequestExecutor implements Executor {
-
- private final ExecutorService fExecutor;
- private final String fExecutorName;
- private final PriorityBlockingQueue<TmfThread> fRequestQueue = new PriorityBlockingQueue<TmfThread>(100, new Comparator<TmfThread>() {
- @Override
- public int compare(TmfThread o1, TmfThread o2) {
- if (o1.getExecType() == o2.getExecType())
- return 0;
- if (o1.getExecType() == ExecutionType.BACKGROUND)
- return 1;
- return -1;
- }
- });
- private TmfThread fCurrentRequest;
-
- // ------------------------------------------------------------------------
- // Constructors
- // ------------------------------------------------------------------------
-
- public TmfRequestExecutor() {
- this(Executors.newSingleThreadExecutor());
- }
-
- public TmfRequestExecutor(ExecutorService executor) {
- fExecutor = executor;
- String canonicalName = fExecutor.getClass().getCanonicalName();
- fExecutorName = canonicalName.substring(canonicalName.lastIndexOf('.') + 1);
- if (Tracer.isComponentTraced()) Tracer.trace(fExecutor + " created"); //$NON-NLS-1$
- }
-
- /**
- * @return the number of pending requests
- */
- public synchronized int getNbPendingRequests() {
- return fRequestQueue.size();
- }
-
- /**
- * @return the shutdown state (i.e. if it is accepting new requests)
- */
- public synchronized boolean isShutdown() {
- return fExecutor.isShutdown();
- }
-
- /**
- * @return the termination state
- */
- public synchronized boolean isTerminated() {
- return fExecutor.isTerminated();
- }
-
- /**
- * Stops the executor
- */
- public synchronized void stop() {
- if (fCurrentRequest != null) {
- fCurrentRequest.cancel();
- }
-
- while ((fCurrentRequest = fRequestQueue.poll()) != null) {
- fCurrentRequest.cancel();
- }
-
- fExecutor.shutdown();
- if (Tracer.isComponentTraced()) Tracer.trace(fExecutor + " terminated"); //$NON-NLS-1$
- }
-
- // ------------------------------------------------------------------------
- // Operations
- // ------------------------------------------------------------------------
-
- /* (non-Javadoc)
- * @see java.util.concurrent.Executor#execute(java.lang.Runnable)
- */
- @Override
- public synchronized void execute(final Runnable requestThread) {
- fRequestQueue.offer(new TmfThread(((TmfThread) requestThread).getExecType()) {
- @Override
- public void run() {
- try {
- requestThread.run();
- } finally {
- scheduleNext();
- }
- }
- @Override
- public void cancel() {
- ((TmfThread) requestThread).cancel();
- }
- });
- if (fCurrentRequest == null) {
- scheduleNext();
- }
- }
-
- /**
- * Executes the next pending request, if applicable.
- */
- protected synchronized void scheduleNext() {
- if ((fCurrentRequest = fRequestQueue.poll()) != null) {
- if (!isShutdown())
- fExecutor.execute(fCurrentRequest);
- }
- }
-
- // ------------------------------------------------------------------------
- // Object
- // ------------------------------------------------------------------------
-
- @Override
- @SuppressWarnings("nls")
- public String toString() {
- return "[TmfRequestExecutor(" + fExecutorName + ")]";
- }
-
-}
* @param signal The signal that triggered the build
*/
@TmfSignalHandler
+ @SuppressWarnings("unchecked")
public void startBuilding(final TmfExperimentRangeUpdatedSignal signal) {
/* Start the construction of the history if it's not started yet */
if (!this.isRunning) {
private final HistoryBuilder builder;
private final IStateChangeInput sci;
+ @SuppressWarnings("unchecked")
StateSystemBuildRequest(HistoryBuilder builder) {
super((Class<CtfTmfEvent>) builder.getInputPlugin().getExpectedEventType().getClass(),
TmfTimeRange.ETERNITY, TmfDataRequest.ALL_DATA, chunkSize,
import junit.framework.TestCase;
import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.load.IUml2SDLoader;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.load.LoadersManager;
}
private String getSavedLoader(String viewId) {
- IPreferenceStore p = TmfUiPlugin.getDefault().getPreferenceStore();
+ IPreferenceStore p = Activator.getDefault().getPreferenceStore();
return p.getString(LOADER_PREFIX + viewId);
}
}
Bundle-Version: 0.5.0.qualifier
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.linuxtools.tmf.ui;singleton:=true
-Bundle-Activator: org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin
+Bundle-Activator: org.eclipse.linuxtools.internal.tmf.ui.Activator
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.core.expressions,
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2009, 2012 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Francois Chouinard - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.tmf.ui;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceElement;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle.
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ /**
+ * The plug-in ID
+ */
+ public static final String PLUGIN_ID = "org.eclipse.linuxtools.tmf.ui"; //$NON-NLS-1$
+
+ /**
+ * The shared instance
+ */
+ private static Activator plugin;
+
+ // ------------------------------------------------------------------------
+ // Constructors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Constructor
+ */
+ public Activator() {
+ }
+
+ // ------------------------------------------------------------------------
+ // Accessors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Returns the TMF UI plug-in instance.
+ *
+ * @return the TMF UI plug-in instance.
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ // ------------------------------------------------------------------------
+ // AbstractUIPlugin
+ // ------------------------------------------------------------------------
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ TmfUiTracer.init();
+ TmfTraceElement.init();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ TmfUiTracer.stop();
+ plugin = null;
+ super.stop(context);
+ }
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ /**
+ * Gets an image object using given path within plug-in.
+ *
+ * @param path path to image file
+ *
+ * @return image object
+ */
+ public Image getImageFromPath(String path){
+ return getImageDescripterFromPath(path).createImage();
+ }
+
+ /**
+ * Gets an image descriptor using given path within plug-in.
+ *
+ * @param path path to image file
+ *
+ * @return image descriptor object
+ */
+ public ImageDescriptor getImageDescripterFromPath(String path){
+ return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ /**
+ * Gets a image object from the image registry based on the given path.
+ * If the image is not in the registry it will be registered.
+ *
+ * @param path to the image file
+ * @return image object
+ */
+ public Image getImageFromImageRegistry(String path) {
+ Image icon = getImageRegistry().get(path);
+ if (icon == null) {
+ icon = getImageDescripterFromPath(path).createImage();
+ plugin.getImageRegistry().put(path, icon);
+ }
+ return icon;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
+ */
+ @Override
+ protected void initializeImageRegistry(ImageRegistry reg) {
+ reg.put(ITmfImageConstants.IMG_UI_ZOOM, getImageFromPath(ITmfImageConstants.IMG_UI_ZOOM));
+ reg.put(ITmfImageConstants.IMG_UI_ZOOM_IN, getImageFromPath(ITmfImageConstants.IMG_UI_ZOOM_IN));
+ reg.put(ITmfImageConstants.IMG_UI_ZOOM_OUT, getImageFromPath(ITmfImageConstants.IMG_UI_ZOOM_OUT));
+ reg.put(ITmfImageConstants.IMG_UI_SEQ_DIAGRAM_OBJ, getImageFromPath(ITmfImageConstants.IMG_UI_SEQ_DIAGRAM_OBJ));
+ reg.put(ITmfImageConstants.IMG_UI_ARROW_COLLAPSE_OBJ, getImageFromPath(ITmfImageConstants.IMG_UI_ARROW_COLLAPSE_OBJ));
+ reg.put(ITmfImageConstants.IMG_UI_ARROW_UP_OBJ, getImageFromPath(ITmfImageConstants.IMG_UI_ARROW_UP_OBJ));
+ }
+
+ /**
+ * Logs a message with severity INFO in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ */
+ public void logInfo(String message) {
+ getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message));
+ }
+
+ /**
+ * Logs a message and exception with severity INFO in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ * @param exception A exception to log
+ */
+ public void logInfo(String message, Throwable exception) {
+ getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message, exception));
+ }
+
+ /**
+ * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ */
+ public void logWarning(String message) {
+ getLog().log(new Status(IStatus.WARNING, PLUGIN_ID, message));
+ }
+
+ /**
+ * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ * @param exception A exception to log
+ */
+ public void logWarning(String message, Throwable exception) {
+ getLog().log(new Status(IStatus.WARNING, PLUGIN_ID, message, exception));
+ }
+
+ /**
+ * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ */
+ public void logError(String message) {
+ getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message));
+ }
+
+ /**
+ * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
+ *
+ * @param message A message to log
+ * @param exception A exception to log
+ */
+ public void logError(String message, Throwable exception) {
+ getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, exception));
+ }
+}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Ericsson
- *
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Francois Chouinard - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.linuxtools.internal.tmf.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceElement;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle.
- */
-public class TmfUiPlugin extends AbstractUIPlugin {
-
- // ------------------------------------------------------------------------
- // Attributes
- // ------------------------------------------------------------------------
-
- /**
- * The plug-in ID
- */
- public static final String PLUGIN_ID = "org.eclipse.linuxtools.tmf.ui"; //$NON-NLS-1$
-
- /**
- * The shared instance
- */
- private static TmfUiPlugin plugin;
-
- // ------------------------------------------------------------------------
- // Constructors
- // ------------------------------------------------------------------------
-
- /**
- * Constructor
- */
- public TmfUiPlugin() {
- }
-
- // ------------------------------------------------------------------------
- // Accessors
- // ------------------------------------------------------------------------
-
- /**
- * Returns the TMF UI plug-in instance.
- *
- * @return the TMF UI plug-in instance.
- */
- public static TmfUiPlugin getDefault() {
- return plugin;
- }
-
- // ------------------------------------------------------------------------
- // AbstractUIPlugin
- // ------------------------------------------------------------------------
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- TmfUiTracer.init();
- TmfTraceElement.init();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- TmfUiTracer.stop();
- plugin = null;
- super.stop(context);
- }
-
- // ------------------------------------------------------------------------
- // Operations
- // ------------------------------------------------------------------------
-
- /**
- * Gets an image object using given path within plug-in.
- *
- * @param path path to image file
- *
- * @return image object
- */
- public Image getImageFromPath(String path){
- return getImageDescripterFromPath(path).createImage();
- }
-
- /**
- * Gets an image descriptor using given path within plug-in.
- *
- * @param path path to image file
- *
- * @return image descriptor object
- */
- public ImageDescriptor getImageDescripterFromPath(String path){
- return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-
- /**
- * Gets a image object from the image registry based on the given path.
- * If the image is not in the registry it will be registered.
- *
- * @param path to the image file
- * @return image object
- */
- public Image getImageFromImageRegistry(String path) {
- Image icon = getImageRegistry().get(path);
- if (icon == null) {
- icon = getImageDescripterFromPath(path).createImage();
- plugin.getImageRegistry().put(path, icon);
- }
- return icon;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
- */
- @Override
- protected void initializeImageRegistry(ImageRegistry reg) {
- reg.put(ITmfImageConstants.IMG_UI_ZOOM, getImageFromPath(ITmfImageConstants.IMG_UI_ZOOM));
- reg.put(ITmfImageConstants.IMG_UI_ZOOM_IN, getImageFromPath(ITmfImageConstants.IMG_UI_ZOOM_IN));
- reg.put(ITmfImageConstants.IMG_UI_ZOOM_OUT, getImageFromPath(ITmfImageConstants.IMG_UI_ZOOM_OUT));
- reg.put(ITmfImageConstants.IMG_UI_SEQ_DIAGRAM_OBJ, getImageFromPath(ITmfImageConstants.IMG_UI_SEQ_DIAGRAM_OBJ));
- reg.put(ITmfImageConstants.IMG_UI_ARROW_COLLAPSE_OBJ, getImageFromPath(ITmfImageConstants.IMG_UI_ARROW_COLLAPSE_OBJ));
- reg.put(ITmfImageConstants.IMG_UI_ARROW_UP_OBJ, getImageFromPath(ITmfImageConstants.IMG_UI_ARROW_UP_OBJ));
- }
-
- /**
- * Logs a message with severity INFO in the runtime log of the plug-in.
- *
- * @param message A message to log
- */
- public void logInfo(String message) {
- getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message));
- }
-
- /**
- * Logs a message and exception with severity INFO in the runtime log of the plug-in.
- *
- * @param message A message to log
- * @param exception A exception to log
- */
- public void logInfo(String message, Throwable exception) {
- getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message, exception));
- }
-
- /**
- * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
- *
- * @param message A message to log
- */
- public void logWarning(String message) {
- getLog().log(new Status(IStatus.WARNING, PLUGIN_ID, message));
- }
-
- /**
- * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
- *
- * @param message A message to log
- * @param exception A exception to log
- */
- public void logWarning(String message, Throwable exception) {
- getLog().log(new Status(IStatus.WARNING, PLUGIN_ID, message, exception));
- }
-
- /**
- * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
- *
- * @param message A message to log
- */
- public void logError(String message) {
- getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message));
- }
-
- /**
- * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
- *
- * @param message A message to log
- * @param exception A exception to log
- */
- public void logError(String message, Throwable exception) {
- getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, exception));
- }
-}
@SuppressWarnings("nls")\r
public class TmfUiTracer {\r
\r
- private static String pluginID = TmfUiPlugin.PLUGIN_ID;\r
+ private static String pluginID = Activator.PLUGIN_ID;\r
\r
static Boolean ERROR = Boolean.FALSE;\r
static Boolean WARNING = Boolean.FALSE;\r
try {\r
outfile = new BufferedWriter(new FileWriter(filename));\r
} catch (IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error creating log file " + LOGNAME, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error creating log file " + LOGNAME, e); //$NON-NLS-1$\r
}\r
return outfile;\r
}\r
fTraceLog.close();\r
fTraceLog = null;\r
} catch (IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error closing log file " + LOGNAME, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error closing log file " + LOGNAME, e); //$NON-NLS-1$\r
}\r
}\r
\r
fTraceLog.newLine();\r
fTraceLog.flush();\r
} catch (IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error writing to log file " + LOGNAME, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error writing to log file " + LOGNAME, e); //$NON-NLS-1$\r
}\r
}\r
}\r
import org.eclipse.jface.dialogs.MessageDialog;\r
import org.eclipse.jface.wizard.WizardDialog;\r
import org.eclipse.linuxtools.internal.tmf.ui.Messages;\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTraceDefinition;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTraceDefinition;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTraceDefinition;\r
\r
public class ManageCustomParsersDialog extends Dialog {\r
\r
- private static final Image image = TmfUiPlugin.getDefault().getImageFromPath("/icons/etool16/customparser_wizard.gif"); //$NON-NLS-1$\r
+ private static final Image image = Activator.getDefault().getImageFromPath("/icons/etool16/customparser_wizard.gif"); //$NON-NLS-1$\r
\r
Button txtButton;\r
Button xmlButton;\r
\r
import org.eclipse.core.resources.IProject;\r
import org.eclipse.core.resources.IResource;\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTraceDefinition.InputLine;\r
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;\r
import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;\r
}\r
return context;\r
} catch (final FileNotFoundException e) {\r
- TmfUiPlugin.getDefault().logError("Error seeking event. File not found: " + getPath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error seeking event. File not found: " + getPath(), e); //$NON-NLS-1$\r
return context;\r
} catch (final IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error seeking event. File: " + getPath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error seeking event. File: " + getPath(), e); //$NON-NLS-1$\r
return context;\r
}\r
\r
context.setRank(ITmfContext.UNKNOWN_RANK);\r
return context;\r
} catch (final FileNotFoundException e) {\r
- TmfUiPlugin.getDefault().logError("Error seeking event. File not found: " + getPath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error seeking event. File not found: " + getPath(), e); //$NON-NLS-1$\r
return new CustomTxtTraceContext(NULL_LOCATION, ITmfContext.UNKNOWN_RANK);\r
} catch (final IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error seeking event. File: " + getPath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error seeking event. File: " + getPath(), e); //$NON-NLS-1$\r
return new CustomTxtTraceContext(NULL_LOCATION, ITmfContext.UNKNOWN_RANK);\r
} finally {\r
if (raFile != null) {\r
return (double) ((Long) location.getLocation()) / raFile.length();\r
}\r
} catch (final FileNotFoundException e) {\r
- TmfUiPlugin.getDefault().logError("Error seeking event. File not found: " + getPath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error seeking event. File not found: " + getPath(), e); //$NON-NLS-1$\r
} catch (final IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error seeking event. File: " + getPath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error seeking event. File: " + getPath(), e); //$NON-NLS-1$\r
} finally {\r
if (raFile != null) {\r
try {\r
rawPos = context.raFile.getFilePointer();\r
}\r
} catch (final IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error seeking event. File: " + getPath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error seeking event. File: " + getPath(), e); //$NON-NLS-1$\r
}\r
}\r
for(final Entry<InputLine, Integer> entry : countMap.entrySet())\r
import javax.xml.transform.stream.StreamResult;\r
\r
import org.eclipse.linuxtools.internal.tmf.ui.Messages;\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.w3c.dom.Document;\r
import org.w3c.dom.Element;\r
import org.w3c.dom.Node;\r
\r
protected static final String CUSTOM_TXT_TRACE_DEFINITIONS_FILE_NAME = "custom_txt_parsers.xml"; //$NON-NLS-1$\r
protected static final String CUSTOM_TXT_TRACE_DEFINITIONS_PATH_NAME =\r
- TmfUiPlugin.getDefault().getStateLocation().addTrailingSeparator().append(CUSTOM_TXT_TRACE_DEFINITIONS_FILE_NAME).toString();\r
+ Activator.getDefault().getStateLocation().addTrailingSeparator().append(CUSTOM_TXT_TRACE_DEFINITIONS_FILE_NAME).toString();\r
\r
private static final String CUSTOM_TXT_TRACE_DEFINITION_ROOT_ELEMENT = Messages.CustomTxtTraceDefinition_definitionRootElement;\r
private static final String DEFINITION_ELEMENT = Messages.CustomTxtTraceDefinition_definition;\r
writer.write(xmlString);\r
writer.close();\r
} catch (ParserConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error saving CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error saving CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
} catch (TransformerConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error saving CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error saving CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
} catch (TransformerFactoryConfigurationError e) {\r
- TmfUiPlugin.getDefault().logError("Error saving CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error saving CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
} catch (TransformerException e) {\r
- TmfUiPlugin.getDefault().logError("Error saving CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error saving CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
} catch (IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error saving CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error saving CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
} catch (SAXException e) {\r
- TmfUiPlugin.getDefault().logError("Error saving CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error saving CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
}\r
}\r
\r
}\r
return defList.toArray(new CustomTxtTraceDefinition[0]);\r
} catch (ParserConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error loading all in CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error loading all in CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
} catch (SAXException e) {\r
- TmfUiPlugin.getDefault().logError("Error loading all in CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error loading all in CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
} catch (IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error loading all in CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error loading all in CustomTxtTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
}\r
return new CustomTxtTraceDefinition[0];\r
}\r
}\r
}\r
} catch (ParserConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error loading CustomTxtTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error loading CustomTxtTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
} catch (SAXException e) {\r
- TmfUiPlugin.getDefault().logError("Error loading CustomTxtTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error loading CustomTxtTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
} catch (IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error loading CustomTxtTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error loading CustomTxtTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
}\r
return null;\r
}\r
writer.write(xmlString);\r
writer.close();\r
} catch (ParserConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error deleting CustomTxtTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error deleting CustomTxtTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
} catch (SAXException e) {\r
- TmfUiPlugin.getDefault().logError("Error deleting CustomTxtTraceDefinition: definitionName= " + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error deleting CustomTxtTraceDefinition: definitionName= " + definitionName, e); //$NON-NLS-1$\r
} catch (IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error deleting CustomTxtTraceDefinition: definitionName= " + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error deleting CustomTxtTraceDefinition: definitionName= " + definitionName, e); //$NON-NLS-1$\r
} catch (TransformerConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error deleting CustomTxtTraceDefinition: definitionName= " + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error deleting CustomTxtTraceDefinition: definitionName= " + definitionName, e); //$NON-NLS-1$\r
} catch (TransformerFactoryConfigurationError e) {\r
- TmfUiPlugin.getDefault().logError("Error deleting CustomTxtTraceDefinition: definitionName= " + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error deleting CustomTxtTraceDefinition: definitionName= " + definitionName, e); //$NON-NLS-1$\r
} catch (TransformerException e) {\r
- TmfUiPlugin.getDefault().logError("Error deleting CustomTxtTraceDefinition: definitionName= " + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error deleting CustomTxtTraceDefinition: definitionName= " + definitionName, e); //$NON-NLS-1$\r
}\r
}\r
}\r
\r
import org.eclipse.core.resources.IProject;\r
import org.eclipse.core.resources.IResource;\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTraceDefinition.InputAttribute;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTraceDefinition.InputElement;\r
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;\r
}\r
return context;\r
} catch (final FileNotFoundException e) {\r
- TmfUiPlugin.getDefault().logError("Error seeking event. File not found: " + getPath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error seeking event. File not found: " + getPath(), e); //$NON-NLS-1$\r
return context;\r
} catch (final IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error seeking event. File: " + getPath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error seeking event. File: " + getPath(), e); //$NON-NLS-1$\r
return context;\r
}\r
\r
context.setRank(ITmfContext.UNKNOWN_RANK);\r
return context;\r
} catch (final FileNotFoundException e) {\r
- TmfUiPlugin.getDefault().logError("Error seeking event. File not found: " + getPath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error seeking event. File not found: " + getPath(), e); //$NON-NLS-1$\r
return new CustomXmlTraceContext(NULL_LOCATION, ITmfContext.UNKNOWN_RANK);\r
} catch (final IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error seeking event. File: " + getPath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error seeking event. File: " + getPath(), e); //$NON-NLS-1$\r
return new CustomXmlTraceContext(NULL_LOCATION, ITmfContext.UNKNOWN_RANK);\r
} finally {\r
if (raFile != null) {\r
return (double) ((Long) location.getLocation()) / raFile.length();\r
}\r
} catch (final FileNotFoundException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting location ration. File not found: " + getPath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting location ration. File not found: " + getPath(), e); //$NON-NLS-1$\r
} catch (final IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting location ration. File: " + getPath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting location ration. File: " + getPath(), e); //$NON-NLS-1$\r
} finally {\r
if (raFile != null) {\r
try {\r
rawPos = context.raFile.getFilePointer();\r
}\r
} catch (final IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error pasing event. File: " + getPath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error pasing event. File: " + getPath(), e); //$NON-NLS-1$\r
\r
}\r
context.setLocation(NULL_LOCATION);\r
final Document doc = db.parse(new ByteArrayInputStream(elementBuffer.toString().getBytes()));\r
return doc.getDocumentElement();\r
} catch (final ParserConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error parsing element buffer. File:" + getPath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error parsing element buffer. File:" + getPath(), e); //$NON-NLS-1$\r
} catch (final SAXException e) {\r
- TmfUiPlugin.getDefault().logError("Error parsing element buffer. File:" + getPath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error parsing element buffer. File:" + getPath(), e); //$NON-NLS-1$\r
} catch (final IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error parsing element buffer. File: " + getPath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error parsing element buffer. File: " + getPath(), e); //$NON-NLS-1$\r
}\r
return null;\r
}\r
import javax.xml.transform.stream.StreamResult;\r
\r
import org.eclipse.linuxtools.internal.tmf.ui.Messages;\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.w3c.dom.Document;\r
import org.w3c.dom.Element;\r
import org.w3c.dom.Node;\r
\r
protected static final String CUSTOM_XML_TRACE_DEFINITIONS_FILE_NAME = "custom_xml_parsers.xml"; //$NON-NLS-1$\r
protected static final String CUSTOM_XML_TRACE_DEFINITIONS_PATH_NAME =\r
- TmfUiPlugin.getDefault().getStateLocation().addTrailingSeparator().append(CUSTOM_XML_TRACE_DEFINITIONS_FILE_NAME).toString();\r
+ Activator.getDefault().getStateLocation().addTrailingSeparator().append(CUSTOM_XML_TRACE_DEFINITIONS_FILE_NAME).toString();\r
\r
public static final String TAG_IGNORE = Messages.CustomXmlTraceDefinition_ignoreTag;\r
\r
writer.write(xmlString);\r
writer.close();\r
} catch (ParserConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error saving CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error saving CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
} catch (TransformerConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error saving CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error saving CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
} catch (TransformerFactoryConfigurationError e) {\r
- TmfUiPlugin.getDefault().logError("Error saving CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error saving CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
} catch (TransformerException e) {\r
- TmfUiPlugin.getDefault().logError("Error saving CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error saving CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
} catch (IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error saving CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error saving CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
} catch (SAXException e) {\r
- TmfUiPlugin.getDefault().logError("Error saving CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error saving CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
}\r
}\r
\r
}\r
return defList.toArray(new CustomXmlTraceDefinition[0]);\r
} catch (ParserConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error loading all in CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error loading all in CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
} catch (SAXException e) {\r
- TmfUiPlugin.getDefault().logError("Error loading all in CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error loading all in CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
} catch (IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error loading all in CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error loading all in CustomXmlTraceDefinition: path=" + path, e); //$NON-NLS-1$\r
}\r
return new CustomXmlTraceDefinition[0];\r
}\r
}\r
}\r
} catch (ParserConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error loading CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error loading CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
} catch (SAXException e) {\r
- TmfUiPlugin.getDefault().logError("Error loading CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error loading CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
} catch (IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error loading CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error loading CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
}\r
return null;\r
}\r
writer.write(xmlString);\r
writer.close();\r
} catch (ParserConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error deleteing CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error deleteing CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
} catch (SAXException e) {\r
- TmfUiPlugin.getDefault().logError("Error deleteing CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error deleteing CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
} catch (IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error deleteing CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error deleteing CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
} catch (TransformerConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error deleteing CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error deleteing CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
} catch (TransformerFactoryConfigurationError e) {\r
- TmfUiPlugin.getDefault().logError("Error deleteing CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error deleteing CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
} catch (TransformerException e) {\r
- TmfUiPlugin.getDefault().logError("Error deleteing CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error deleteing CustomXmlTraceDefinition: definitionName=" + definitionName, e); //$NON-NLS-1$\r
}\r
}\r
}\r
import org.eclipse.jface.viewers.Viewer;\r
import org.eclipse.jface.wizard.WizardPage;\r
import org.eclipse.linuxtools.internal.tmf.ui.Messages;\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTraceDefinition;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTraceDefinition.Cardinality;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTraceDefinition.InputData;\r
private static final String DEFAULT_TIMESTAMP_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS"; //$NON-NLS-1$\r
private static final String SIMPLE_DATE_FORMAT_URL = "http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html#skip-navbar_top"; //$NON-NLS-1$\r
private static final String PATTERN_URL = "http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html#sum"; //$NON-NLS-1$\r
- private static final Image lineImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/line_icon.gif"); //$NON-NLS-1$\r
- private static final Image addImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/add_button.gif"); //$NON-NLS-1$\r
- private static final Image addNextImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/addnext_button.gif"); //$NON-NLS-1$\r
- private static final Image addChildImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/addchild_button.gif"); //$NON-NLS-1$\r
- private static final Image deleteImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/delete_button.gif"); //$NON-NLS-1$\r
- private static final Image moveUpImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/moveup_button.gif"); //$NON-NLS-1$\r
- private static final Image moveDownImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/movedown_button.gif"); //$NON-NLS-1$\r
- private static final Image helpImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/help_button.gif"); //$NON-NLS-1$\r
+ private static final Image lineImage = Activator.getDefault().getImageFromPath("/icons/elcl16/line_icon.gif"); //$NON-NLS-1$\r
+ private static final Image addImage = Activator.getDefault().getImageFromPath("/icons/elcl16/add_button.gif"); //$NON-NLS-1$\r
+ private static final Image addNextImage = Activator.getDefault().getImageFromPath("/icons/elcl16/addnext_button.gif"); //$NON-NLS-1$\r
+ private static final Image addChildImage = Activator.getDefault().getImageFromPath("/icons/elcl16/addchild_button.gif"); //$NON-NLS-1$\r
+ private static final Image deleteImage = Activator.getDefault().getImageFromPath("/icons/elcl16/delete_button.gif"); //$NON-NLS-1$\r
+ private static final Image moveUpImage = Activator.getDefault().getImageFromPath("/icons/elcl16/moveup_button.gif"); //$NON-NLS-1$\r
+ private static final Image moveDownImage = Activator.getDefault().getImageFromPath("/icons/elcl16/movedown_button.gif"); //$NON-NLS-1$\r
+ private static final Image helpImage = Activator.getDefault().getImageFromPath("/icons/elcl16/help_button.gif"); //$NON-NLS-1$\r
private static final Color COLOR_BLACK = Display.getCurrent().getSystemColor(SWT.COLOR_BLACK);\r
private static final Color COLOR_LIGHT_GREEN = new Color(Display.getDefault(), 192, 255, 192);\r
private static final Color COLOR_GREEN = Display.getCurrent().getSystemColor(SWT.COLOR_GREEN);\r
\r
import org.eclipse.jface.wizard.WizardPage;\r
import org.eclipse.linuxtools.internal.tmf.ui.Messages;\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomEventsTable;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTraceDefinition.OutputColumn;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTrace;\r
\r
public class CustomTxtParserOutputWizardPage extends WizardPage {\r
\r
- private static final Image upImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/up_button.gif"); //$NON-NLS-1$\r
- private static final Image downImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/down_button.gif"); //$NON-NLS-1$\r
+ private static final Image upImage = Activator.getDefault().getImageFromPath("/icons/elcl16/up_button.gif"); //$NON-NLS-1$\r
+ private static final Image downImage = Activator.getDefault().getImageFromPath("/icons/elcl16/down_button.gif"); //$NON-NLS-1$\r
private final CustomTxtParserWizard wizard;\r
private CustomTxtTraceDefinition definition;\r
List<Output> outputs = new ArrayList<Output>();\r
definition.outputs = extractOutputs();\r
\r
try {\r
- tmpFile = TmfUiPlugin.getDefault().getStateLocation().addTrailingSeparator().append("customwizard.tmp").toFile(); //$NON-NLS-1$\r
+ tmpFile = Activator.getDefault().getStateLocation().addTrailingSeparator().append("customwizard.tmp").toFile(); //$NON-NLS-1$\r
final FileWriter writer = new FileWriter(tmpFile);\r
writer.write(wizard.inputPage.getInputText());\r
writer.close();\r
previewTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));\r
previewTable.setTrace(trace, true);\r
} catch (final TmfTraceException e) {\r
- TmfUiPlugin.getDefault().logError("Error creating CustomTxtTrace. File:" + tmpFile.getAbsolutePath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error creating CustomTxtTrace. File:" + tmpFile.getAbsolutePath(), e); //$NON-NLS-1$\r
} catch (final IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error creating CustomTxtTrace. File:" + tmpFile.getAbsolutePath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error creating CustomTxtTrace. File:" + tmpFile.getAbsolutePath(), e); //$NON-NLS-1$\r
}\r
\r
tableContainer.layout();\r
import org.eclipse.jface.viewers.Viewer;\r
import org.eclipse.jface.wizard.WizardPage;\r
import org.eclipse.linuxtools.internal.tmf.ui.Messages;\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTrace;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTraceDefinition;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTraceDefinition.InputAttribute;\r
\r
private static final String DEFAULT_TIMESTAMP_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS"; //$NON-NLS-1$\r
private static final String SIMPLE_DATE_FORMAT_URL = "http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html#skip-navbar_top"; //$NON-NLS-1$\r
- private static final Image elementImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/element_icon.gif"); //$NON-NLS-1$\r
- private static final Image addImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/add_button.gif"); //$NON-NLS-1$\r
- private static final Image addNextImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/addnext_button.gif"); //$NON-NLS-1$\r
- private static final Image addChildImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/addchild_button.gif"); //$NON-NLS-1$\r
- private static final Image addManyImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/addmany_button.gif"); //$NON-NLS-1$\r
- private static final Image deleteImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/delete_button.gif"); //$NON-NLS-1$\r
- private static final Image moveUpImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/moveup_button.gif"); //$NON-NLS-1$\r
- private static final Image moveDownImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/movedown_button.gif"); //$NON-NLS-1$\r
- private static final Image helpImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/help_button.gif"); //$NON-NLS-1$\r
+ private static final Image elementImage = Activator.getDefault().getImageFromPath("/icons/elcl16/element_icon.gif"); //$NON-NLS-1$\r
+ private static final Image addImage = Activator.getDefault().getImageFromPath("/icons/elcl16/add_button.gif"); //$NON-NLS-1$\r
+ private static final Image addNextImage = Activator.getDefault().getImageFromPath("/icons/elcl16/addnext_button.gif"); //$NON-NLS-1$\r
+ private static final Image addChildImage = Activator.getDefault().getImageFromPath("/icons/elcl16/addchild_button.gif"); //$NON-NLS-1$\r
+ private static final Image addManyImage = Activator.getDefault().getImageFromPath("/icons/elcl16/addmany_button.gif"); //$NON-NLS-1$\r
+ private static final Image deleteImage = Activator.getDefault().getImageFromPath("/icons/elcl16/delete_button.gif"); //$NON-NLS-1$\r
+ private static final Image moveUpImage = Activator.getDefault().getImageFromPath("/icons/elcl16/moveup_button.gif"); //$NON-NLS-1$\r
+ private static final Image moveDownImage = Activator.getDefault().getImageFromPath("/icons/elcl16/movedown_button.gif"); //$NON-NLS-1$\r
+ private static final Image helpImage = Activator.getDefault().getImageFromPath("/icons/elcl16/help_button.gif"); //$NON-NLS-1$\r
private static final Color COLOR_LIGHT_RED = new Color(Display.getDefault(), 255, 192, 192);\r
private static final Color COLOR_TEXT_BACKGROUND = Display.getCurrent().getSystemColor(SWT.COLOR_WHITE);\r
private static final Color COLOR_WIDGET_BACKGROUND = Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);\r
doc = db.parse(new ByteArrayInputStream(string.getBytes()));\r
documentElement = doc.getDocumentElement();\r
} catch (ParserConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error pasing XML input string: " + string, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error pasing XML input string: " + string, e); //$NON-NLS-1$\r
documentElement = null;\r
} catch (SAXException e) {\r
documentElement = null;\r
} catch (IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error pasing XML input string: " + string, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error pasing XML input string: " + string, e); //$NON-NLS-1$\r
documentElement = null;\r
}\r
}\r
\r
import org.eclipse.jface.wizard.WizardPage;\r
import org.eclipse.linuxtools.internal.tmf.ui.Messages;\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomEventsTable;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTraceDefinition;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTraceDefinition.OutputColumn;\r
\r
public class CustomXmlParserOutputWizardPage extends WizardPage {\r
\r
- private static final Image upImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/up_button.gif"); //$NON-NLS-1$\r
- private static final Image downImage = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/down_button.gif"); //$NON-NLS-1$\r
+ private static final Image upImage = Activator.getDefault().getImageFromPath("/icons/elcl16/up_button.gif"); //$NON-NLS-1$\r
+ private static final Image downImage = Activator.getDefault().getImageFromPath("/icons/elcl16/down_button.gif"); //$NON-NLS-1$\r
private final CustomXmlParserWizard wizard;\r
private CustomXmlTraceDefinition definition;\r
List<Output> outputs = new ArrayList<Output>();\r
definition.outputs = extractOutputs();\r
\r
try {\r
- tmpFile = TmfUiPlugin.getDefault().getStateLocation().addTrailingSeparator().append("customwizard.tmp").toFile(); //$NON-NLS-1$\r
+ tmpFile = Activator.getDefault().getStateLocation().addTrailingSeparator().append("customwizard.tmp").toFile(); //$NON-NLS-1$\r
final FileWriter writer = new FileWriter(tmpFile);\r
writer.write(wizard.inputPage.getInputText());\r
writer.close();\r
previewTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));\r
previewTable.setTrace(trace, true);\r
} catch (final TmfTraceException e) {\r
- TmfUiPlugin.getDefault().logError("Error creating CustomXmlTrace. File:" + tmpFile.getAbsolutePath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error creating CustomXmlTrace. File:" + tmpFile.getAbsolutePath(), e); //$NON-NLS-1$\r
} catch (final IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error creating CustomXmlTrace. File:" + tmpFile.getAbsolutePath(), e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error creating CustomXmlTrace. File:" + tmpFile.getAbsolutePath(), e); //$NON-NLS-1$\r
}\r
\r
tableContainer.layout();\r
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentElement;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceElement;
import org.eclipse.ui.IWorkbenchPage;
handlerService.executeCommand(DELETE_EXPERIMENT_COMMAND_ID, null);
}
} catch (ExecutionException e) {
- TmfUiPlugin.getDefault().logError("Error deleting resources", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error deleting resources", e); //$NON-NLS-1$
} catch (NotDefinedException e) {
- TmfUiPlugin.getDefault().logError("Error deleting resources", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error deleting resources", e); //$NON-NLS-1$
} catch (NotEnabledException e) {
- TmfUiPlugin.getDefault().logError("Error deleting resources", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error deleting resources", e); //$NON-NLS-1$
} catch (NotHandledException e) {
- TmfUiPlugin.getDefault().logError("Error deleting resources", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error deleting resources", e); //$NON-NLS-1$
}
}
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentElement;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MessageBox;
resource.delete(true, null);
experiment.getProject().refresh();
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error deleting experiment: " + experiment.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error deleting experiment: " + experiment.getName(), e); //$NON-NLS-1$
}
}
}
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.window.Window;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.internal.tmf.ui.project.dialogs.SelectSupplementaryResourcesDialog;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentElement;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceElement;
try {
resourcesToDelete[i].delete(true, new NullProgressMonitor());
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error deleting supplementary resource " + resourcesToDelete[i], e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error deleting supplementary resource " + resourcesToDelete[i], e); //$NON-NLS-1$
}
}
resource.refreshLocal(IResource.DEPTH_INFINITE, null);
}
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error refreshing resource " + resource, e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error refreshing resource " + resource, e); //$NON-NLS-1$
}
}
}
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentFolder;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceElement;
trace.getProject().refresh();
} catch (IOException e) {
- TmfUiPlugin.getDefault().logError("Error deleting trace: " + trace.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error deleting trace: " + trace.getName(), e); //$NON-NLS-1$
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error deleting trace: " + trace.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error deleting trace: " + trace.getName(), e); //$NON-NLS-1$
}
}
}
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.window.Window;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.internal.tmf.ui.project.dialogs.SelectSupplementaryResourcesDialog;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceElement;
import org.eclipse.ui.IWorkbenchPage;
resource.refreshLocal(IResource.DEPTH_INFINITE, null);
}
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error refreshing resource " + resource, e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error refreshing resource " + resource, e); //$NON-NLS-1$
}
}
}
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;
import org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement;
setProperties(folder, bundleName, traceType, iconUrl, supplFolder);
} else {
- TmfUiPlugin.getDefault().logError("Invalid Trace Location"); //$NON-NLS-1$
+ Activator.getDefault().logError("Invalid Trace Location"); //$NON-NLS-1$
}
} else {
IFile file = parentFolder.getFile(resource.getName());
file.createLink(location, IResource.REPLACE, null);
setProperties(file, bundleName, traceType, iconUrl, supplFolder);
} else {
- TmfUiPlugin.getDefault().logError("Invalid Trace Location"); //$NON-NLS-1$
+ Activator.getDefault().logError("Invalid Trace Location"); //$NON-NLS-1$
}
}
} catch (CoreException e) {
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentElement;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectModelElement;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceElement;
handlerService.executeCommand(OPEN_EXPERIMENT_COMMAND_ID, null);
}
} catch (ExecutionException e) {
- TmfUiPlugin.getDefault().logError("Error opening resource " + element.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error opening resource " + element.getName(), e); //$NON-NLS-1$
} catch (NotDefinedException e) {
- TmfUiPlugin.getDefault().logError("Error opening resource " + element.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error opening resource " + element.getName(), e); //$NON-NLS-1$
} catch (NotEnabledException e) {
- TmfUiPlugin.getDefault().logError("Error opening resource " + element.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error opening resource " + element.getName(), e); //$NON-NLS-1$
} catch (NotHandledException e) {
- TmfUiPlugin.getDefault().logError("Error opening resource " + element.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error opening resource " + element.getName(), e); //$NON-NLS-1$
}
}
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
else
file.setPersistentProperty(TmfCommonConstants.TRACETYPE, TmfTrace.class.getCanonicalName());
} catch (final CoreException e) {
- TmfUiPlugin.getDefault().logError("Error opening trace " + fTrace.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error opening trace " + fTrace.getName(), e); //$NON-NLS-1$
}
if (usesEditor)
IDE.setDefaultEditor((IFile) resource, editorId);
}
} catch (final PartInitException e) {
- TmfUiPlugin.getDefault().logError("Error opening trace " + fTrace.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error opening trace " + fTrace.getName(), e); //$NON-NLS-1$
}
else {
// Create the experiment
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentElement;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentFolder;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectModelElement;
handlerService.executeCommand(REFRESH_EXPERIMENT_COMMAND_ID, null);
}
} catch (ExecutionException e) {
- TmfUiPlugin.getDefault().logError("Error refreshing resource " + element.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error refreshing resource " + element.getName(), e); //$NON-NLS-1$
} catch (NotDefinedException e) {
- TmfUiPlugin.getDefault().logError("Error refreshing resource " + element.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error refreshing resource " + element.getName(), e); //$NON-NLS-1$
} catch (NotEnabledException e) {
- TmfUiPlugin.getDefault().logError("Error refreshing resource " + element.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error refreshing resource " + element.getName(), e); //$NON-NLS-1$
} catch (NotHandledException e) {
- TmfUiPlugin.getDefault().logError("Error refreshing resource " + element.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error refreshing resource " + element.getName(), e); //$NON-NLS-1$
}
}
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentElement;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentFolder;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceFolder;
resource.refreshLocal(IResource.DEPTH_INFINITE, null);
}
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error refreshing projects", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error refreshing projects", e); //$NON-NLS-1$
}
}
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.window.Window;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
import org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentFolder;
folder.setPersistentProperty(TmfCommonConstants.TRACEICON, traceIcon);
}
else {
- TmfUiPlugin.getDefault().logError("RenamaeTraceHandler: Invalid Trace Location: " + location); //$NON-NLS-1$
+ Activator.getDefault().logError("RenamaeTraceHandler: Invalid Trace Location: " + location); //$NON-NLS-1$
}
}
else {
file.setPersistentProperty(TmfCommonConstants.TRACEICON, traceIcon);
}
else {
- TmfUiPlugin.getDefault().logError("RenamaeTraceHandler: Invalid Trace Location: " + location); //$NON-NLS-1$
+ Activator.getDefault().logError("RenamaeTraceHandler: Invalid Trace Location: " + location); //$NON-NLS-1$
}
}
experiment.refresh();
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error renaming trace" + trace.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error renaming trace" + trace.getName(), e); //$NON-NLS-1$
}
}
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTrace;
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTraceDefinition;
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTrace;
public class SelectTraceTypeContributionItem extends CompoundContributionItem {
//private static final ImageDescriptor SELECTED_ICON = ImageDescriptor.createFromImage(TmfUiPlugin.getDefault().getImageFromPath("icons/elcl16/bullet.gif")); //$NON-NLS-1$
- private static final ImageDescriptor SELECTED_ICON = TmfUiPlugin.getDefault().getImageDescripterFromPath(
+ private static final ImageDescriptor SELECTED_ICON = Activator.getDefault().getImageDescripterFromPath(
"icons/elcl16/bullet.gif"); //$NON-NLS-1$
private static final String BUNDLE_PARAMETER = "org.eclipse.linuxtools.tmf.ui.commandparameter.project.trace.select_trace_type.bundle"; //$NON-NLS-1$
private static final String TYPE_PARAMETER = "org.eclipse.linuxtools.tmf.ui.commandparameter.project.trace.select_trace_type.type"; //$NON-NLS-1$
// add the custom trace types
for (CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
- String traceBundle = TmfUiPlugin.getDefault().getBundle().getSymbolicName();
+ String traceBundle = Activator.getDefault().getBundle().getSymbolicName();
String traceTypeId = CustomTxtTrace.class.getCanonicalName() + ":" + def.definitionName; //$NON-NLS-1$
String traceIcon = DEFAULT_TRACE_ICON_PATH;
String label = def.definitionName;
addContributionItem(list, traceBundle, traceTypeId, traceIcon, label, selected, subMenu);
}
for (CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {
- String traceBundle = TmfUiPlugin.getDefault().getBundle().getSymbolicName();
+ String traceBundle = Activator.getDefault().getBundle().getSymbolicName();
String traceTypeId = CustomXmlTrace.class.getCanonicalName() + ":" + def.definitionName; //$NON-NLS-1$
String traceIcon = DEFAULT_TRACE_ICON_PATH;
String label = def.definitionName;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
import org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement;
String iconUrl = event.getParameter(ICON_PARAMETER);
ok &= propagateProperties(trace, bundleName, traceType, iconUrl);
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error selecting trace type for trace" + trace.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error selecting trace type for trace" + trace.getName(), e); //$NON-NLS-1$
}
}
}
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.InvalidRegistryObjectException;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.internal.tmf.ui.project.handlers.Messages;
import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
}
}
} catch (final InvalidRegistryObjectException e) {
- TmfUiPlugin.getDefault().logError("Error initializing EventsViewEditor", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error initializing EventsViewEditor", e); //$NON-NLS-1$
} catch (final CoreException e) {
- TmfUiPlugin.getDefault().logError("Error initializing EventsViewEditor", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error initializing EventsViewEditor", e); //$NON-NLS-1$
}
input = new TmfEditorInput(fFile, fTrace);
} else
adapter.gotoMarker(fGotoMarker);
}
} catch (final PartInitException e) {
- TmfUiPlugin.getDefault().logError("Error setting focus", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error setting focus", e); //$NON-NLS-1$
}
}
});
import org.eclipse.core.runtime.IProgressMonitor;\r
import org.eclipse.core.runtime.InvalidRegistryObjectException;\r
import org.eclipse.core.runtime.Platform;\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomEventsTable;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTrace;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTrace;\r
}\r
}\r
} catch (final InvalidRegistryObjectException e) {\r
- TmfUiPlugin.getDefault().logError("Error initializing TmfEventsEditor", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error initializing TmfEventsEditor", e); //$NON-NLS-1$\r
} catch (final CoreException e) {\r
- TmfUiPlugin.getDefault().logError("Error initializing TmfEventsEditor", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error initializing TmfEventsEditor", e); //$NON-NLS-1$\r
}\r
} else\r
throw new PartInitException("Invalid IEditorInput: " + input.getClass()); //$NON-NLS-1$\r
break;\r
}\r
} catch (final InvalidRegistryObjectException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
} catch (final CoreException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
} catch (final ClassNotFoundException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
} catch (final SecurityException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
} catch (final NoSuchMethodException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
} catch (final IllegalArgumentException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
} catch (final InstantiationException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
} catch (final IllegalAccessException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
} catch (final InvocationTargetException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable", e); //$NON-NLS-1$\r
}\r
return eventsTable;\r
}\r
break;\r
}\r
} catch (final CoreException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
} catch (final InvalidRegistryObjectException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
} catch (final SecurityException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
} catch (final IllegalArgumentException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
} catch (final ClassNotFoundException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
} catch (final NoSuchMethodException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
} catch (final InstantiationException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
} catch (final IllegalAccessException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
} catch (final InvocationTargetException e) {\r
- TmfUiPlugin.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error getting TmfEventsTable for experiment", e); //$NON-NLS-1$\r
}\r
return eventsTable;\r
}\r
break;\r
}\r
} catch (final InvalidRegistryObjectException e) {\r
- TmfUiPlugin.getDefault().logError("Error handling signal TmfTraceParserUpdatedSignal", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error handling signal TmfTraceParserUpdatedSignal", e); //$NON-NLS-1$\r
} catch (final TmfTraceException e) {\r
- TmfUiPlugin.getDefault().logError("Error handling signal TmfTraceParserUpdatedSignal", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error handling signal TmfTraceParserUpdatedSignal", e); //$NON-NLS-1$\r
} catch (final CoreException e) {\r
- TmfUiPlugin.getDefault().logError("Error handling signal TmfTraceParserUpdatedSignal", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error handling signal TmfTraceParserUpdatedSignal", e); //$NON-NLS-1$\r
}\r
fEventsTable.dispose();\r
if (fTrace != null) {\r
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IMemento;
// ------------------------------------------------------------------------
public TmfNavigatorLabelProvider() {
- Bundle bundle = TmfUiPlugin.getDefault().getBundle();
+ Bundle bundle = Activator.getDefault().getBundle();
fDefaultTraceIcon = loadIcon(bundle, fTraceIconFile);
fExperimentIcon = loadIcon(bundle, fExperimentIconFile);
}
private Image loadIcon(Bundle bundle, String url) {
- TmfUiPlugin plugin = TmfUiPlugin.getDefault();
+ Activator plugin = Activator.getDefault();
String key = bundle.getSymbolicName() + "/" + url; //$NON-NLS-1$
Image icon = plugin.getImageRegistry().get(key);
if (icon == null) {
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
/**
try {
supplFolderParent.create(true, true, new NullProgressMonitor());
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error creating project specific supplementary folder " + supplFolderParent, e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating project specific supplementary folder " + supplFolderParent, e); //$NON-NLS-1$
}
}
return supplFolderParent;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtEvent;
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTrace;
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTraceDefinition;
try {
fTraceTypeId = getResource().getPersistentProperty(TmfCommonConstants.TRACETYPE);
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error refreshing trace type pesistent property for trace " + getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error refreshing trace type pesistent property for trace " + getName(), e); //$NON-NLS-1$
}
}
return trace;
}
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error instantiating ITmfTrace object for trace " + getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error instantiating ITmfTrace object for trace " + getName(), e); //$NON-NLS-1$
}
return null;
}
return event;
}
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error instantiating ITmfEvent object for trace " + getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error instantiating ITmfEvent object for trace " + getName(), e); //$NON-NLS-1$
}
return null;
}
try {
supplFolder.delete(true, new NullProgressMonitor());
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error deleting supplementary folder " + supplFolder, e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error deleting supplementary folder " + supplFolder, e); //$NON-NLS-1$
}
}
}
try {
oldSupplFolder.move(newSupplFolder.getFullPath(), true, new NullProgressMonitor());
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error renaming supplementary folder " + oldSupplFolder, e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error renaming supplementary folder " + oldSupplFolder, e); //$NON-NLS-1$
}
}
}
try {
oldSupplFolder.copy(newSupplFolder.getFullPath(), true, new NullProgressMonitor());
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error renaming supplementary folder " + oldSupplFolder, e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error renaming supplementary folder " + oldSupplFolder, e); //$NON-NLS-1$
}
}
}
try {
oldSupplFolder.copy(destination.getFullPath(), true, new NullProgressMonitor());
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error copying supplementary folder " + oldSupplFolder, e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error copying supplementary folder " + oldSupplFolder, e); //$NON-NLS-1$
}
}
}
try {
return supplFolder.members();
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error deleting supplementary folder " + supplFolder, e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error deleting supplementary folder " + supplFolder, e); //$NON-NLS-1$
}
}
return new IResource[0];
try {
resources[i].delete(true, new NullProgressMonitor());
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error deleting supplementary resource " + resources[i], e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error deleting supplementary resource " + resources[i], e); //$NON-NLS-1$
}
}
}
try {
supplFolder.create(true, true, new NullProgressMonitor());
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error creating resource supplementary file " + supplFolder, e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating resource supplementary file " + supplFolder, e); //$NON-NLS-1$
}
}
try {
fResource.setPersistentProperty(TmfCommonConstants.TRACE_SUPPLEMENTARY_FOLDER, supplFolder.getLocationURI().getPath());
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error setting persistant property " + TmfCommonConstants.TRACE_SUPPLEMENTARY_FOLDER, e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error setting persistant property " + TmfCommonConstants.TRACE_SUPPLEMENTARY_FOLDER, e); //$NON-NLS-1$
}
}
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
import org.eclipse.linuxtools.tmf.core.trace.TmfExperiment;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentElement;
IStatus nameStatus = workspace.validateName(name, IResource.FOLDER);
if ("".equals(name)) { //$NON-NLS-1$
- updateStatus(new Status(IStatus.ERROR, TmfUiPlugin.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_EmptyNameError, null));
+ updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_EmptyNameError, null));
return;
}
IPath path = new Path(name);
if (fExperimentFolder.getFolder(path).exists() || fExperimentFolder.getFile(path).exists()) {
- updateStatus(new Status(IStatus.ERROR, TmfUiPlugin.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_ExistingNameError, null));
+ updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_ExistingNameError, null));
return;
}
- updateStatus(new Status(IStatus.OK, TmfUiPlugin.PLUGIN_ID, "")); //$NON-NLS-1$
+ updateStatus(new Status(IStatus.OK, Activator.PLUGIN_ID, "")); //$NON-NLS-1$
}
// ------------------------------------------------------------------------
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectElement;
IStatus nameStatus = workspace.validateName(name, IResource.FOLDER);
if ("".equals(name)) { //$NON-NLS-1$
- updateStatus(new Status(IStatus.ERROR, TmfUiPlugin.PLUGIN_ID, IStatus.ERROR,
+ updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR,
Messages.Dialog_EmptyNameError, null));
return;
}
IPath path = new Path(name);
if (fTraceFolder.getFolder(path).exists() || fTraceFolder.getFile(path).exists()) {
- updateStatus(new Status(IStatus.ERROR, TmfUiPlugin.PLUGIN_ID, IStatus.ERROR,
+ updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR,
Messages.Dialog_ExistingNameError, null));
return;
}
- updateStatus(new Status(IStatus.OK, TmfUiPlugin.PLUGIN_ID, "")); //$NON-NLS-1$
+ updateStatus(new Status(IStatus.OK, Activator.PLUGIN_ID, "")); //$NON-NLS-1$
}
// ------------------------------------------------------------------------
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.ui.IImportWizard;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.ide.IDE;
// Constants
// ------------------------------------------------------------------------
- static private final String PLUGIN_ID = TmfUiPlugin.PLUGIN_ID;
+ static private final String PLUGIN_ID = Activator.PLUGIN_ID;
static private final String IMPORT_WIZARD = "ImportTraceWizard"; //$NON-NLS-1$
static private final String ICON_PATH = "icons/wizban/trace_import_wiz.png"; //$NON-NLS-1$
// ------------------------------------------------------------------------
public ImportTraceWizard() {
- IDialogSettings workbenchSettings = TmfUiPlugin.getDefault().getDialogSettings();
+ IDialogSettings workbenchSettings = Activator.getDefault().getDialogSettings();
IDialogSettings section = workbenchSettings.getSection(IMPORT_WIZARD);
if (section == null) {
section = workbenchSettings.addNewSection(IMPORT_WIZARD);
}
setWindowTitle(Messages.ImportTraceWizard_DialogTitle);
- setDefaultPageImageDescriptor(TmfUiPlugin.imageDescriptorFromPlugin(PLUGIN_ID, ICON_PATH));
+ setDefaultPageImageDescriptor(Activator.imageDescriptorFromPlugin(PLUGIN_ID, ICON_PATH));
setNeedsProgressMonitor(true);
}
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTrace;
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTraceDefinition;
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTrace;
IContainer container = getSpecifiedContainer();
if (container != null && container.isVirtual()) {
- if (Platform.getPreferencesService().getBoolean(TmfUiPlugin.PLUGIN_ID, ResourcesPlugin.PREF_DISABLE_LINKING, false, null)) {
+ if (Platform.getPreferencesService().getBoolean(Activator.PLUGIN_ID, ResourcesPlugin.PREF_DISABLE_LINKING, false, null)) {
setMessage(null);
setErrorMessage(Messages.ImportTraceWizard_CannotImportFilesUnderAVirtualFolder);
return false;
for (CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
if (traceType.equals(CUSTOM_TXT_CATEGORY + " : " + def.definitionName)) { //$NON-NLS-1$
traceTypeOK = true;
- traceBundle = TmfUiPlugin.getDefault().getBundle().getSymbolicName();
+ traceBundle = Activator.getDefault().getBundle().getSymbolicName();
traceTypeId = CustomTxtTrace.class.getCanonicalName() + ":" + def.definitionName; //$NON-NLS-1$
traceIcon = DEFAULT_TRACE_ICON_PATH;
break;
for (CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {
if (traceType.equals(CUSTOM_XML_CATEGORY + " : " + def.definitionName)) { //$NON-NLS-1$
traceTypeOK = true;
- traceBundle = TmfUiPlugin.getDefault().getBundle().getSymbolicName();
+ traceBundle = Activator.getDefault().getBundle().getSymbolicName();
traceTypeId = CustomXmlTrace.class.getCanonicalName() + ":" + def.definitionName; //$NON-NLS-1$
traceIcon = DEFAULT_TRACE_ICON_PATH;
break;
}
}
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error importing trace resource " + resource.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error importing trace resource " + resource.getName(), e); //$NON-NLS-1$
}
}
}
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentFolder;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectElement;
import org.eclipse.osgi.util.NLS;
IStatus nameStatus = workspace.validateName(name, IResource.FOLDER);
if ("".equals(name)) { //$NON-NLS-1$
- updateStatus(new Status(IStatus.ERROR, TmfUiPlugin.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_EmptyNameError, null));
+ updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_EmptyNameError, null));
return;
}
IPath path = new Path(name);
if (fExperimentFolder.getFolder(path).exists() || fExperimentFolder.getFile(path).exists()) {
- updateStatus(new Status(IStatus.ERROR, TmfUiPlugin.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_ExistingNameError, null));
+ updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_ExistingNameError, null));
return;
}
- updateStatus(new Status(IStatus.OK, TmfUiPlugin.PLUGIN_ID, "")); //$NON-NLS-1$
+ updateStatus(new Status(IStatus.OK, Activator.PLUGIN_ID, "")); //$NON-NLS-1$
}
// ------------------------------------------------------------------------
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
import org.eclipse.linuxtools.tmf.core.TmfProjectNature;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentFolder;
*/
public NewTmfProjectWizard(String title, String desc) {
super();
- setDialogSettings(TmfUiPlugin.getDefault().getDialogSettings());
+ setDialogSettings(Activator.getDefault().getDialogSettings());
setNeedsProgressMonitor(true);
setForcePreviousAndNextButtons(true);
setWindowTitle(title);
return project;
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error creating TMF project " + project.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating TMF project " + project.getName(), e); //$NON-NLS-1$
}
return null;
}
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentElement;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentFolder;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectElement;
IStatus nameStatus = workspace.validateName(name, IResource.FOLDER);
if ("".equals(name)) { //$NON-NLS-1$
- updateStatus(new Status(IStatus.ERROR, TmfUiPlugin.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_EmptyNameError, null));
+ updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_EmptyNameError, null));
return;
}
IPath path = new Path(name);
if (fExperimentFolder.getFolder(path).exists() || fExperimentFolder.getFile(path).exists()) {
- updateStatus(new Status(IStatus.ERROR, TmfUiPlugin.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_ExistingNameError, null));
+ updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.Dialog_ExistingNameError, null));
return;
}
- updateStatus(new Status(IStatus.OK, TmfUiPlugin.PLUGIN_ID, "")); //$NON-NLS-1$
+ updateStatus(new Status(IStatus.OK, Activator.PLUGIN_ID, "")); //$NON-NLS-1$
}
// ------------------------------------------------------------------------
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfProjectElement;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceElement;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceFolder;
IStatus nameStatus = workspace.validateName(fNewTraceName, IResource.FOLDER);
if ("".equals(fNewTraceName)) { //$NON-NLS-1$
- updateStatus(new Status(IStatus.ERROR, TmfUiPlugin.PLUGIN_ID, IStatus.ERROR,
+ updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR,
Messages.Dialog_EmptyNameError, null));
return;
}
IPath path = new Path(fNewTraceName);
if (fTraceFolder.getFolder(path).exists() || fTraceFolder.getFile(path).exists()) {
- updateStatus(new Status(IStatus.ERROR, TmfUiPlugin.PLUGIN_ID, IStatus.ERROR,
+ updateStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR,
Messages.Dialog_ExistingNameError, null));
return;
}
- updateStatus(new Status(IStatus.OK, TmfUiPlugin.PLUGIN_ID, "")); //$NON-NLS-1$
+ updateStatus(new Status(IStatus.OK, Activator.PLUGIN_ID, "")); //$NON-NLS-1$
}
// ------------------------------------------------------------------------
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
import org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement;
import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentElement;
try {
resource.delete(true, null);
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error selecting traces for experiment " + experiment.getName(), e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error selecting traces for experiment " + experiment.getName(), e); //$NON-NLS-1$
}
}
fProject.refresh();
setProperties(folder, bundleName, traceType, iconUrl);
} else {
- TmfUiPlugin.getDefault().logError("Error creating link. Invalid trace location " + location); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating link. Invalid trace location " + location); //$NON-NLS-1$
}
} else {
IFile file = experiment.getFile(trace.getName());
file.createLink(location, IResource.REPLACE, null);
setProperties(file, bundleName, traceType, iconUrl);
} else {
- TmfUiPlugin.getDefault().logError("Error creating link. Invalid trace location " + location); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating link. Invalid trace location " + location); //$NON-NLS-1$
}
}
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error creating link to location " + location, e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating link to location " + location, e); //$NON-NLS-1$
}
}
import org.eclipse.core.runtime.IStatus;\r
import org.eclipse.core.runtime.Status;\r
import org.eclipse.core.runtime.jobs.Job;\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.eclipse.linuxtools.tmf.core.component.ITmfDataProvider;\r
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;\r
import org.eclipse.linuxtools.tmf.core.filter.ITmfFilter;\r
request.waitForCompletion();\r
return ((DataRequest<ITmfEvent>) request).getFilteredIndex();\r
} catch (InterruptedException e) {\r
- TmfUiPlugin.getDefault().logError("Filter request interrupted!", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Filter request interrupted!", e); //$NON-NLS-1$\r
}\r
return 0;\r
}\r
try {\r
request.waitForCompletion();\r
} catch (InterruptedException e) {\r
- TmfUiPlugin.getDefault().logError("Wait for completion interrupted for populateCache ", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Wait for completion interrupted for populateCache ", e); //$NON-NLS-1$\r
}\r
\r
fTable.cacheUpdated(true);\r
import org.eclipse.jface.resource.JFaceResources;\r
import org.eclipse.jface.resource.LocalResourceManager;\r
import org.eclipse.linuxtools.internal.tmf.ui.Messages;\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.eclipse.linuxtools.tmf.core.component.ITmfDataProvider;\r
import org.eclipse.linuxtools.tmf.core.component.TmfComponent;\r
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;\r
public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorSettingsListener,\r
ITmfEventsFilterProvider {\r
\r
- private static final Image BOOKMARK_IMAGE = TmfUiPlugin.getDefault().getImageFromPath(\r
+ private static final Image BOOKMARK_IMAGE = Activator.getDefault().getImageFromPath(\r
"icons/elcl16/bookmark_obj.gif"); //$NON-NLS-1$\r
- private static final Image SEARCH_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("icons/elcl16/search.gif"); //$NON-NLS-1$\r
- private static final Image SEARCH_MATCH_IMAGE = TmfUiPlugin.getDefault().getImageFromPath(\r
+ private static final Image SEARCH_IMAGE = Activator.getDefault().getImageFromPath("icons/elcl16/search.gif"); //$NON-NLS-1$\r
+ private static final Image SEARCH_MATCH_IMAGE = Activator.getDefault().getImageFromPath(\r
"icons/elcl16/search_match.gif"); //$NON-NLS-1$\r
- private static final Image SEARCH_MATCH_BOOKMARK_IMAGE = TmfUiPlugin.getDefault().getImageFromPath(\r
+ private static final Image SEARCH_MATCH_BOOKMARK_IMAGE = Activator.getDefault().getImageFromPath(\r
"icons/elcl16/search_match_bookmark.gif"); //$NON-NLS-1$\r
- private static final Image FILTER_IMAGE = TmfUiPlugin.getDefault()\r
+ private static final Image FILTER_IMAGE = Activator.getDefault()\r
.getImageFromPath("icons/elcl16/filter_items.gif"); //$NON-NLS-1$\r
- private static final Image STOP_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("icons/elcl16/stop.gif"); //$NON-NLS-1$\r
+ private static final Image STOP_IMAGE = Activator.getDefault().getImageFromPath("icons/elcl16/stop.gif"); //$NON-NLS-1$\r
private static final String SEARCH_HINT = Messages.TmfEventsTable_SearchHint;\r
private static final String FILTER_HINT = Messages.TmfEventsTable_FilterHint;\r
private static final int MAX_CACHE_SIZE = 1000;\r
import java.util.Arrays;\r
import java.util.List;\r
\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;\r
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.TimeGraphColorScheme;\r
import org.eclipse.swt.SWT;\r
\r
private static final String COLOR_SETTINGS_FILE_NAME = "color_settings.xml"; //$NON-NLS-1$\r
private static final String COLOR_SETTINGS_PATH_NAME =\r
- TmfUiPlugin.getDefault().getStateLocation().addTrailingSeparator().append(COLOR_SETTINGS_FILE_NAME).toString();\r
+ Activator.getDefault().getStateLocation().addTrailingSeparator().append(COLOR_SETTINGS_FILE_NAME).toString();\r
private static final ColorSetting DEFAULT_COLOR_SETTING = new ColorSetting(\r
Display.getDefault().getSystemColor(SWT.COLOR_LIST_FOREGROUND).getRGB(),\r
Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB(),\r
import javax.xml.transform.dom.DOMSource;\r
import javax.xml.transform.stream.StreamResult;\r
\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.eclipse.linuxtools.tmf.core.filter.model.ITmfFilterTreeNode;\r
import org.eclipse.linuxtools.tmf.core.filter.xml.TmfFilterContentHandler;\r
import org.eclipse.linuxtools.tmf.core.filter.xml.TmfFilterXMLWriter;\r
StreamResult result = new StreamResult(new File(pathName));\r
transformer.transform(source, result);\r
} catch (ParserConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error saving color xml file: " + pathName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error saving color xml file: " + pathName, e); //$NON-NLS-1$\r
} catch (TransformerConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error saving color xml file: " + pathName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error saving color xml file: " + pathName, e); //$NON-NLS-1$\r
} catch (TransformerException e) {\r
- TmfUiPlugin.getDefault().logError("Error saving color xml file: " + pathName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error saving color xml file: " + pathName, e); //$NON-NLS-1$\r
}\r
}\r
\r
saxReader.parse(pathName);\r
return handler.colorSettings.toArray(new ColorSetting[0]);\r
} catch (ParserConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error loading color xml file: " + pathName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error loading color xml file: " + pathName, e); //$NON-NLS-1$\r
} catch (SAXException e) {\r
- TmfUiPlugin.getDefault().logError("Error loading color xml file: " + pathName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error loading color xml file: " + pathName, e); //$NON-NLS-1$\r
} catch (IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error loading color xml file: " + pathName, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error loading color xml file: " + pathName, e); //$NON-NLS-1$\r
}\r
// In case of error, dispose the partial list of color settings\r
for (ColorSetting colorSetting : handler.colorSettings) {\r
import org.eclipse.jface.dialogs.MessageDialog;\r
import org.eclipse.jface.resource.ImageDescriptor;\r
import org.eclipse.linuxtools.internal.tmf.ui.Messages;\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.eclipse.linuxtools.tmf.ui.views.TmfView;\r
import org.eclipse.linuxtools.tmf.ui.views.filter.FilterDialog;\r
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.TimeGraphColorScheme;\r
\r
public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.colors"; //$NON-NLS-1$\r
\r
- private static final Image ADD_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/add_button.gif"); //$NON-NLS-1$\r
- private static final Image DELETE_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/delete_button.gif"); //$NON-NLS-1$\r
- private static final Image MOVE_UP_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/moveup_button.gif"); //$NON-NLS-1$\r
- private static final Image MOVE_DOWN_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/movedown_button.gif"); //$NON-NLS-1$\r
- private static final Image IMPORT_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/import_button.gif"); //$NON-NLS-1$\r
- private static final Image EXPORT_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/export_button.gif"); //$NON-NLS-1$\r
+ private static final Image ADD_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/add_button.gif"); //$NON-NLS-1$\r
+ private static final Image DELETE_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/delete_button.gif"); //$NON-NLS-1$\r
+ private static final Image MOVE_UP_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/moveup_button.gif"); //$NON-NLS-1$\r
+ private static final Image MOVE_DOWN_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/movedown_button.gif"); //$NON-NLS-1$\r
+ private static final Image IMPORT_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/import_button.gif"); //$NON-NLS-1$\r
+ private static final Image EXPORT_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/export_button.gif"); //$NON-NLS-1$\r
\r
// ------------------------------------------------------------------------\r
// Main data structures\r
public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.environment"; //$NON-NLS-1$
private TmfExperiment<?> fExperiment;
private Table fTable;
- final private String fTitlePrefix;
+// final private String fTitlePrefix;
private Composite fParent;
public TmfEnvironmentView() {
super("EnvironmentVariables"); //$NON-NLS-1$
- fTitlePrefix = getTitle();
+// fTitlePrefix = getTitle();
}
// ------------------------------------------------------------------------
}
@Override
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({ "unchecked", "rawtypes" })
public void createPartControl(Composite parent) {
fParent = parent;
TableItem ti[];
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.InvalidRegistryObjectException;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomEventsTable;
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTrace;
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTrace;
}
}
} catch (CoreException e) {
- TmfUiPlugin.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
} catch (InvalidRegistryObjectException e) {
- TmfUiPlugin.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
} catch (SecurityException e) {
- TmfUiPlugin.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
} catch (IllegalArgumentException e) {
- TmfUiPlugin.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
} catch (ClassNotFoundException e) {
- TmfUiPlugin.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
} catch (NoSuchMethodException e) {
- TmfUiPlugin.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
} catch (InstantiationException e) {
- TmfUiPlugin.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
} catch (IllegalAccessException e) {
- TmfUiPlugin.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
} catch (InvocationTargetException e) {
- TmfUiPlugin.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating events table", e); //$NON-NLS-1$
}
return new TmfEventsTable(parent, cacheSize);
}
if (experiment.equals(fExperiment)) {
fEventsTable.setTrace(null, false);
- TmfUiPlugin.getDefault().getWorkbench().getWorkbenchWindows()[0].getShell().getDisplay().syncExec(new Runnable() {
+ Activator.getDefault().getWorkbench().getWorkbenchWindows()[0].getShell().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
setPartName(fTitlePrefix);
\r
import javax.xml.parsers.ParserConfigurationException;\r
\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.eclipse.linuxtools.tmf.core.filter.model.ITmfFilterTreeNode;\r
import org.eclipse.linuxtools.tmf.core.filter.model.TmfFilterRootNode;\r
import org.eclipse.linuxtools.tmf.core.filter.xml.TmfFilterXMLParser;\r
\r
private static final String SAVED_FILTERS_FILE_NAME = "saved_filters.xml"; //$NON-NLS-1$\r
private static final String SAVED_FILTERS_PATH_NAME =\r
- TmfUiPlugin.getDefault().getStateLocation().addTrailingSeparator().append(SAVED_FILTERS_FILE_NAME).toString();\r
+ Activator.getDefault().getStateLocation().addTrailingSeparator().append(SAVED_FILTERS_FILE_NAME).toString();\r
\r
private static ITmfFilterTreeNode fRoot = new TmfFilterRootNode();\r
static {\r
fRoot = new TmfFilterXMLParser(SAVED_FILTERS_PATH_NAME).getTree();\r
} catch (FileNotFoundException e) {\r
} catch (SAXException e) {\r
- TmfUiPlugin.getDefault().logError("Error parsing saved filter xml file: " + SAVED_FILTERS_PATH_NAME, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error parsing saved filter xml file: " + SAVED_FILTERS_PATH_NAME, e); //$NON-NLS-1$\r
} catch (IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error parsing saved filter xml file: " + SAVED_FILTERS_PATH_NAME, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error parsing saved filter xml file: " + SAVED_FILTERS_PATH_NAME, e); //$NON-NLS-1$\r
}\r
}\r
\r
TmfFilterXMLWriter writerXML = new TmfFilterXMLWriter(fRoot);\r
writerXML.saveTree(SAVED_FILTERS_PATH_NAME);\r
} catch (IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error saving filter xml file: " + SAVED_FILTERS_PATH_NAME, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error saving filter xml file: " + SAVED_FILTERS_PATH_NAME, e); //$NON-NLS-1$\r
} catch (ParserConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error saving filter xml file: " + SAVED_FILTERS_PATH_NAME, e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error saving filter xml file: " + SAVED_FILTERS_PATH_NAME, e); //$NON-NLS-1$\r
}\r
}\r
}\r
import org.eclipse.jface.viewers.IStructuredSelection;\r
import org.eclipse.jface.viewers.SelectionChangedEvent;\r
import org.eclipse.linuxtools.internal.tmf.ui.Messages;\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.eclipse.linuxtools.tmf.core.filter.model.ITmfFilterTreeNode;\r
import org.eclipse.linuxtools.tmf.core.filter.model.TmfFilterNode;\r
import org.eclipse.linuxtools.tmf.core.filter.model.TmfFilterRootNode;\r
\r
public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.filter"; //$NON-NLS-1$\r
\r
- private static final Image SAVE_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/save_button.gif"); //$NON-NLS-1$\r
- private static final Image ADD_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/add_button.gif"); //$NON-NLS-1$\r
- private static final Image DELETE_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/delete_button.gif"); //$NON-NLS-1$\r
- private static final Image IMPORT_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/import_button.gif"); //$NON-NLS-1$\r
- private static final Image EXPORT_IMAGE = TmfUiPlugin.getDefault().getImageFromPath("/icons/elcl16/export_button.gif"); //$NON-NLS-1$\r
+ private static final Image SAVE_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/save_button.gif"); //$NON-NLS-1$\r
+ private static final Image ADD_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/add_button.gif"); //$NON-NLS-1$\r
+ private static final Image DELETE_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/delete_button.gif"); //$NON-NLS-1$\r
+ private static final Image IMPORT_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/import_button.gif"); //$NON-NLS-1$\r
+ private static final Image EXPORT_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/export_button.gif"); //$NON-NLS-1$\r
\r
// ------------------------------------------------------------------------\r
// Main data structures\r
try {\r
fWorkspace.getRoot().refreshLocal(IResource.DEPTH_INFINITE, null);\r
} catch (CoreException e) {\r
- TmfUiPlugin.getDefault().logError("Error refreshing workspace", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error refreshing workspace", e); //$NON-NLS-1$\r
}\r
\r
fRoot = new TmfFilterRootNode();\r
}\r
\r
} catch (ParserConfigurationException e) {\r
- TmfUiPlugin.getDefault().logError("Error parsing filter xml file", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error parsing filter xml file", e); //$NON-NLS-1$\r
} catch (IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error parsing filter xml file", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error parsing filter xml file", e); //$NON-NLS-1$\r
}\r
}\r
}\r
}\r
\r
} catch (SAXException e) {\r
- TmfUiPlugin.getDefault().logError("Error importing filter xml file", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error importing filter xml file", e); //$NON-NLS-1$\r
} catch (IOException e) {\r
- TmfUiPlugin.getDefault().logError("Error importing filter xml file", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error importing filter xml file", e); //$NON-NLS-1$\r
}\r
\r
if (root != null) {\r
import org.eclipse.core.resources.IMarker;\r
import org.eclipse.core.resources.IResource;\r
import org.eclipse.core.runtime.CoreException;\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;\r
import org.eclipse.linuxtools.tmf.core.filter.ITmfFilter;\r
\r
}\r
}\r
} catch (CoreException e) {\r
- TmfUiPlugin.getDefault().logError("Error refreshing bookmarks", e); //$NON-NLS-1$\r
+ Activator.getDefault().logError("Error refreshing bookmarks", e); //$NON-NLS-1$\r
}\r
}\r
\r
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.BaseMessage;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.Frame;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode;
if (action.getId() == null)
action.setId("org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.extendedFilter"); //$NON-NLS-1$
if (action.getImageDescriptor() == null)
- action.setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_FILTERS));
+ action.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_FILTERS));
if (action.getText() == null || action.getText().length() == 0)
action.setText(SDMessages._42);
bar.getMenuManager().prependToGroup("UML2SD_FILTERING", action); //$NON-NLS-1$
action.setId("org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.extendedFind"); //$NON-NLS-1$
}
if (action.getImageDescriptor() == null) {
- action.setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_SEARCH_SEQ));
+ action.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_SEARCH_SEQ));
}
if (action.getText() == null) {
action.setText(SDMessages._41);
import java.util.Timer;
import java.util.TimerTask;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jface.contexts.IContextIds;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.BaseMessage;
fInsertionCartet = new Caret((Canvas) getViewControl(), SWT.NONE);
fInsertionCartet.setVisible(false);
- fCollapaseCaretImg = TmfUiPlugin.getDefault().getImageFromPath(ITmfImageConstants.IMG_UI_ARROW_COLLAPSE_OBJ);
- fArrowUpCaretImg = TmfUiPlugin.getDefault().getImageFromPath(ITmfImageConstants.IMG_UI_ARROW_UP_OBJ);
+ fCollapaseCaretImg = Activator.getDefault().getImageFromPath(ITmfImageConstants.IMG_UI_ARROW_COLLAPSE_OBJ);
+ fArrowUpCaretImg = Activator.getDefault().getImageFromPath(ITmfImageConstants.IMG_UI_ARROW_UP_OBJ);
fReorderList = new ArrayList<Lifeline[]>();
getViewControl().addTraverseListener(new LocalTraverseListener());
return;
}
} catch (Exception e) {
- TmfUiPlugin.getDefault().logError("Error creating image", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating image", e); //$NON-NLS-1$
return;
}
printUI(sdPrinter.getDialogUI());
try {
dbuffer = new Image(getDisplay(), area.width, area.height);
} catch (Exception e) {
- TmfUiPlugin.getDefault().logError("Error creating image", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating image", e); //$NON-NLS-1$
}
gcim = new GC(dbuffer);
try {
gc.drawImage(dbuffer, 0, 0, area.width, area.height, 0, 0, area.width, area.height);
} catch (Exception e) {
- TmfUiPlugin.getDefault().logError("Error drawin content", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error drawin content", e); //$NON-NLS-1$
}
dbuffer.dispose();
setHScrollBarIncrement(Math.round(SDViewPref.getInstance().getLifelineWidth() / (float) 2 * fZoomValue));
import java.util.Arrays;
import java.util.List;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.AsyncMessage;
try {
dbuffer = new Image(getDisplay(), getClientArea().width, getClientArea().height);
} catch (Exception e) {
- TmfUiPlugin.getDefault().logError("Error creating image", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating image", e); //$NON-NLS-1$
}
gcim = new GC(dbuffer);
for (int i = 0; i < fNodeList.size() - 1; i++) {
try {
gc.drawImage(dbuffer, 0, 0, getClientArea().width, getClientArea().height, 0, 0, getClientArea().width, getClientArea().height);
} catch (Exception e) {
- TmfUiPlugin.getDefault().logError("Error drawing image", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error drawing image", e); //$NON-NLS-1$
}
gcim.dispose();
if (dbuffer != null) {
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.DialogSettings;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.provider.ISDFilterProvider;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.SDMessages;
* @return the saved global filters
*/
public static List<FilterCriteria> getGlobalFilters() {
- DialogSettings settings = (DialogSettings) TmfUiPlugin.getDefault().getDialogSettings().getSection(FILTERS_LIST_CRITERIA);
+ DialogSettings settings = (DialogSettings) Activator.getDefault().getDialogSettings().getSection(FILTERS_LIST_CRITERIA);
int i = 0;
DialogSettings section = null;
int size = 0;
* @param globalFilters A list of filters to save.
*/
public static void saveFiltersCriteria(List<FilterCriteria> globalFilters) {
- DialogSettings settings = (DialogSettings) TmfUiPlugin.getDefault().getDialogSettings();
+ DialogSettings settings = (DialogSettings) Activator.getDefault().getDialogSettings();
DialogSettings section = (DialogSettings) settings.getSection(FILTERS_LIST_CRITERIA);
if (section == null) {
section = (DialogSettings) settings.addNewSection(FILTERS_LIST_CRITERIA);
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.DialogSettings;
import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.AsyncMessage;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.AsyncMessageReturn;
@Override
public Control createDialogArea(Composite arg0) {
if (fIsFind) {
- fExpressionList = TmfUiPlugin.getDefault().getDialogSettings().getArray(FIND_EXPRESSION_LIST);
+ fExpressionList = Activator.getDefault().getDialogSettings().getArray(FIND_EXPRESSION_LIST);
} else {
- fExpressionList = TmfUiPlugin.getDefault().getDialogSettings().getArray(FILTER_EXPRESSION_LIST);
+ fExpressionList = Activator.getDefault().getDialogSettings().getArray(FILTER_EXPRESSION_LIST);
}
if (fExpressionList == null) {
fExpressionList = new String[0];
CRITERIA = FILTER_CRITERIA;
}
- DialogSettings section = (DialogSettings) TmfUiPlugin.getDefault().getDialogSettings().getSection(CRITERIA);
+ DialogSettings section = (DialogSettings) Activator.getDefault().getDialogSettings().getSection(CRITERIA);
List selection = fSdView.getSDWidget().getSelection();
if ((selection == null || selection.size() != 1) || (!fIsFind)) {
if (section != null) {
CRITERIA = FILTER_CRITERIA;
EXPRESSION_LIST = FILTER_EXPRESSION_LIST;
}
- DialogSettings settings = (DialogSettings) TmfUiPlugin.getDefault().getDialogSettings();
+ DialogSettings settings = (DialogSettings) Activator.getDefault().getDialogSettings();
DialogSettings section = (DialogSettings) settings.getSection(CRITERIA);
if (section == null) {
section = (DialogSettings) settings.addNewSection(CRITERIA);
import java.net.MalformedURLException;
import java.net.URL;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IImage;
import org.eclipse.swt.graphics.Image;
ImageDescriptor img = ImageDescriptor.createFromURL(url);
return img.createImage();
} catch (MalformedURLException e) {
- TmfUiPlugin.getDefault().logError("Error opening image file", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error opening image file", e); //$NON-NLS-1$
}
return null;
}
import org.eclipse.jface.action.Action;
import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.SDMessages;
setText(SDMessages._139);
setToolTipText(SDMessages._140);
setId(ID);
- setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_FIRST_PAGE));
+ setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_FIRST_PAGE));
}
// ------------------------------------------------------------------------
import org.eclipse.jface.action.Action;
import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.SDMessages;
setText(SDMessages._141);
setToolTipText(SDMessages._142);
setId(ID);
- setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_LAST_PAGE));
+ setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_LAST_PAGE));
}
// ------------------------------------------------------------------------
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.BaseMessage;
super();
setId(ID);
setActionDefinitionId(ID);
- setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_SEARCH_MATCH));
+ setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_SEARCH_MATCH));
fView = view;
}
import org.eclipse.jface.action.Action;
import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.SDMessages;
setText(SDMessages._36);
setToolTipText(SDMessages._38);
setId(ID);
- setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_NEXT_PAGE));
+ setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_NEXT_PAGE));
}
// ------------------------------------------------------------------------
import org.eclipse.jface.action.Action;
import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.dialogs.FilterListDialog;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.provider.ISDFilterProvider;
*/
public OpenSDFiltersDialog(SDView view, ISDFilterProvider provider) {
super(SDMessages._43);
- setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_FILTERS));
+ setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_FILTERS));
setId(ID);
setToolTipText(SDMessages._43);
fView = view;
import org.eclipse.jface.action.Action;
import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.dialogs.SearchFilterDialog;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.SDMessages;
*/
public OpenSDFindDialog(SDView view) {
super(SDMessages._41);
- setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_SEARCH_SEQ));
+ setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_SEARCH_SEQ));
setId(ID);
setActionDefinitionId(ACTION_DEFINITION_ID);
setToolTipText(SDMessages._41);
import org.eclipse.jface.action.Action;
import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.dialogs.PagesDialog;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.provider.ISDAdvancedPagingProvider;
*/
public OpenSDPagesDialog(SDView view, ISDAdvancedPagingProvider provider) {
super(SDMessages._44);
- setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_GOTO_PAGE));
+ setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_GOTO_PAGE));
setId(ID);
fView = view;
fProvider = provider;
import org.eclipse.jface.action.Action;
import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.SDMessages;
setText(SDMessages._35);
setToolTipText(SDMessages._37);
setId(ID);
- setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_PREV_PAGE));
+ setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_PREV_PAGE));
}
// ------------------------------------------------------------------------
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode;
if (view instanceof SDView) {
fView = (SDView)view;
}
- setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_NODE_END));
+ setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_NODE_END));
}
// ------------------------------------------------------------------------
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode;
if (view instanceof SDView) {
fView = (SDView)view;
}
- setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_NODE_START));
+ setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_NODE_START));
}
// ------------------------------------------------------------------------
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.SDMessages;
// Pre-create zooming cursors
fZoomInCursor = new Cursor(Display.getCurrent(),
- TmfUiPlugin.getDefault().getImageFromImageRegistry(ITmfImageConstants.IMG_UI_ZOOM_IN).getImageData(),
- TmfUiPlugin.getDefault().getImageFromImageRegistry(ITmfImageConstants.IMG_UI_ZOOM).getImageData(), 0, 0);
+ Activator.getDefault().getImageFromImageRegistry(ITmfImageConstants.IMG_UI_ZOOM_IN).getImageData(),
+ Activator.getDefault().getImageFromImageRegistry(ITmfImageConstants.IMG_UI_ZOOM).getImageData(), 0, 0);
fZoomOutCursor = new Cursor(Display.getCurrent(),
- TmfUiPlugin.getDefault().getImageFromImageRegistry(ITmfImageConstants.IMG_UI_ZOOM_OUT).getImageData(),
- TmfUiPlugin.getDefault().getImageFromImageRegistry(ITmfImageConstants.IMG_UI_ZOOM).getImageData(), 0, 0);
+ Activator.getDefault().getImageFromImageRegistry(ITmfImageConstants.IMG_UI_ZOOM_OUT).getImageData(),
+ Activator.getDefault().getImageFromImageRegistry(ITmfImageConstants.IMG_UI_ZOOM).getImageData(), 0, 0);
switch (type) {
case ZOOM_IN:
setText(SDMessages._47);
setToolTipText(SDMessages._48);
setId(ZOOM_IN_ID);
- setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_ZOOM_IN_MENU));
+ setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_ZOOM_IN_MENU));
break;
case ZOOM_OUT:
setText(SDMessages._51);
setToolTipText(SDMessages._52);
setId(ZOOM_OUT_ID);
- setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_ZOOM_OUT_MENU));
+ setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_ZOOM_OUT_MENU));
break;
case ZOOM_RESET:
setText(SDMessages._49);
setToolTipText(SDMessages._50);
setId(RESET_ZOOM_ID);
- setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_HOME_MENU));
+ setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_HOME_MENU));
break;
default:
setText(SDMessages._53);
setToolTipText(SDMessages._54);
setId(NO_ZOOM_ID);
- setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_SELECT_MENU));
+ setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_SELECT_MENU));
break;
}
}
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IWorkbenchPage;
return null;
}
- IWorkbenchPage persp = TmfUiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IWorkbenchPage persp = Activator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
SDView sdView = view;
return loader;
} catch (Exception e) {
- TmfUiPlugin.getDefault().logError("Error getting loader class", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error getting loader class", e); //$NON-NLS-1$
}
return null;
}
* @return the class name of the saved loader
*/
public String getSavedLoader(String viewId) {
- IPreferenceStore p = TmfUiPlugin.getDefault().getPreferenceStore();
+ IPreferenceStore p = Activator.getDefault().getPreferenceStore();
return p.getString(LOADER_PREFIX + viewId);
}
* Saves the last loader in order to reload it on next session.
*/
public void saveLastLoader(String id, String id2) {
- IPreferenceStore p = TmfUiPlugin.getDefault().getPreferenceStore();
+ IPreferenceStore p = Activator.getDefault().getPreferenceStore();
p.setValue(LOADER_PREFIX + id2, id);
}
if ((currentLoader != null) && (currentLoader != loader)) {
if (loader != null) {
- IWorkbenchPage persp = TmfUiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IWorkbenchPage persp = Activator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
try {
// Search view corresponding to the viewId
SDView sdview = null;
}
} catch (Exception e) {
- TmfUiPlugin.getDefault().logError("Error setting current loader class", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error setting current loader class", e); //$NON-NLS-1$
}
}
// The old loader is going to be kicked
}
ArrayList<IConfigurationElement> ret = new ArrayList<IConfigurationElement>();
- IExtensionPoint iep = Platform.getExtensionRegistry().getExtensionPoint(TmfUiPlugin.PLUGIN_ID, LOADER_TAG);
+ IExtensionPoint iep = Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, LOADER_TAG);
if (iep == null) {
return ret;
}
setCurrentLoader(l, viewId);
}
} catch (CoreException e4) {
- TmfUiPlugin.getDefault().logError("Error 'uml2SDLoader' Extension point", e4); //$NON-NLS-1$
+ Activator.getDefault().logError("Error 'uml2SDLoader' Extension point", e4); //$NON-NLS-1$
} catch (Exception e5) {
- TmfUiPlugin.getDefault().logError("Error 'uml2SDLoader' Extension point", e5); //$NON-NLS-1$
+ Activator.getDefault().logError("Error 'uml2SDLoader' Extension point", e5); //$NON-NLS-1$
}
}
}
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.core.component.TmfComponent;
import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
import org.eclipse.linuxtools.tmf.core.event.ITmfEventField;
try {
fSearchRequest.waitForCompletion();
} catch (InterruptedException e) {
- TmfUiPlugin.getDefault().logError("Search request interrupted!", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Search request interrupted!", e); //$NON-NLS-1$
}
IStatus status = Status.OK_STATUS;
}
else {
// String was not found
- status = new Status(Status.WARNING, TmfUiPlugin.PLUGIN_ID, Messages.TmfUml2SDSyncLoader_SearchNotFound);
+ status = new Status(Status.WARNING, Activator.PLUGIN_ID, Messages.TmfUml2SDSyncLoader_SearchNotFound);
}
setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE);
}
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IColor;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IFont;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.impl.ColorImpl;
* preferences setting
*/
protected SDViewPref() {
- fPrefStore = TmfUiPlugin.getDefault().getPreferenceStore();
+ fPrefStore = Activator.getDefault().getPreferenceStore();
fPrefStore.setDefault(PREF_LINK_FONT, true);
fPrefStore.setDefault(PREF_EXCLUDE_EXTERNAL_TIME, true);
import org.eclipse.jface.viewers.ISelectionProvider;\r
import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;\r
import org.eclipse.linuxtools.internal.tmf.ui.Messages;\r
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;\r
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;\r
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.dialogs.TimeGraphLegend;\r
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;\r
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;\r
};\r
resetScale.setText(Messages.TmfTimeGraphViewer_ResetScaleActionNameText);\r
resetScale.setToolTipText(Messages.TmfTimeGraphViewer_ResetScaleActionToolTipText);\r
- resetScale.setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_HOME_MENU));\r
+ resetScale.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_HOME_MENU));\r
} \r
return resetScale;\r
}\r
};\r
showLegendAction.setText(Messages.TmfTimeGraphViewer_LegendActionNameText);\r
showLegendAction.setToolTipText(Messages.TmfTimeGraphViewer_LegendActionToolTipText);\r
- showLegendAction.setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_SHOW_LEGEND));\r
+ showLegendAction.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_SHOW_LEGEND));\r
}\r
\r
return showLegendAction;\r
\r
nextEventAction.setText(Messages.TmfTimeGraphViewer_NextEventActionNameText);\r
nextEventAction.setToolTipText(Messages.TmfTimeGraphViewer_NextEventActionToolTipText);\r
- nextEventAction.setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_NEXT_EVENT));\r
+ nextEventAction.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_NEXT_EVENT));\r
} \r
\r
return nextEventAction;\r
\r
prevEventAction.setText(Messages.TmfTimeGraphViewer_PreviousEventActionNameText);\r
prevEventAction.setToolTipText(Messages.TmfTimeGraphViewer_PreviousEventActionToolTipText);\r
- prevEventAction.setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_PREV_EVENT));\r
+ prevEventAction.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_PREV_EVENT));\r
} \r
\r
return prevEventAction;\r
};\r
nextItemAction.setText(Messages.TmfTimeGraphViewer_NextItemActionNameText);\r
nextItemAction.setToolTipText(Messages.TmfTimeGraphViewer_NextItemActionToolTipText);\r
- nextItemAction.setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_NEXT_ITEM));\r
+ nextItemAction.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_NEXT_ITEM));\r
}\r
return nextItemAction;\r
}\r
};\r
previousItemAction.setText(Messages.TmfTimeGraphViewer_PreviousItemActionNameText);\r
previousItemAction.setToolTipText(Messages.TmfTimeGraphViewer_PreviousItemActionToolTipText);\r
- previousItemAction.setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_PREV_ITEM));\r
+ previousItemAction.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_PREV_ITEM));\r
}\r
return previousItemAction;\r
}\r
};\r
zoomInAction.setText(Messages.TmfTimeGraphViewer_ZoomInActionNameText);\r
zoomInAction.setToolTipText(Messages.TmfTimeGraphViewer_ZoomInActionToolTipText);\r
- zoomInAction.setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_ZOOM_IN_MENU));\r
+ zoomInAction.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_ZOOM_IN_MENU));\r
}\r
return zoomInAction;\r
}\r
};\r
zoomOutAction.setText(Messages.TmfTimeGraphViewer_ZoomOutActionNameText);\r
zoomOutAction.setToolTipText(Messages.TmfTimeGraphViewer_ZoomOutActionToolTipText);\r
- zoomOutAction.setImageDescriptor(TmfUiPlugin.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_ZOOM_OUT_MENU));\r
+ zoomOutAction.setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_ZOOM_OUT_MENU));\r
}\r
return zoomOutAction;\r
}\r
package org.eclipse.linuxtools.tmf.ui.widgets.virtualtable;
-import org.eclipse.linuxtools.internal.tmf.ui.TmfUiPlugin;
+import org.eclipse.linuxtools.internal.tmf.ui.Activator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.TableEditor;
import org.eclipse.swt.events.ControlAdapter;
try {
return (Control) control.getConstructor(Composite.class, int.class).newInstance(new Object[] {fTable, SWT.NONE});
} catch (Exception e) {
- TmfUiPlugin.getDefault().logError("Error creating table editor control", e); //$NON-NLS-1$
+ Activator.getDefault().logError("Error creating table editor control", e); //$NON-NLS-1$
}
return null;
}