public String toString() {
StringBuilder builder = new StringBuilder();
builder.append(getFileName()).append(':');
- builder.append(Long.toString(getLineNumber()));
+ builder.append(getLineNo());
return builder.toString();
}
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 3.0.0.qualifier
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.tracecompass.lttng2.ust.ui;singleton:=true
Bundle-Activator: org.eclipse.tracecompass.internal.lttng2.ust.ui.Activator
org.eclipse.tracecompass.tmf.ctf.core
Export-Package: org.eclipse.tracecompass.internal.lttng2.ust.ui;x-friends:="org.eclipse.tracecompass.lttng2.ust.ui.tests",
org.eclipse.tracecompass.internal.lttng2.ust.ui.analysis.debuginfo;x-internal:=true,
- org.eclipse.tracecompass.internal.lttng2.ust.ui.views.memusage;x-friends:="org.eclipse.tracecompass.lttng2.ust.ui.tests,org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests",
- org.eclipse.tracecompass.lttng2.ust.ui.analysis.callstack
+ org.eclipse.tracecompass.internal.lttng2.ust.ui.views.memusage;x-friends:="org.eclipse.tracecompass.lttng2.ust.ui.tests,org.eclipse.tracecompass.lttng2.ust.ui.swtbot.tests"
Import-Package: com.google.common.base,
com.google.common.collect,
org.swtchart
import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoAnalysisModule;
import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoBinaryAspect;
import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoFunctionAspect;
-import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoSourceAspect;
import org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace;
-import org.eclipse.tracecompass.tmf.core.event.lookup.ITmfCallsite;
-import org.eclipse.tracecompass.tmf.core.event.lookup.TmfCallsite;
import org.eclipse.tracecompass.tmf.core.symbols.DefaultSymbolProvider;
import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProvider;
import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProviderPreferencePage;
return (loc == null ? null : loc.getFunctionName());
}
- @Deprecated
- @Override
- public @Nullable TmfCallsite getSymbolInfo(int pid, long timestamp, long address) {
- BinaryCallsite bc = UstDebugInfoBinaryAspect.getBinaryCallsite(getTrace(), pid, timestamp, address);
- if (bc == null) {
- return null;
- }
-
- return UstDebugInfoSourceAspect.getSourceCallsite(getTrace(), bc);
- }
-
@Override
public @NonNull ISymbolProviderPreferencePage createPreferencePage() {
return new UstDebugInfoSymbolProviderPreferencePage(this);
}
- @Deprecated
- @Override
- public @Nullable ITmfCallsite getSymbolInfo(long address) {
- return null;
- }
-
}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014, 2016 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:
- * Alexandre Montplaisir - Initial API and implementation
- * Bernd Hufmann - Added analysis requirements
- *******************************************************************************/
-
-package org.eclipse.tracecompass.lttng2.ust.ui.analysis.callstack;
-
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
-import java.util.Set;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.internal.lttng2.ust.core.callstack.LttngUstCallStackAnalysisRequirement;
-import org.eclipse.tracecompass.internal.lttng2.ust.core.callstack.LttngUstCallStackProvider;
-import org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace;
-import org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout;
-import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAbstractAnalysisRequirement;
-import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
-import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.ui.views.callstack.AbstractCallStackAnalysis;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- * Call-stack analysis to populate the TMF CallStack View from UST cyg-profile
- * events.
- *
- * @author Alexandre Montplaisir
- * @deprecated This analysis was moved to core as
- * {@link org.eclipse.tracecompass.internal.lttng2.ust.core.callstack.LttngUstCallStackAnalysis}
- * and is now internal
- */
-@Deprecated
-public class LttngUstCallStackAnalysis extends AbstractCallStackAnalysis {
-
- /**
- * ID
- *
- * @since 2.0
- */
- public static final String ID = "org.eclipse.linuxtools.lttng2.ust.analysis.callstack"; //$NON-NLS-1$
-
- private @Nullable Set<@NonNull TmfAbstractAnalysisRequirement> fAnalysisRequirements = null;
-
- /**
- * @since 1.0
- */
- @Override
- public boolean setTrace(ITmfTrace trace) throws TmfAnalysisException {
- if (!(trace instanceof LttngUstTrace)) {
- return false;
- }
- return super.setTrace(trace);
- }
-
- /**
- * @since 2.1
- */
- @Override
- public LttngUstTrace getTrace() {
- return (LttngUstTrace) super.getTrace();
- }
-
- @Override
- protected ITmfStateProvider createStateProvider() {
- return new LttngUstCallStackProvider(checkNotNull(getTrace()));
- }
-
- @Override
- public @NonNull Iterable<@NonNull TmfAbstractAnalysisRequirement> getAnalysisRequirements() {
-
- Set<@NonNull TmfAbstractAnalysisRequirement> requirements = fAnalysisRequirements;
- if (requirements == null) {
- LttngUstTrace trace = getTrace();
- ILttngUstEventLayout layout = ILttngUstEventLayout.DEFAULT_LAYOUT;
- if (trace != null) {
- layout = trace.getEventLayout();
- }
- requirements = ImmutableSet.of(new LttngUstCallStackAnalysisRequirement(layout));
- fAnalysisRequirements = requirements;
- }
- return requirements;
- }
-
-}
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
-Bundle-Version: 2.4.0.qualifier
+Bundle-Version: 3.0.0.qualifier
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.tracecompass.tmf.core;singleton:=true
Bundle-Activator: org.eclipse.tracecompass.internal.tmf.core.Activator
* Gets the trace
*
* @return The trace
- * @since 2.4
+ * @since 3.0
*/
@Nullable public ITmfTrace getTrace() {
return fTrace;
* initialized when the exception occurred, this method could mark the
* initialization as failed.
*
- * @since 2.4
+ * @since 3.0
*/
protected void onFail() {
// Do nothing by default
}
}
- /**
- * Get the parameter providers that apply to the requested trace
- *
- * @param module
- * Analysis module
- * @param trace
- * The trace
- * @return The set of parameter providers that apply to a trace for this module
- * @deprecated Use the
- * {@link #getParameterProvidersForModule(IAnalysisModule, ITmfTrace)}
- * method that returns a set instead.
- */
- @Deprecated
- public static List<IAnalysisParameterProvider> getParameterProviders(IAnalysisModule module, ITmfTrace trace) {
- /* Call the method that returns a set */
- Set<IAnalysisParameterProvider> providerList = getParameterProvidersForModule(module, trace);
- return new ArrayList<>(providerList);
- }
-
/**
* Get the parameter providers that apply to the requested trace
*
*/
@NonNull String getFileName();
- /**
- * Returns the function name of the call site.
- *
- * @return the function name or null
- * @deprecated Should not be part of this interface anymore.
- */
- @Deprecated
- @Nullable String getFunctionName();
-
- /**
- * Returns the line number of the call site.
- *
- * @return the line number
- * @deprecated Use {@link #getLineNo()} instead, which can return null.
- */
- @Deprecated
- long getLineNumber();
-
/**
* Returns the line number of the call site.
*
* @return The line number, or 'null' if unavailable
* @since 2.1
*/
- default @Nullable Long getLineNo() {
- /* TODO Change to abstract method once getLineNumber() is removed */
- return getLineNumber();
- }
+ @Nullable Long getLineNo();
}
package org.eclipse.tracecompass.tmf.core.event.lookup;
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
import java.util.Objects;
import org.eclipse.jdt.annotation.NonNull;
// Constructors
// ------------------------------------------------------------------------
- /**
- * Default constructor.
- *
- * @param fileName
- * - a file name
- * @param functionName
- * - a function name
- * @param lineNumber
- * - a line number
- * @deprecated Use {@link #TmfCallsite(String, Long)} instead.
- */
- @Deprecated
- public TmfCallsite(String fileName, String functionName, long lineNumber) {
- this(checkNotNull(fileName), lineNumber);
- }
-
/**
* Constructor
*
return fFileName;
}
- @Deprecated
- @Override
- public String getFunctionName() {
- return ""; //$NON-NLS-1$
- }
-
- @Deprecated
- @Override
- public long getLineNumber() {
- Long lineNumber = fLineNumber;
- return (lineNumber == null ? -1 : lineNumber.longValue());
- }
-
-
/**
* @since 2.1
*/
return fMatchCount;
}
- /**
- * Returns the match at the specified index
- *
- * @param index
- * The index of the match to get
- * @return The match at index or null or not present
- * @deprecated Matches are not kept anymore, they use up memory for no real reason
- */
- @Deprecated
- public TmfEventDependency getMatch(int index) {
- return null;
- }
-
@Override
public String toString() {
return getClass().getSimpleName() + " [ Number of matches found: " + fMatchCount + " ]"; //$NON-NLS-1$ //$NON-NLS-2$
*
* @param cause
* The cause
- * @since 2.4
+ * @since 3.0
*/
public TmfAnalysisException(Throwable cause) {
super(cause);
package org.eclipse.tracecompass.tmf.core.parsers.custom;
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
import static org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString;
import java.text.ParseException;
-import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import org.eclipse.tracecompass.tmf.core.trace.ITmfContext;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import com.google.common.collect.Iterables;
-
/**
* Base event for custom text parsers.
*
TIMESTAMP_INPUT_FORMAT
}
- /** Input format key
- * @deprecated Use {@link Key#TIMESTAMP_INPUT_FORMAT} instead. */
- @Deprecated
- protected static final String TIMESTAMP_INPUT_FORMAT_KEY = "CE_TS_I_F"; //$NON-NLS-1$
-
/** Empty message */
protected static final String NO_MESSAGE = ""; //$NON-NLS-1$
// Other operations
// ------------------------------------------------------------------------
- /**
- * Get the contents of an event table cell for this event's row.
- *
- * @param index
- * The ID/index of the field to display. This corresponds to the
- * index in the event content.
- * @return The String to display in the cell
- * @deprecated Use {@link ITmfEventField#getField(String...)} instead.
- */
- @Deprecated
- public String getEventString(int index) {
- Collection<? extends ITmfEventField> fields = getContent().getFields();
- if (index < 0 || index >= fields.size()) {
- return ""; //$NON-NLS-1$
- }
-
- return nullToEmptyString(checkNotNull(Iterables.get(fields, index)).getValue());
- }
-
private void processData() {
// Remove the values as they are processed, so we can process the extra values at the end
String timestampString = fData.remove(Tag.TIMESTAMP);
package org.eclipse.tracecompass.tmf.core.parsers.custom;
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.tmf.core.event.ITmfEventField;
import org.eclipse.tracecompass.tmf.core.event.TmfEventField;
private static final @NonNull String EMPTY = ""; //$NON-NLS-1$
private @NonNull String fEventName;
- /**
- * Constructor
- *
- * @param definition
- * Trace definition
- * @deprecated Use {@link #CustomEventType(String, ITmfEventField)} instead.
- */
- @Deprecated
- public CustomEventType(CustomTraceDefinition definition) {
- super(EMPTY, getRootField(definition));
- fEventName = checkNotNull(definition.definitionName);
- }
-
/**
* Constructor
*
*/
public static final @NonNull String SEPARATOR = " | "; //$NON-NLS-1$
- /** Timestamp tag
- * @deprecated Use {@link Tag#TIMESTAMP} instead. */
- @Deprecated
- public static final String TAG_TIMESTAMP = Messages.CustomTraceDefinition_timestampTag;
-
- /** Message tag
- * @deprecated Use {@link Tag#MESSAGE} instead. */
- @Deprecated
- public static final String TAG_MESSAGE = Messages.CustomTraceDefinition_messageTag;
-
- /** "Other" tag
- * @deprecated Use {@link Tag#OTHER} instead. */
- @Deprecated
- public static final String TAG_OTHER = Messages.CustomTraceDefinition_otherTag;
-
private static final String TMF_CUSTOM_TRACE_BUILTIN_EXTENSION_ID = "org.eclipse.tracecompass.tmf.core.custom.trace"; //$NON-NLS-1$
private static final String ATTRIBUTE_NAME_FILE = "file"; //$NON-NLS-1$
private static final String ATTRIBUTE_NAME_TRACE_CONTENT_TYPE = "traceContentType"; //$NON-NLS-1$
/** Name of this column */
public @NonNull String name;
- /**
- * Default constructor (empty)
- * @deprecated Use {@link OutputColumn#OutputColumn(Tag, String)}
- * instead.
- */
- @Deprecated
- public OutputColumn() {
- this(Tag.IGNORE, ""); //$NON-NLS-1$
- }
-
- /**
- * Constructor
- *
- * @param name
- * Name of this output column
- * @deprecated Use {@link OutputColumn#OutputColumn(Tag, String)}
- * instead.
- */
- @Deprecated
- public OutputColumn(@NonNull String name) {
- this.tag = Tag.OTHER;
- this.name = name;
- }
-
/**
* Constructor
*
*/
public class CustomTxtEventType extends CustomEventType {
- /**
- * Constructor
- *
- * @param definition
- * Custom text trace definition
- * @deprecated Use {@link #CustomTxtEventType(String, ITmfEventField)}
- * instead.
- */
- @Deprecated
- public CustomTxtEventType(CustomTxtTraceDefinition definition) {
- super(definition);
- }
-
/**
* Constructor
*
}
/**
- * @since 2.4
+ * @since 3.0
*/
@Override
public synchronized ITmfTimestamp readEnd() {
super.setContent(content);
}
- /**
- * Parse an entry.
- *
- * @param value Value
- * @param name Name
- * @param inputAction Input action
- * @param inputFormat Input format
- * @deprecated Use {@link #parseInput(String, Tag, String, int, String)} instead.
- */
- @Deprecated
- public void parseInput(String value, String name, int inputAction, String inputFormat) {
- }
-
/**
* Parse an entry.
*
*/
public class CustomXmlEventType extends CustomEventType {
- /**
- * Constructor
- *
- * @param definition
- * Trace definition
- * @deprecated Use {@link #CustomXmlEventType(String, ITmfEventField)}
- * instead.
- */
- @Deprecated
- public CustomXmlEventType(CustomXmlTraceDefinition definition) {
- super(definition);
- }
-
/**
* Constructor
*
/** Input format */
private final String fInputFormat;
- /**
- * Constructor
- *
- * @param attributeName
- * Name of the XML attribute
- * @param inputName
- * Input name
- * @param inputAction
- * Input action
- * @param inputFormat
- * Input format
- * @deprecated Use
- * {@link #CustomXmlInputAttribute(String, Tag, String, int, String)}
- * instead.
- */
- @Deprecated
- public CustomXmlInputAttribute(String attributeName, String inputName,
- int inputAction, String inputFormat) {
- fAttributeName = attributeName;
- fInputTag = Tag.IGNORE;
- fInputName = inputName;
- fInputAction = inputAction;
- fInputFormat = inputFormat;
- }
-
/**
* Constructor
*
public CustomXmlInputElement() {
}
- /**
- * Constructor
- *
- * @param elementName
- * Element name
- * @param logEntry
- * If this element is a log entry
- * @param inputName
- * Name of the input
- * @param inputAction
- * Input action
- * @param inputFormat
- * Input format
- * @param attributes
- * XML attributes of this element
- * @deprecated Use
- * {@link #CustomXmlInputElement(String, boolean, Tag, String, int, String, List)}
- * instead.
- */
- @Deprecated
- public CustomXmlInputElement(String elementName, boolean logEntry,
- String inputName, int inputAction, String inputFormat,
- List<CustomXmlInputAttribute> attributes) {
- fElementName = elementName;
- fLogEntry = logEntry;
- fInputName = inputName;
- fInputAction = inputAction;
- fInputFormat = inputFormat;
- fAttributes = attributes;
- }
-
/**
* Constructor
*
}
/**
- * @since 2.4
+ * @since 3.0
*/
@Override
public synchronized ITmfTimestamp readEnd() {
*/
public class CustomXmlTraceDefinition extends CustomTraceDefinition {
- /** Ignore tag
- * @deprecated Use {@link org.eclipse.tracecompass.tmf.core.parsers.custom.CustomTraceDefinition.Tag#IGNORE} instead. */
- @Deprecated
- public static final String TAG_IGNORE = Messages.CustomXmlTraceDefinition_ignoreTag;
-
/**
* Custom XML label used internally and therefore should not be externalized
*/
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedHashMap;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
// Operations
// ------------------------------------------------------------------
- /**
- * Retrieves the category name from the platform extension registry based on
- * the category ID
- *
- * @param categoryId
- * The category ID
- * @return the category name or empty string if not found
- * @deprecated Use {@link Platform#getExtensionRegistry()} and various
- * public constants in {@link TmfTraceType} if achieving this is
- * needed.
- */
- @Deprecated
- public static String getCategoryName(String categoryId) {
- IConfigurationElement[] elements = Platform.getExtensionRegistry()
- .getConfigurationElementsFor(TMF_TRACE_TYPE_ID);
- for (IConfigurationElement element : elements) {
- if (element.getName().equals(CATEGORY_ELEM) && element.getAttribute(ID_ATTR).equals(categoryId)) {
- return element.getAttribute(NAME_ATTR);
- }
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Retrieves all configuration elements from the platform extension registry
- * for the trace type extension that apply to traces and not experiments.
- *
- * @return an array of trace type configuration elements
- * @deprecated Use {@link Platform#getExtensionRegistry()} and various
- * public constants in {@link TmfTraceType} if achieving this is
- * needed.
- */
- @Deprecated
- public static IConfigurationElement[] getTypeElements() {
- IConfigurationElement[] elements = Platform.getExtensionRegistry()
- .getConfigurationElementsFor(TMF_TRACE_TYPE_ID);
- List<IConfigurationElement> typeElements = new LinkedList<>();
- for (IConfigurationElement element : elements) {
- if (element.getName().equals(TYPE_ELEM)) {
- typeElements.add(element);
- }
- }
- return typeElements.toArray(new IConfigurationElement[typeElements.size()]);
- }
-
- /**
- * Get an iterable view of the existing trace type IDs.
- *
- * @return The currently registered trace type IDs
- * @deprecated Use a combination of {@link #getTraceTypeHelpers()} and
- * {@link TraceTypeHelper#getTraceTypeId()} instead.
- */
- @Deprecated
- public static Iterable<String> getTraceTypeIDs() {
- return TRACE_TYPES.keySet();
- }
-
/**
* Get an iterable view of the existing trace type helpers.
*
return traceTypes.toArray(new String[traceTypes.size()]);
}
- /**
- * Gets all the custom trace types
- *
- * @return the list of custom trace types
- * @deprecated Use {@link CustomTxtTraceDefinition#loadAll()} and
- * {@link CustomXmlTraceDefinition#loadAll()} if achieving this
- * is needed.
- */
- @Deprecated
- public static List<String> getCustomTraceTypes() {
-
- List<String> traceTypes = new ArrayList<>();
- for (CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
- String traceTypeName = def.definitionName;
- traceTypes.add(traceTypeName);
- }
- for (CustomXmlTraceDefinition def : CustomXmlTraceDefinition.loadAll()) {
- String traceTypeName = def.definitionName;
- traceTypes.add(traceTypeName);
- }
- return traceTypes;
- }
-
private static void populateCustomTraceTypes() {
// add the custom trace types
for (CustomTxtTraceDefinition def : CustomTxtTraceDefinition.loadAll()) {
return ""; //$NON-NLS-1$
}
- /**
- * Returns the list of trace categories
- *
- * @return the list of trace categories
- * @deprecated Use {@link #getTraceTypeHelpers()} and
- * {@link TraceTypeHelper#getCategoryName()} to retrieve all
- * category names.
- */
- @Deprecated
- public static List<String> getTraceCategories() {
- List<String> categoryNames = new ArrayList<>();
- for (TraceTypeHelper helper : TRACE_TYPES.values()) {
- final String categoryName = helper.getCategoryName();
- if (!categoryNames.contains(categoryName)) {
- categoryNames.add(categoryName);
- }
- }
- return categoryNames;
- }
-
- /**
- * Get the trace type helper classes from category name. Return only the
- * trace types, not the experiment types
- *
- * @param categoryName
- * the categoryName to lookup
- * @return a list of trace type helper classes {@link TraceTypeHelper}
- * @deprecated Use {@link #getTraceTypeHelpers()} and
- * {@link TraceTypeHelper#getCategoryName()} to retrieve all
- * category names.
- */
- @Deprecated
- public static List<TraceTypeHelper> getTraceTypes(String categoryName) {
- List<TraceTypeHelper> traceNames = new ArrayList<>();
- for (TraceTypeHelper traceTypeHelper : TRACE_TYPES.values()) {
- if (!traceTypeHelper.isExperimentType()) {
- final String storedCategoryName = traceTypeHelper.getCategoryName();
- if (storedCategoryName.equals(categoryName)) {
- traceNames.add(traceTypeHelper);
- }
- }
- }
- return traceNames;
- }
-
- /**
- * Validate a trace type
- *
- * @param traceTypeName
- * the trace category (canonical name)
- * @param fileName
- * the file name (and path)
- * @return true if the trace is of a valid type
- * @deprecated Use TmfTraceType.getTraceTypeHelpers and
- * {@link TraceTypeHelper#validate(String)} or
- * {@link TraceTypeHelper#validateWithConfidence(String)}
- */
- @Deprecated
- public static boolean validate(String traceTypeName, String fileName) {
- if (traceTypeName != null && !traceTypeName.isEmpty()) {
- final TraceTypeHelper traceTypeHelper = TRACE_TYPES.get(traceTypeName);
- if (traceTypeHelper == null || !traceTypeHelper.validate(fileName).isOK()) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Validate a trace
- *
- * @param traceToValidate
- * the trace category (canonical name)
- * @return true if the trace is of a valid type
- * @deprecated Use TmfTraceType.getTraceTypeHelpers and
- * {@link TraceTypeHelper#validate(String)} or
- * {@link TraceTypeHelper#validateWithConfidence(String)}
- */
- @Deprecated
- public static boolean validate(TraceValidationHelper traceToValidate) {
- return validate(traceToValidate.getTraceType(), traceToValidate.getTraceToScan());
- }
-
/**
* Get a configuration element for a given name
*
* preferences or not
*
* @return True if the trace helper is enabled, false otherwise
- * @since 2.4
+ * @since 3.0
*/
public boolean isEnabled() {
return fEnable;
*
* @param enable
* the new enable state
- * @since 2.4
+ * @since 3.0
*/
public void setEnabled(boolean enable) {
fEnable = enable;
* trace type preferences is a blacklist preference of disabled trace types.
*
* @author Jean-Christian Kouame
- * @since 2.4
- *
+ * @since 3.0
*/
public final class TraceTypePreferences {
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2013, 2014 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:
- * Matthew Khouzam - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.core.project.model;
-
-import java.util.Objects;
-
-/**
- * Trace import helper class
- *
- * @author Matthew Khouzam
- * @deprecated Use TmfTraceType.getTraceTypeHelpers and
- * {@link TraceTypeHelper#validate(String)} or
- * {@link TraceTypeHelper#validateWithConfidence(String)}
- */
-@Deprecated
-public class TraceValidationHelper implements Comparable<TraceValidationHelper> {
-
- private final String fTraceToScan;
- private final String fTraceType;
-
- /**
- * Trace To validate constructor
- *
- * @param traceToScan
- * the path of the trace
- * @param traceType
- * the trace type of the trace to add (canonical name)
- */
- public TraceValidationHelper(String traceToScan, String traceType) {
- this.fTraceToScan = traceToScan;
- this.fTraceType = traceType;
- }
-
- /**
- * @return the trace filename
- */
- public String getTraceToScan() {
- return fTraceToScan;
- }
-
- /**
- * @return the trace type canonical name
- */
- public String getTraceType() {
- return fTraceType;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fTraceToScan == null) ? 0 : fTraceToScan.hashCode());
- result = prime * result + ((fTraceType == null) ? 0 : fTraceType.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (!(obj instanceof TraceValidationHelper)) {
- return false;
- }
- TraceValidationHelper other = (TraceValidationHelper) obj;
- if (!Objects.equals(fTraceToScan, other.fTraceToScan)) {
- return false;
- }
- if(!Objects.equals(fTraceType, other.fTraceType)){
- return false;
- }
- return true;
- }
-
- @Override
- public int compareTo(TraceValidationHelper o) {
- int retVal = fTraceToScan.compareTo(o.getTraceToScan());
- if (retVal == 0) {
- retVal = fTraceType.compareTo(o.fTraceType);
- }
- return retVal;
- }
-}
\ No newline at end of file
}
/**
- * @since 2.4
+ * @since 3.0
*/
@Override
public void fail(Throwable cause) {
}
/**
- * @since 2.4
+ * @since 3.0
*/
@Override
public @Nullable Throwable getFailureCause() {
* Makes the state provider fail with a cause
*
* @param cause The cause of the failure
- * @since 2.4
+ * @since 3.0
*/
default void fail(Throwable cause) {
// Do nothing by default.
* Get the cause of failure, or <code>null</code> if there is no failure.
*
* @return The failure cause
- * @since 2.4
+ * @since 3.0
*/
default @Nullable Throwable getFailureCause() {
return null;
* format representation of the symbol address
*
* @author Robert Kiss
- * @since 2.4
+ * @since 3.0
*/
public class DefaultSymbolProvider implements ISymbolProvider {
*
* @author Matthew Khouzam
* @author Robert Kiss
- * @since 2.4
+ * @since 3.0
*/
public interface ISymbolProvider {
*
* @author Robert Kiss
*
- * @since 2.4
+ * @since 3.0
*/
public interface ISymbolProviderFactory {
* point.
*
* @author Robert Kiss
- * @since 2.4
+ * @since 3.0
*/
public final class SymbolProviderManager {
return ts.getValue() == nts.getValue() && ts.getScale() == nts.getScale();
}
- /**
- * Saturated addition. It will not overflow but instead clamp the result to
- * {@link Long#MAX_VALUE} and {@link Long#MIN_VALUE}.
- *
- * @param left
- * The left long to add
- * @param right
- * The right long to add
- * @return The saturated addition result. The mathematical, not Java version
- * of Min(Max(MIN_VALUE, left+right), MAX_VALUE).
- * @see <a href="http://en.wikipedia.org/wiki/Saturation_arithmetic">
- * Saturation arithmetic</a>
- * @since 2.0
- * @deprecated use {@link SaturatedArithmetic#add(long, long)} instead
- */
- @Deprecated
- protected static final long saturatedAdd(final long left, final long right) {
- return SaturatedArithmetic.add(left, right);
- }
-
-
// ------------------------------------------------------------------------
// Object
// ------------------------------------------------------------------------
* An adapter interface for traces, which allows the trace to provide conversion
* functions between cycles and nanoseconds.
*
- * @since 2.4
+ * @since 3.0
*/
public interface ICyclesConverter {
* indexed.
*
* @return the trace's start time. Null if the trace is empty or failed.
- * @since 2.4
+ * @since 3.0
*/
default ITmfTimestamp readStart() {
ITmfContext context = seekEvent(0L);
* indexed.
*
* @return the trace's end time. Null if the trace is empty or failed.
- * @since 2.4
+ * @since 3.0
*/
default ITmfTimestamp readEnd() {
/*
import org.eclipse.tracecompass.tmf.core.component.TmfEventProvider;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
import org.eclipse.tracecompass.tmf.core.event.ITmfLostEvent;
-import org.eclipse.tracecompass.tmf.core.event.TmfEvent;
import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
import org.eclipse.tracecompass.tmf.core.event.aspect.TmfBaseAspects;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
return event;
}
- /**
- * Update the trace attributes
- *
- * @param context the current trace context
- * @param timestamp the corresponding timestamp
- * @deprecated Use {@link #updateAttributes(ITmfContext, ITmfEvent)}
- */
- @Deprecated
- protected synchronized void updateAttributes(final ITmfContext context, final @NonNull ITmfTimestamp timestamp) {
- updateAttributes(context, new TmfEvent(this, context.getRank(), timestamp, null, null));
- }
-
/**
* Update the trace attributes
*
//TODO: Move to ITmfTrace as default method when Bug 507246 is fixed
/**
- * @since 2.4
+ * @since 3.0
*/
@SuppressWarnings("unchecked")
@Override
return fFilter;
}
- /**
- * Store a data for the trace
- *
- * @param key
- * The id of the data
- * @param value
- * The value of the data
- * @since 2.1
- * @deprecated Use
- * {@link TmfTraceManager#updateTraceContext(ITmfTrace, java.util.function.UnaryOperator)}
- * and apply {@link Builder#setData(String, Object)} instead.
- */
- @Deprecated
- public synchronized void setData(String key, Object value) {
- fData.put(key, value);
- }
-
- /**
- * Copy data into the data map
- *
- * @param data
- * The map of data to copy
- * @since 2.1
- * @deprecated Use
- * {@link TmfTraceManager#updateTraceContext(ITmfTrace, java.util.function.UnaryOperator)}
- * and apply {@link Builder#setData(Map)} instead.
- */
- @Deprecated
- public synchronized void setData(Map<String, Object> data) {
- fData.putAll(data);
- }
-
/**
* Get the data for the specific key
*
*
* @param aspect
* The event aspect to register
- * @since 2.4
+ * @since 3.0
*/
public static void registerEventAspect(ITmfEventAspect<?> aspect) {
EXTRA_ASPECTS.add(aspect);
* @return The first result of the
* {@link ITmfEventAspect#resolve(ITmfEvent)} that returns non null
* for the event or {@code null} otherwise
- * @since 2.4
+ * @since 3.0
*/
public static @Nullable Object resolveAspectOfNameForEvent(ITmfTrace trace, String aspectName, ITmfEvent event) {
// First look in the trace aspects
// Constants
// ------------------------------------------------------------------------
- /**
- * The file name of the Synchronization
- *
- * @deprecated This file name shouldn't be used directly anymore. All
- * synchronization files have been moved to a folder and you
- * should use the {@link #getSynchronizationFolder(boolean)}
- * method to return the path to this folder.
- */
- @Deprecated
- public static final String SYNCHRONIZATION_FILE_NAME = "synchronization.bin"; //$NON-NLS-1$
-
/**
* The name of the directory containing trace synchronization data. This
* directory typically will be preserved when traces are synchronized.
try {
String syncDirectory = getSynchronizationFolder(true);
- final File syncFile = (syncDirectory != null) ? new File(syncDirectory + File.separator + SYNCHRONIZATION_FILE_NAME) : null;
+ final File syncFile = (syncDirectory != null) ? new File(syncDirectory + File.separator + getSynchronizationFolder(true)) : null;
final SynchronizationAlgorithm syncAlgo = SynchronizationManager.synchronizeTraces(syncFile, Collections.singleton(this), doSync);
}
/**
- * @since 2.4
+ * @since 3.0
*/
@Override
public synchronized ITmfTimestamp readEnd() {
private static final String TRACING_PERSPECTIVE_ID = TracingPerspectiveFactory.ID;
- /**
- * Waits for all Eclipse jobs to finish. Times out after
- * WaitUtils#MAX_JOBS_WAIT_TIME by default.
- *
- * @throws RuntimeException
- * once the waiting time passes the default maximum value
- *
- * @deprecated Use {@link WaitUtils#waitForJobs()} instead
- */
- @Deprecated
- public static void waitForJobs() {
- WaitUtils.waitForJobs();
- }
-
/**
* Sleeps current thread for a given time.
*
org.eclipse.tracecompass.tmf.ui.viewers,
org.eclipse.tracecompass.tmf.ui.viewers.events,
org.eclipse.tracecompass.tmf.ui.viewers.events.columns,
- org.eclipse.tracecompass.tmf.ui.viewers.events.text,
org.eclipse.tracecompass.tmf.ui.viewers.table,
org.eclipse.tracecompass.tmf.ui.viewers.tree,
org.eclipse.tracecompass.tmf.ui.viewers.xycharts,
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tracecompass.internal.tmf.core.callstack.FunctionNameMapper;
-import org.eclipse.tracecompass.tmf.core.event.lookup.ITmfCallsite;
-import org.eclipse.tracecompass.tmf.core.event.lookup.TmfCallsite;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProvider;
import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProviderPreferencePage;
return fMapping.get(Long.toHexString(address));
}
- @Deprecated
- @Override
- public @Nullable ITmfCallsite getSymbolInfo(long address) {
- loadConfiguration(null);
- String symbolText = getSymbolText(address);
- if (symbolText != null) {
- return new TmfCallsite(null, symbolText, -1);
- }
- return null;
- }
-
@Override
public ISymbolProviderPreferencePage createPreferencePage() {
return new BasicSymbolProviderPreferencePage(this);
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.tmf.core.event.lookup.ITmfCallsite;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
/**
return String.format("%016x", address); //$NON-NLS-1$
}
- /**
- * The default symbol provider will return null for this method
- *
- * @param address
- * the symbol address
- * @return always null
- */
- @Deprecated
- @Override
- public @Nullable ITmfCallsite getSymbolInfo(long address) {
- return null;
- }
-
/**
* @return null because the default symbol provider doesn't support
* configuration
package org.eclipse.tracecompass.tmf.ui.symbols;
import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.tmf.core.event.lookup.ITmfCallsite;
import org.eclipse.tracecompass.tmf.core.trace.TmfTrace;
/**
*/
public interface ISymbolProvider extends org.eclipse.tracecompass.tmf.core.symbols.ISymbolProvider {
- /**
- * Return additional information regarding the symbol from the given address
- * or null if the symbol cannot be found
- *
- * @param address
- * the address of the symbol
- * @return the symbol {@link ITmfCallsite} information or null if the symbol
- * cannot be found
- * @deprecated This interface should only provide function/symbol names, not
- * full source locations.
- */
- @Deprecated
- @Nullable ITmfCallsite getSymbolInfo(long address);
-
- /**
- * Return additional information regarding the symbol from the given
- * pid/timestamp/address tuple, or null if the symbol cannot be found.
- *
- * @param pid
- * The process Id for which to query
- * @param timestamp
- * The timestamp of the query
- * @param address
- * the address of the symbol
- * @return the symbol {@link ITmfCallsite} information or null if the symbol
- * cannot be found
- * @deprecated This interface should only provide function/symbol names, not
- * full source locations.
- */
- @Deprecated
- default @Nullable ITmfCallsite getSymbolInfo(int pid, long timestamp, long address) {
- return getSymbolInfo(address);
- }
-
/**
* Create the {@link ISymbolProviderPreferencePage} that can be used to
* configure this {@link ISymbolProvider}
import org.eclipse.tracecompass.tmf.core.component.TmfComponent;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
-import org.eclipse.tracecompass.tmf.core.event.aspect.TmfContentFieldAspect;
import org.eclipse.tracecompass.tmf.core.event.collapse.ITmfCollapsibleEvent;
import org.eclipse.tracecompass.tmf.core.event.lookup.ITmfCallsite;
import org.eclipse.tracecompass.tmf.core.event.lookup.ITmfModelLookup;
import com.google.common.base.Joiner;
import com.google.common.collect.HashMultimap;
-import com.google.common.collect.ImmutableList;
import com.google.common.collect.Multimap;
/**
this(parent, cacheSize, TmfTrace.BASE_ASPECTS);
}
- /**
- * Legacy constructor, using ColumnData to define columns
- *
- * @param parent
- * The parent composite UI object
- * @param cacheSize
- * The size of the event table cache
- * @param columnData
- * The column data array
- * @deprecated Deprecated constructor, use
- * {@link #TmfEventsTable(Composite, int, Collection)}
- */
- @Deprecated
- public TmfEventsTable(final Composite parent, int cacheSize,
- final org.eclipse.tracecompass.tmf.ui.widgets.virtualtable.ColumnData[] columnData) {
- /*
- * We'll do a "best-effort" to keep trace types still using this API to
- * keep working, by defining a TmfEventTableColumn for each ColumnData
- * they passed.
- */
- this(parent, cacheSize, convertFromColumnData(columnData));
- }
-
- @Deprecated
- private static @NonNull Iterable<ITmfEventAspect<?>> convertFromColumnData(
- org.eclipse.tracecompass.tmf.ui.widgets.virtualtable.ColumnData[] columnData) {
-
- ImmutableList.Builder<ITmfEventAspect<?>> builder = new ImmutableList.Builder<>();
- for (org.eclipse.tracecompass.tmf.ui.widgets.virtualtable.ColumnData col : columnData) {
- String fieldName = col.header;
- if (fieldName != null) {
- builder.add(new TmfContentFieldAspect(fieldName, fieldName));
- }
- }
- return builder.build();
- }
-
/**
* Standard constructor, where we define which columns to use.
*
return fTable;
}
- /**
- * @param columnData
- * columnData
- * @deprecated The column headers are now set at the constructor, this
- * shouldn't be called anymore.
- */
- @Deprecated
- protected void setColumnHeaders(final org.eclipse.tracecompass.tmf.ui.widgets.virtualtable.ColumnData[] columnData) {
- /* No-op */
- }
-
/**
* Set a table item's data.
*
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014 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:
- * Alexandre Montplaisir - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.viewers.events.text;
-
-import java.util.List;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
-import org.eclipse.tracecompass.tmf.core.trace.text.TextTraceEvent;
-import org.eclipse.tracecompass.tmf.core.trace.text.TextTraceEventContent;
-import org.eclipse.tracecompass.tmf.ui.viewers.events.TmfEventsTable;
-import org.eclipse.tracecompass.tmf.ui.widgets.virtualtable.ColumnData;
-
-/**
- * Event table for text traces, which has one column for every event field.
- *
- * @author Alexandre Montplaisir
- * @deprecated Users of this class should instead use
- * {@link TmfEventsTable#TmfEventsTable(Composite, int, java.util.Collection)}
- * , by passing
- * {@link org.eclipse.tracecompass.tmf.ui.viewers.events.columns.TmfEventTableColumn}
- * .
- */
-@Deprecated
-public class TmfTextEventTable extends TmfEventsTable {
-
- /**
- * Constructor
- *
- * @param parent
- * The parent composite UI object
- * @param cacheSize
- * The size of the event table cache
- * @param columnData
- * The column data to use for this table
- */
- public TmfTextEventTable(Composite parent, int cacheSize, ColumnData[] columnData) {
- super(parent, cacheSize, columnData);
- }
-
- /**
- * @param event
- * The event to get the column strings for. It should be an
- * instance of {@link TextTraceEvent}.
- */
- @Override
- public String[] getItemStrings(ITmfEvent event) {
- if (event instanceof TextTraceEvent) {
- List<TextTraceEventContent> fields = ((TextTraceEvent) event).getContent().getFields();
- String[] strings = new String[fields.size()];
- for (int i = 0; i < strings.length; i++) {
- Object value = fields.get(i).getValue();
- strings[i] = (value == null ? EMPTY_STRING : value.toString());
- }
- return strings;
- }
- return EMPTY_STRING_ARRAY;
- }
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2014, 2016 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:
- * Alexandre Montplaisir - Initial API and implementation
- * Patrick Tasse - Add methods to get attribute paths
- *******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.views.callstack;
-
-import org.eclipse.jdt.annotation.NonNullByDefault;
-import org.eclipse.tracecompass.tmf.core.callstack.CallStackAnalysis;
-import org.eclipse.tracecompass.tmf.ui.analysis.TmfAnalysisViewOutput;
-
-/**
- * The base classes for analyses who want to populate the CallStack View.
- *
- * @author Alexandre Montplaisir
- * @deprecated Use the {@link CallStackAnalysis} from the core plugins instead
- * of this class which was there only to register the view as output
- */
-@Deprecated
-@NonNullByDefault
-public abstract class AbstractCallStackAnalysis extends CallStackAnalysis {
-
- /**
- * Abstract constructor (should only be called via the sub-classes'
- * constructors.
- */
- protected AbstractCallStackAnalysis() {
- super();
- registerOutput(new TmfAnalysisViewOutput(CallStackView.ID));
- }
-}
private long fFunctionExitTime;
private @NonNull ITmfStateSystem fSS;
- /**
- * Standard constructor
- *
- * @param quark
- * The call stack quark
- * @param stackLevel
- * The stack level
- * @param trace
- * The trace that this view is talking about
- * @deprecated Use {@link #CallStackEntry(String, int, int, int, ITmfTrace, ITmfStateSystem)}
- */
- @Deprecated
- public CallStackEntry(int quark, int stackLevel, ITmfTrace trace) {
- super(null, 0, 0);
- throw new UnsupportedOperationException();
- }
-
- /**
- * Standard constructor
- *
- * @param name
- * The parent thread name
- * @param quark
- * The call stack quark
- * @param stackLevel
- * The stack level
- * @param trace
- * The trace that this view is talking about
- * @param ss
- * The call stack state system
- * @deprecated Use
- * {@link #CallStackEntry(String, int, int, int, ITmfTrace, ITmfStateSystem)}
- */
- @Deprecated
- public CallStackEntry(String name, int quark, int stackLevel, ITmfTrace trace, @NonNull ITmfStateSystem ss) {
- super(name, 0, 0);
- fQuark = quark;
- fStackLevel = stackLevel;
- fProcessId = -1;
- fTrace = trace;
- fFunctionName = ""; //$NON-NLS-1$
- fSS = ss;
- }
-
/**
* Standard constructor
*
fFunctionName = functionName;
}
- /**
- * Set the start time of the call stack entry
- * @param startTime the start time
- * @deprecated Use {@link #setFunctionEntryTime(long)}
- */
- @Deprecated
- public void setStartTime(long startTime) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Set the end time of the call stack entry
- * @param endTime the end time
- * @deprecated Use {@link #setFunctionExitTime(long)}
- */
- @Deprecated
- public void setEndTime(long endTime) {
- throw new UnsupportedOperationException();
- }
-
/**
* Set the selected function entry time
*
setSelectedTimeInt(time, true, true);
}
- /**
- * Sets a new selection for this viewer and makes it visible.
- *
- * @param entry
- * The entry to select
- * @deprecated Use {@link #setSelection(ISelection, boolean)} instead.
- */
- @Deprecated
- public void setSelection(ITimeGraphEntry entry) {
- setSelection(entry, true);
- }
-
@Override
public void setSelection(ISelection selection, boolean reveal) {
/* if there is a pending selection, ignore this one */
+++ /dev/null
-/*****************************************************************************
- * Copyright (c) 2007, 2016 Intel Corporation, 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:
- * Intel Corporation - Initial API and implementation
- * Ruslan A. Scherbakov, Intel - Initial API and implementation
- * Alvaro Sanchez-Leon - Updated for TMF
- * Patrick Tasse - Refactoring
- *****************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-/**
- * Selection object for the time graph scale
- *
- * @version 1.0
- * @author Alvaro Sanchez-Leon
- * @author Patrick Tasse
- * @deprecated Use {@link StructuredSelection} instead.
- */
-@Deprecated
-public class TimeGraphSelection implements IStructuredSelection {
-
- private List<Object> list = new ArrayList<>();
-
- /**
- * Default constructor
- */
- public TimeGraphSelection() {
- }
-
- /**
- * "Wrapper" constructor. Instantiate a new selection object with only one
- * existing selection.
- *
- * @param sel
- * The initial selection to add to this one
- */
- public TimeGraphSelection(Object sel) {
- if (sel != null) {
- list.add(sel);
- }
- }
-
- /**
- * Add a selection to this one.
- *
- * @param sel
- * The selection to add
- */
- public void add(Object sel) {
- if (null != sel && !list.contains(sel)) {
- list.add(sel);
- }
- }
-
- @Override
- public Object getFirstElement() {
- if (!list.isEmpty()) {
- return list.get(0);
- }
- return null;
- }
-
- @Override
- public Iterator<Object> iterator() {
- return list.iterator();
- }
-
- @Override
- public int size() {
- return list.size();
- }
-
- @Override
- public Object[] toArray() {
- return list.toArray();
- }
-
- @Override
- public List<Object> toList() {
- return list;
- }
-
- @Override
- public boolean isEmpty() {
- return list.isEmpty();
- }
-}
return size.x;
}
- /**
- * Draw text in a rectangle, trimming the text to prevent exceeding the specified width.
- *
- * @param gc
- * The SWT GC object
- * @param text
- * The string to be drawn
- * @param x
- * The x coordinate of the top left corner of the rectangular area where the text is to be drawn
- * @param y
- * The y coordinate of the top left corner of the rectangular area where the text is to be drawn
- * @param width
- * The width of the area to be drawn
- * @param isCentered
- * If <code>true</code> the text will be centered in the available width if space permits
- * @param isTransparent
- * If <code>true</code> the background will be transparent, otherwise it will be opaque
- * @return The number of characters written
- * @deprecated Use {@link #drawText(GC, String, int, int, int, int, boolean, boolean)} instead.
- */
- @Deprecated
- public static int drawText(GC gc, String text, int x, int y, int width, boolean isCentered, boolean isTransparent) {
- if (width < 1) {
- return 0;
- }
-
- int len = text.length();
- int textWidth = 0;
- boolean isReallyCentered = isCentered;
- int realX = x;
-
- while (len > 0) {
- textWidth = gc.stringExtent(text.substring(0, len)).x;
- if (textWidth <= width) {
- break;
- }
- isReallyCentered = false;
- len--;
- }
- if (len > 0) {
- if (isReallyCentered) {
- realX += (width - textWidth) / 2;
- }
- gc.drawText(text.substring(0, len), realX, y, isTransparent);
- }
- return len;
- }
-
/**
* Draw text in a rectangle, trimming the text to prevent exceeding the specified width.
*
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2010, 2014 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:
- * Matthew Khouzam - Extracted from TmfEventsView
- ******************************************************************************/
-
-package org.eclipse.tracecompass.tmf.ui.widgets.virtualtable;
-
-/**
- * ColumnData
- *
- * @author Matthew Khouzam
- * @deprecated Use {@link org.eclipse.tracecompass.tmf.ui.viewers.events.columns.TmfEventTableColumn} instead.
- */
-@Deprecated
-public class ColumnData {
- /**
- * The title of the column
- */
- public final String header;
- /**
- * the width of the column in pixels
- */
- public final int width;
- /**
- * the alignment of the column
- */
- public final int alignment;
-
- /**
- * Constructor
- * @param h header (title)
- * @param w width
- * @param a alignment
- */
- public ColumnData(String h, int w, int a) {
- header = h;
- width = w;
- alignment = a;
- }
-
-}
}
}
- /**
- * Method setColumnHeaders.
- *
- * @param columnData
- * ColumnData[] the columndata array.
- */
- @Deprecated
- public void setColumnHeaders(ColumnData columnData[]) {
- /* No-op */
- }
-
/**
* Method removeAll.
* @return int 0 the number of elements in the table