mirror of https://github.com/mchr3k/org.intrace
Merge branch 'master' of github.com:mchr3k/org.intrace
This commit is contained in:
commit
d31a939597
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,4 +1,6 @@
|
|||
#Sun Nov 13 21:28:21 GMT 2011
|
||||
eclipse.preferences.version=1
|
||||
filesCopiedToWebInfLib=appengine-api-1.0-sdk-1.5.5.jar|appengine-api-labs-1.5.5.jar|appengine-jsr107cache-1.5.5.jar|jsr107cache-1.1.jar|datanucleus-appengine-1.0.9.final.jar|datanucleus-core-1.1.5.jar|datanucleus-jpa-1.1.5.jar|geronimo-jpa_3.0_spec-1.1.1.jar|geronimo-jta_1.1_spec-1.1.1.jar|jdo2-api-2.3-eb.jar
|
||||
filesCopiedToWebInfLib=appengine-api-1.0-sdk-1.6.3.jar|appengine-api-labs-1.6.3.jar|appengine-jsr107cache-1.6.3.jar|jsr107cache-1.1.jar|datanucleus-appengine-1.0.10.final.jar|datanucleus-core-1.1.5.jar|datanucleus-jpa-1.1.5.jar|geronimo-jpa_3.0_spec-1.1.1.jar|geronimo-jta_1.1_spec-1.1.1.jar|jdo2-api-2.3-eb.jar
|
||||
gaeDeployDialogSettings=
|
||||
gaeIsEclipseDefaultInstPath=true
|
||||
googleCloudSqlEnabled=false
|
||||
localDevMySqlEnabled=true
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -3,7 +3,7 @@
|
|||
<description name="InTrace Update Site">
|
||||
InTrace Update Site
|
||||
</description>
|
||||
<feature url="features/intrace.ecl.feature_0.17.0.jar" id="intrace.ecl.feature" version="0.17">
|
||||
<feature url="features/intrace.ecl.feature_0.18.0.jar" id="intrace.ecl.feature" version="0.18">
|
||||
<category name="intrace.ecl.category"/>
|
||||
</feature>
|
||||
<category-def name="intrace.ecl.category" label="InTrace Eclipse Plugin"/>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<feature
|
||||
id="intrace.ecl.feature"
|
||||
label="InTrace Eclipse Plugin"
|
||||
version="0.17">
|
||||
version="0.18">
|
||||
|
||||
<description url="https://github.com/mchr3k/org.intrace/wiki">
|
||||
Enable launching Java Applications with the InTrace agent.
|
||||
|
|
@ -215,6 +215,6 @@ litigation.
|
|||
id="intrace.ecl"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.17.0"/>
|
||||
version="0.18.0"/>
|
||||
|
||||
</feature>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: InTrace Eclipse
|
||||
Bundle-SymbolicName: intrace.ecl;singleton:=true
|
||||
Bundle-Version: 0.17
|
||||
Bundle-Version: 0.18
|
||||
Bundle-Activator: intrace.ecl.Activator
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -9,6 +9,7 @@ import java.net.ServerSocket;
|
|||
import java.net.Socket;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
|
|
@ -20,27 +21,27 @@ import org.intrace.shared.AgentConfigConstants;
|
|||
* This class wraps the state associated with a single InTrace enabled launch.
|
||||
*/
|
||||
public class InTraceLaunch implements Runnable
|
||||
{
|
||||
{
|
||||
/**
|
||||
* Server socket used for callback connection from InTrace agent
|
||||
*/
|
||||
private final ServerSocket callbackserver;
|
||||
|
||||
|
||||
/**
|
||||
* Active connection established as part of InTrace callback
|
||||
*/
|
||||
private Socket clientConnection = null;
|
||||
|
||||
|
||||
/**
|
||||
* Server port which the InTrace agent is listening on
|
||||
*/
|
||||
public String agentServerPort = null;
|
||||
|
||||
|
||||
/**
|
||||
* Currently active InTrace editor
|
||||
*/
|
||||
private InTraceEditor editor = null;
|
||||
|
||||
|
||||
/**
|
||||
* Action which opens the InTrace editor
|
||||
*/
|
||||
|
|
@ -49,19 +50,28 @@ public class InTraceLaunch implements Runnable
|
|||
/**
|
||||
* Main class being launched
|
||||
*/
|
||||
private final String mainClass;
|
||||
public final String mainClass;
|
||||
|
||||
/**
|
||||
* Associated launch configuration
|
||||
*/
|
||||
public final ILaunchConfiguration configuration;
|
||||
|
||||
/**
|
||||
* Construct an instance to listen on a provided ServerSocket
|
||||
* @param xiMainClass
|
||||
* @param xiMainClass
|
||||
* @param xiServer
|
||||
* @param xiConfiguration
|
||||
*/
|
||||
public InTraceLaunch(String xiMainClass, ServerSocket xiServer)
|
||||
public InTraceLaunch(String xiMainClass,
|
||||
ServerSocket xiServer,
|
||||
ILaunchConfiguration xiConfiguration)
|
||||
{
|
||||
this.mainClass = xiMainClass;
|
||||
this.callbackserver = xiServer;
|
||||
this.callbackserver = xiServer;
|
||||
this.configuration = xiConfiguration;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void run()
|
||||
|
|
@ -70,13 +80,13 @@ public class InTraceLaunch implements Runnable
|
|||
{
|
||||
// Listen for incoming callback connection
|
||||
clientConnection = callbackserver.accept();
|
||||
|
||||
// Connected! Time to discover the server port.
|
||||
|
||||
// Connected! Time to discover the server port.
|
||||
ObjectOutputStream out = new ObjectOutputStream(clientConnection.getOutputStream());
|
||||
out.writeObject("getsettings");
|
||||
out.flush();
|
||||
|
||||
// Read the returned settings, discard any instrumentation status messages
|
||||
|
||||
// Read the returned settings, discard any instrumentation status messages
|
||||
ObjectInputStream in;
|
||||
while (agentServerPort == null)
|
||||
{
|
||||
|
|
@ -88,29 +98,17 @@ public class InTraceLaunch implements Runnable
|
|||
agentServerPort = settingsMap.get(AgentConfigConstants.SERVER_PORT);
|
||||
}
|
||||
}
|
||||
|
||||
// Setup the main class for instrumenation
|
||||
if (mainClass != null)
|
||||
{
|
||||
out = new ObjectOutputStream(clientConnection.getOutputStream());
|
||||
out.writeObject(AgentConfigConstants.CLASS_REGEX + mainClass);
|
||||
out.flush();
|
||||
|
||||
// Read the response and ignore it
|
||||
in = new ObjectInputStream(clientConnection.getInputStream());
|
||||
in.readObject();
|
||||
}
|
||||
|
||||
|
||||
// Notify the UI that we have got a connection
|
||||
notifyClientConnection();
|
||||
}
|
||||
catch (Throwable th)
|
||||
{
|
||||
Util.handleStatus(Util.createErrorStatus("Error during InTrace launch", th),
|
||||
Util.handleStatus(Util.createErrorStatus("Error during InTrace launch", th),
|
||||
StatusManager.SHOW | StatusManager.LOG);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Mark that a connection is ready
|
||||
*/
|
||||
|
|
@ -142,7 +140,7 @@ public class InTraceLaunch implements Runnable
|
|||
}
|
||||
return clientConnection;
|
||||
}
|
||||
|
||||
|
||||
public synchronized InTraceEditor getEditor()
|
||||
{
|
||||
return editor;
|
||||
|
|
@ -157,11 +155,11 @@ public class InTraceLaunch implements Runnable
|
|||
{
|
||||
this.openeditoraction = openeditoraction;
|
||||
}
|
||||
|
||||
|
||||
public synchronized void destroy()
|
||||
{
|
||||
final IAction action = openeditoraction;
|
||||
|
||||
|
||||
if (action != null)
|
||||
{
|
||||
// Disable action
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package intrace.ecl.ui.launching;
|
||||
|
||||
import intrace.ecl.Activator;
|
||||
import intrace.ecl.Util;
|
||||
import intrace.ecl.ui.output.InTraceEditor;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -8,11 +10,13 @@ import java.util.List;
|
|||
|
||||
import net.miginfocom.swt.MigLayout;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.debug.core.ILaunch;
|
||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
||||
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
|
||||
import org.eclipse.debug.ui.ILaunchConfigurationTab;
|
||||
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
|
|
@ -22,27 +26,35 @@ import org.eclipse.swt.widgets.Control;
|
|||
import org.eclipse.swt.widgets.Display;
|
||||
import org.intrace.client.gui.helper.ClientStrings;
|
||||
import org.intrace.client.gui.helper.InTraceUI;
|
||||
import org.intrace.client.gui.helper.TraceFilterThread;
|
||||
import org.intrace.client.gui.helper.InTraceUI.UIMode;
|
||||
import org.intrace.client.gui.helper.InTraceUI.UIModeData;
|
||||
import org.intrace.client.gui.helper.IncludeExcludeWindow;
|
||||
import org.intrace.client.gui.helper.IncludeExcludeWindow.PatternInputCallback;
|
||||
import org.intrace.client.gui.helper.TraceFilterThread;
|
||||
|
||||
class InTraceLaunchConfigTab implements ILaunchConfigurationTab
|
||||
public class InTraceLaunchConfigTab implements ILaunchConfigurationTab
|
||||
{
|
||||
private Image icon16;
|
||||
private Display display;
|
||||
private Composite composite;
|
||||
private Button classesButton;
|
||||
|
||||
private String classRegex = "";
|
||||
private String classExcludeRegex = "";
|
||||
|
||||
private List<String> includePattern = TraceFilterThread.MATCH_ALL;
|
||||
private List<String> excludePattern = TraceFilterThread.MATCH_NONE;
|
||||
|
||||
|
||||
private String classIncludePattern = "";
|
||||
private String classExcludePattern = "";
|
||||
|
||||
private List<String> outputIncludePattern = TraceFilterThread.MATCH_ALL;
|
||||
private List<String> outputExcludePattern = TraceFilterThread.MATCH_NONE;
|
||||
|
||||
private Button textFilter;
|
||||
|
||||
public static final String CLASS_INCL_ATTR = "INTRACE_CLASS_INCL_ATTR";
|
||||
public static final String CLASS_EXCL_ATTR = "INTRACE_CLASS_EXCL_ATTR";
|
||||
public static final String OUTPUT_INCL_ATTR = "OUTPUT_CLASS_INCL_ATTR";
|
||||
public static final String OUTPUT_EXCL_ATTR = "OUTPUT_CLASS_EXCL_ATTR";
|
||||
|
||||
private ILaunchConfigurationDialog dialog;
|
||||
private ILaunchConfigurationWorkingCopy wc;
|
||||
|
||||
@Override
|
||||
public void createControl(Composite parent)
|
||||
{
|
||||
|
|
@ -51,13 +63,13 @@ class InTraceLaunchConfigTab implements ILaunchConfigurationTab
|
|||
|
||||
composite = new Composite(parent, SWT.NONE);
|
||||
composite.setLayout(tabLayout);
|
||||
|
||||
|
||||
classesButton = new Button(composite, SWT.PUSH);
|
||||
classesButton.setText("Classes To Trace...");
|
||||
classesButton.setLayoutData("growx,wrap");
|
||||
|
||||
final UIModeData modeData = InTraceEditor.getUIModeData();
|
||||
|
||||
|
||||
classesButton
|
||||
.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter()
|
||||
{
|
||||
|
|
@ -69,73 +81,76 @@ class InTraceLaunchConfigTab implements ILaunchConfigurationTab
|
|||
modeData,
|
||||
new PatternInputCallback()
|
||||
{
|
||||
private List<String> includePattern = null;
|
||||
private List<String> excludePattern = null;
|
||||
private List<String> localIncludePattern = null;
|
||||
private List<String> localExcludePattern = null;
|
||||
|
||||
@Override
|
||||
public void setIncludePattern(List<String> newIncludePattern)
|
||||
{
|
||||
includePattern = newIncludePattern;
|
||||
localIncludePattern = newIncludePattern;
|
||||
savePatterns();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExcludePattern(List<String> newExcludePattern)
|
||||
{
|
||||
excludePattern = newExcludePattern;
|
||||
localExcludePattern = newExcludePattern;
|
||||
savePatterns();
|
||||
}
|
||||
|
||||
private void savePatterns()
|
||||
{
|
||||
if ((includePattern != null) && (excludePattern != null))
|
||||
if ((localIncludePattern != null) && (localExcludePattern != null))
|
||||
{
|
||||
setRegex(InTraceUI.getStringFromList(includePattern),
|
||||
InTraceUI.getStringFromList(excludePattern));
|
||||
setRegex(InTraceUI.getStringFromList(localIncludePattern),
|
||||
InTraceUI.getStringFromList(localExcludePattern));
|
||||
}
|
||||
}
|
||||
},
|
||||
InTraceUI.getListFromString(classRegex),
|
||||
InTraceUI.getListFromString(classExcludeRegex),
|
||||
},
|
||||
InTraceUI.getListFromString(classIncludePattern),
|
||||
InTraceUI.getListFromString(classExcludePattern),
|
||||
InTraceUI.ALLOW_CLASSES);
|
||||
InTraceUI.placeDialogInCenter(display.getBounds(), regexInput.sWindow);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
textFilter = new Button(composite, SWT.PUSH);
|
||||
textFilter.setText("Trace Filters...");
|
||||
textFilter.setLayoutData("growx");
|
||||
|
||||
|
||||
final PatternInputCallback patternCallback = new PatternInputCallback()
|
||||
{
|
||||
private List<String> localIncludePattern = TraceFilterThread.MATCH_ALL;
|
||||
private List<String> localExcludePattern = TraceFilterThread.MATCH_NONE;
|
||||
|
||||
@Override
|
||||
public void setIncludePattern(List<String> newIncludePattern)
|
||||
{
|
||||
includePattern = newIncludePattern;
|
||||
localIncludePattern = newIncludePattern;
|
||||
savePatterns();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExcludePattern(List<String> newExcludePattern)
|
||||
{
|
||||
excludePattern = newExcludePattern;
|
||||
localExcludePattern = newExcludePattern;
|
||||
savePatterns();
|
||||
}
|
||||
|
||||
private void savePatterns()
|
||||
{
|
||||
if ((includePattern != null) && (excludePattern != null))
|
||||
if ((localIncludePattern != null) && (localExcludePattern != null))
|
||||
{
|
||||
if (includePattern.equals(TraceFilterThread.MATCH_NONE) &&
|
||||
excludePattern.equals(TraceFilterThread.MATCH_NONE))
|
||||
if (localIncludePattern.equals(TraceFilterThread.MATCH_NONE) &&
|
||||
localExcludePattern.equals(TraceFilterThread.MATCH_NONE))
|
||||
{
|
||||
includePattern = TraceFilterThread.MATCH_ALL;
|
||||
localIncludePattern = TraceFilterThread.MATCH_ALL;
|
||||
}
|
||||
applyPatterns(includePattern, excludePattern);
|
||||
applyPatterns(localIncludePattern, localExcludePattern);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
textFilter
|
||||
.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter()
|
||||
{
|
||||
|
|
@ -145,25 +160,33 @@ class InTraceLaunchConfigTab implements ILaunchConfigurationTab
|
|||
IncludeExcludeWindow regexInput;
|
||||
regexInput = new IncludeExcludeWindow("Output Filter", ClientStrings.FILTER_HELP_TEXT, UIMode.ECLIPSE,
|
||||
modeData,
|
||||
patternCallback,
|
||||
includePattern,
|
||||
excludePattern,
|
||||
patternCallback,
|
||||
outputIncludePattern,
|
||||
outputExcludePattern,
|
||||
InTraceUI.ALLOW_ALL);
|
||||
InTraceUI.placeDialogInCenter(display.getBounds(), regexInput.sWindow);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setRegex(String stringFromList,
|
||||
String stringFromList2)
|
||||
private void setRegex(String classIncludePattern,
|
||||
String classExcludePattern)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
this.classIncludePattern = classIncludePattern;
|
||||
this.classExcludePattern = classExcludePattern;
|
||||
wc.setAttribute(CLASS_INCL_ATTR, classIncludePattern);
|
||||
wc.setAttribute(CLASS_EXCL_ATTR, classExcludePattern);
|
||||
dialog.updateButtons();
|
||||
}
|
||||
|
||||
private void applyPatterns(List<String> includePattern2,
|
||||
List<String> excludePattern2)
|
||||
private void applyPatterns(List<String> outputIncludePattern,
|
||||
List<String> outputExcludePattern)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
this.outputIncludePattern = outputIncludePattern;
|
||||
this.outputExcludePattern = outputExcludePattern;
|
||||
wc.setAttribute(OUTPUT_INCL_ATTR, outputIncludePattern);
|
||||
wc.setAttribute(OUTPUT_EXCL_ATTR, outputExcludePattern);
|
||||
dialog.updateButtons();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -175,31 +198,53 @@ class InTraceLaunchConfigTab implements ILaunchConfigurationTab
|
|||
@Override
|
||||
public void setLaunchConfigurationDialog(ILaunchConfigurationDialog dialog)
|
||||
{
|
||||
// Do nothing
|
||||
this.dialog = dialog;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initializeFrom(ILaunchConfiguration configuration)
|
||||
{
|
||||
// Ignore
|
||||
try
|
||||
{
|
||||
classIncludePattern = configuration.getAttribute(CLASS_INCL_ATTR, "");
|
||||
classExcludePattern = configuration.getAttribute(CLASS_EXCL_ATTR, "");
|
||||
outputIncludePattern = configuration.getAttribute(OUTPUT_INCL_ATTR, TraceFilterThread.MATCH_ALL);
|
||||
outputExcludePattern = configuration.getAttribute(OUTPUT_EXCL_ATTR, TraceFilterThread.MATCH_NONE);
|
||||
}
|
||||
catch (CoreException e)
|
||||
{
|
||||
Activator.getDefault().getLog().log(Util.createErrorStatus("Error", e));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaults(ILaunchConfigurationWorkingCopy configuration)
|
||||
{
|
||||
// Do nothing
|
||||
try
|
||||
{
|
||||
String mainClass = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "");
|
||||
configuration.setAttribute(CLASS_INCL_ATTR, mainClass);
|
||||
}
|
||||
catch (CoreException e)
|
||||
{
|
||||
Activator.getDefault().getLog().log(Util.createErrorStatus("Error", e));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose()
|
||||
{
|
||||
icon16.dispose();
|
||||
if (icon16 != null)
|
||||
{
|
||||
icon16.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performApply(ILaunchConfigurationWorkingCopy configuration)
|
||||
{
|
||||
// Ignore
|
||||
// ??
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -223,7 +268,7 @@ class InTraceLaunchConfigTab implements ILaunchConfigurationTab
|
|||
@Override
|
||||
public boolean canSave()
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -243,7 +288,7 @@ class InTraceLaunchConfigTab implements ILaunchConfigurationTab
|
|||
{
|
||||
ClassLoader loader = InTraceLaunchConfigTab.class.getClassLoader();
|
||||
InputStream is16 = loader.getResourceAsStream(
|
||||
"org/intrace/icons/intrace16.gif");
|
||||
"org/intrace/icons/intrace16.gif");
|
||||
icon16 = new Image(display, is16);
|
||||
try
|
||||
{
|
||||
|
|
@ -259,12 +304,12 @@ class InTraceLaunchConfigTab implements ILaunchConfigurationTab
|
|||
@Override
|
||||
public void activated(ILaunchConfigurationWorkingCopy workingCopy)
|
||||
{
|
||||
// Ignore
|
||||
this.wc = workingCopy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deactivated(ILaunchConfigurationWorkingCopy workingCopy)
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -45,12 +45,12 @@ public class LaunchConfigurationDelegate extends
|
|||
* Config key used to save the launch ID into an ILaunch object
|
||||
*/
|
||||
public static final String INTRACE_LAUNCHKEY = "INTRACE_LAUNCHKEY";
|
||||
|
||||
|
||||
/**
|
||||
* Map of active launches
|
||||
*/
|
||||
public static final Map<Long, InTraceLaunch> intraceLaunches = new ConcurrentHashMap<Long, InTraceLaunch>();
|
||||
|
||||
|
||||
/**
|
||||
* AtommicLong used to generate launch IDs
|
||||
*/
|
||||
|
|
@ -68,6 +68,7 @@ public class LaunchConfigurationDelegate extends
|
|||
|
||||
// IExecutableExtension interface:
|
||||
|
||||
@Override
|
||||
public void setInitializationData(IConfigurationElement config,
|
||||
String propertyName, Object data) throws CoreException
|
||||
{
|
||||
|
|
@ -99,24 +100,36 @@ public class LaunchConfigurationDelegate extends
|
|||
{
|
||||
// Create working copy launch config
|
||||
ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
|
||||
|
||||
|
||||
// Identify the main class
|
||||
String mainClass = wc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "");
|
||||
|
||||
|
||||
// Make sure main class will be instrumented
|
||||
String classIncludePattern = configuration.getAttribute(InTraceLaunchConfigTab.CLASS_INCL_ATTR, "");
|
||||
if ("".equals(classIncludePattern))
|
||||
{
|
||||
classIncludePattern = mainClass;
|
||||
ILaunchConfigurationWorkingCopy wc2 = configuration.getWorkingCopy();
|
||||
wc2.setAttribute(InTraceLaunchConfigTab.CLASS_INCL_ATTR, classIncludePattern);
|
||||
wc2.doSave();
|
||||
}
|
||||
|
||||
// Prepare InTraceLaunch object to handle callback connection
|
||||
ServerSocket callbackServer = new ServerSocket(0);
|
||||
final InTraceLaunch intraceLaunch = new InTraceLaunch(mainClass, callbackServer);
|
||||
final InTraceLaunch intraceLaunch = new InTraceLaunch(mainClass,
|
||||
callbackServer,
|
||||
configuration);
|
||||
intraceLaunch.start();
|
||||
|
||||
|
||||
// Save off launch object for later access
|
||||
Long connId = intraceLaunchId.getAndIncrement();
|
||||
intraceLaunches.put(connId, intraceLaunch);
|
||||
launch.setAttribute(INTRACE_LAUNCHKEY, Long.toString(connId));
|
||||
|
||||
|
||||
// Setup a launch listener to cleanup the intrace launch object
|
||||
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
|
||||
manager.addLaunchListener(new LaunchListener(launch, connId));
|
||||
|
||||
manager.addLaunchListener(new LaunchListener(launch, connId));
|
||||
|
||||
// Add VM arguments
|
||||
String vmArgs = wc.getAttribute(
|
||||
IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "");
|
||||
|
|
@ -148,7 +161,7 @@ public class LaunchConfigurationDelegate extends
|
|||
}
|
||||
catch (PartInitException ex)
|
||||
{
|
||||
Util.handleStatus(Util.createErrorStatus("Failed to open InTrace Output", ex),
|
||||
Util.handleStatus(Util.createErrorStatus("Failed to open InTrace Output", ex),
|
||||
StatusManager.SHOW);
|
||||
}
|
||||
}
|
||||
|
|
@ -160,11 +173,11 @@ public class LaunchConfigurationDelegate extends
|
|||
}
|
||||
catch (IOException e1)
|
||||
{
|
||||
Util.handleStatus(Util.createErrorStatus("InTrace launch failed", e1),
|
||||
Util.handleStatus(Util.createErrorStatus("InTrace launch failed", e1),
|
||||
StatusManager.SHOW);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Launch listener which handles the cleanup of entries in the intraceLaunches map
|
||||
*/
|
||||
|
|
@ -179,7 +192,7 @@ public class LaunchConfigurationDelegate extends
|
|||
|
||||
private final ILaunch targetlaunch;
|
||||
private final Long intraceLaunchId;
|
||||
|
||||
|
||||
@Override
|
||||
public void launchesRemoved(ILaunch[] launches)
|
||||
{
|
||||
|
|
@ -206,17 +219,17 @@ public class LaunchConfigurationDelegate extends
|
|||
if (launch == targetlaunch)
|
||||
{
|
||||
InTraceLaunch intraceLaunch = intraceLaunches.remove(intraceLaunchId);
|
||||
|
||||
|
||||
if (intraceLaunch != null)
|
||||
{
|
||||
intraceLaunch.destroy();
|
||||
}
|
||||
|
||||
|
||||
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
|
||||
manager.removeLaunchListener(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
package intrace.ecl.ui.launching;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import intrace.ecl.Util;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ public class EditorInput implements IEditorInput
|
|||
{
|
||||
public final InTraceLaunch callback;
|
||||
public final InputType type;
|
||||
|
||||
|
||||
public enum InputType
|
||||
{
|
||||
NEWCONNECTION,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,17 @@
|
|||
package intrace.ecl.ui.output;
|
||||
|
||||
import intrace.ecl.Activator;
|
||||
import intrace.ecl.Util;
|
||||
import intrace.ecl.ui.launching.InTraceLaunchConfigTab;
|
||||
import intrace.ecl.ui.output.EditorInput.InputType;
|
||||
|
||||
import java.net.Socket;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
||||
import org.eclipse.jface.resource.ColorRegistry;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
|
|
@ -21,13 +28,16 @@ import org.eclipse.ui.part.EditorPart;
|
|||
import org.eclipse.ui.themes.ITheme;
|
||||
import org.intrace.client.gui.helper.Connection.ConnectState;
|
||||
import org.intrace.client.gui.helper.InTraceUI;
|
||||
import org.intrace.client.gui.helper.InTraceUI.ConfigDataInterface;
|
||||
import org.intrace.client.gui.helper.InTraceUI.ConfigDataInterface.Callback;
|
||||
import org.intrace.client.gui.helper.InTraceUI.IConnectionStateCallback;
|
||||
import org.intrace.client.gui.helper.InTraceUI.UIMode;
|
||||
import org.intrace.client.gui.helper.InTraceUI.UIModeData;
|
||||
import org.intrace.client.gui.helper.TraceFilterThread;
|
||||
|
||||
@SuppressWarnings("restriction")
|
||||
public class InTraceEditor extends EditorPart
|
||||
{
|
||||
{
|
||||
private InTraceUI inTraceUI;
|
||||
private EditorInput intraceInput;
|
||||
|
||||
|
|
@ -37,37 +47,121 @@ public class InTraceEditor extends EditorPart
|
|||
}
|
||||
|
||||
public static UIModeData getUIModeData()
|
||||
{
|
||||
{
|
||||
IWorkbench workBench = PlatformUI.getWorkbench();
|
||||
ITheme theme = workBench.getThemeManager().getCurrentTheme();
|
||||
ColorRegistry colreg = theme.getColorRegistry();
|
||||
|
||||
Color c1 = colreg.get(IWorkbenchThemeConstants.ACTIVE_TAB_BG_START);
|
||||
Color c2 = colreg.get(IWorkbenchThemeConstants.ACTIVE_TAB_BG_END);
|
||||
UIModeData data = new UIModeData(c1, c2);
|
||||
|
||||
Color activec1 = colreg.get(IWorkbenchThemeConstants.ACTIVE_TAB_BG_START);
|
||||
Color activec2 = colreg.get(IWorkbenchThemeConstants.ACTIVE_TAB_BG_END);
|
||||
Color inactivec1 = colreg.get(IWorkbenchThemeConstants.INACTIVE_TAB_BG_START);
|
||||
Color inactivec2 = colreg.get(IWorkbenchThemeConstants.INACTIVE_TAB_BG_END);
|
||||
UIModeData data = new UIModeData(activec1, activec2,
|
||||
inactivec1, inactivec2);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void createPartControl(final Composite parent)
|
||||
{
|
||||
Composite ui = new Composite(parent, SWT.NONE);
|
||||
|
||||
UIModeData data = getUIModeData();
|
||||
|
||||
|
||||
intraceInput = (EditorInput)getEditorInput();
|
||||
|
||||
final ILaunchConfiguration config = intraceInput.callback.configuration;
|
||||
String classIncludePattern = null;
|
||||
String classExcludePattern = null;
|
||||
List<String> outputIncludePattern = null;
|
||||
List<String> outputExcludePattern = null;
|
||||
|
||||
if (intraceInput.type == InputType.NEWCONNECTION)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Only apply class patterns for a new connection as the agent will remember them
|
||||
// for an existing connection.
|
||||
classIncludePattern = config.getAttribute(InTraceLaunchConfigTab.CLASS_INCL_ATTR, "");
|
||||
classExcludePattern = config.getAttribute(InTraceLaunchConfigTab.CLASS_EXCL_ATTR, "");
|
||||
}
|
||||
catch (CoreException e)
|
||||
{
|
||||
Activator.getDefault().getLog().log(Util.createErrorStatus("Error", e));
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
outputIncludePattern = config.getAttribute(InTraceLaunchConfigTab.OUTPUT_INCL_ATTR, TraceFilterThread.MATCH_ALL);
|
||||
outputExcludePattern = config.getAttribute(InTraceLaunchConfigTab.OUTPUT_EXCL_ATTR, TraceFilterThread.MATCH_NONE);
|
||||
}
|
||||
catch (CoreException e)
|
||||
{
|
||||
Activator.getDefault().getLog().log(Util.createErrorStatus("Error", e));
|
||||
}
|
||||
|
||||
Callback cb = new Callback()
|
||||
{
|
||||
@Override
|
||||
public void setClassConfig(String classIncludePattern,
|
||||
String classExcludePattern)
|
||||
{
|
||||
try
|
||||
{
|
||||
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
|
||||
|
||||
wc.setAttribute(InTraceLaunchConfigTab.CLASS_INCL_ATTR, classIncludePattern);
|
||||
wc.setAttribute(InTraceLaunchConfigTab.CLASS_EXCL_ATTR, classExcludePattern);
|
||||
|
||||
wc.doSave();
|
||||
}
|
||||
catch (CoreException e)
|
||||
{
|
||||
Activator.getDefault().getLog().log(Util.createErrorStatus("Error", e));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOutputConfig(List<String> outputIncludePattern,
|
||||
List<String> outputExcludePattern)
|
||||
{
|
||||
try
|
||||
{
|
||||
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
|
||||
|
||||
wc.setAttribute(InTraceLaunchConfigTab.OUTPUT_INCL_ATTR, outputIncludePattern);
|
||||
wc.setAttribute(InTraceLaunchConfigTab.OUTPUT_EXCL_ATTR, outputExcludePattern);
|
||||
|
||||
wc.doSave();
|
||||
}
|
||||
catch (CoreException e)
|
||||
{
|
||||
Activator.getDefault().getLog().log(Util.createErrorStatus("Error", e));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ConfigDataInterface configInterface = new ConfigDataInterface(classIncludePattern,
|
||||
classExcludePattern,
|
||||
outputIncludePattern,
|
||||
outputExcludePattern,
|
||||
cb);
|
||||
|
||||
IWorkbench workbench = PlatformUI.getWorkbench();
|
||||
final Display display = workbench.getDisplay();
|
||||
Shell window = display.getActiveShell();
|
||||
inTraceUI = new InTraceUI(window, ui, UIMode.ECLIPSE, data);
|
||||
inTraceUI = new InTraceUI(window, ui, UIMode.ECLIPSE, data, configInterface);
|
||||
inTraceUI.setConnCallback(new IConnectionStateCallback()
|
||||
{
|
||||
{
|
||||
@Override
|
||||
public void setConnectionState(final ConnectState state)
|
||||
{
|
||||
if (!parent.isDisposed())
|
||||
{
|
||||
display.syncExec(new Runnable()
|
||||
{
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
|
|
@ -78,23 +172,23 @@ public class InTraceEditor extends EditorPart
|
|||
}
|
||||
});
|
||||
inTraceUI.setConnectionState(ConnectState.CONNECTING);
|
||||
intraceInput = (EditorInput)getEditorInput();
|
||||
|
||||
if (intraceInput.type == InputType.NEWCONNECTION)
|
||||
{
|
||||
new Thread(new Runnable()
|
||||
{
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
try
|
||||
{
|
||||
{
|
||||
Socket connection = intraceInput.callback.getClientConnection();
|
||||
inTraceUI.setFixedLocalConnection(connection);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
|
@ -106,12 +200,12 @@ public class InTraceEditor extends EditorPart
|
|||
}
|
||||
|
||||
@Override
|
||||
public void init(IEditorSite site,
|
||||
public void init(IEditorSite site,
|
||||
IEditorInput input)
|
||||
throws PartInitException
|
||||
{
|
||||
setSite(site);
|
||||
setInput(input);
|
||||
setInput(input);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -121,16 +215,19 @@ public class InTraceEditor extends EditorPart
|
|||
{
|
||||
intraceInput.callback.setEditor(null);
|
||||
}
|
||||
inTraceUI.dispose();
|
||||
if (inTraceUI != null)
|
||||
{
|
||||
inTraceUI.dispose();
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setFocus()
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void doSave(IProgressMonitor monitor)
|
||||
{
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -3,7 +3,7 @@
|
|||
<description name="InTrace Update Site">
|
||||
InTrace Update Site
|
||||
</description>
|
||||
<feature url="features/intrace.ecl.feature_0.17.0.jar" id="intrace.ecl.feature" version="0.17">
|
||||
<feature url="features/intrace.ecl.feature_0.18.0.jar" id="intrace.ecl.feature" version="0.18">
|
||||
<category name="intrace.ecl.category"/>
|
||||
</feature>
|
||||
<category-def name="intrace.ecl.category" label="InTrace Eclipse Plugin"/>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -17,31 +17,31 @@ public class InTraceStandaloneUI
|
|||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) throws IOException
|
||||
{
|
||||
{
|
||||
// Prepare window
|
||||
Display.setAppName("InTrace");
|
||||
final Shell window = new Shell();
|
||||
window.setSize(new Point(800, 800));
|
||||
window.setMinimumSize(new Point(800, 480));
|
||||
|
||||
window.setMinimumSize(new Point(800, 480));
|
||||
|
||||
// Load icons
|
||||
Display display = window.getDisplay();
|
||||
Image[] icons = InTraceUI.getIcons(display);
|
||||
window.setImages(icons);
|
||||
|
||||
|
||||
// Fill in UI
|
||||
InTraceUI ui = new InTraceUI(window, window, UIMode.STANDALONE, null);
|
||||
|
||||
InTraceUI ui = new InTraceUI(window, window, UIMode.STANDALONE, null, null);
|
||||
|
||||
// Register title callback
|
||||
ui.setConnCallback(new IConnectionStateCallback()
|
||||
{
|
||||
{
|
||||
@Override
|
||||
public void setConnectionState(final ConnectState state)
|
||||
{
|
||||
if (!window.isDisposed())
|
||||
{
|
||||
window.getDisplay().syncExec(new Runnable()
|
||||
{
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
|
|
@ -51,7 +51,7 @@ public class InTraceStandaloneUI
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Open UI
|
||||
ui.open();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@ public class ClientStrings
|
|||
public static final String ENABLE_FILE_OUTPUT = "File";
|
||||
public static final String ENABLE_NETWORK_OUTPUT = "Collect Trace";
|
||||
public static final String ENABLE_FILTER = "Filter";
|
||||
|
||||
public static final String ENABLE_METHOD_FILTER = "Ingore Repeated Methods";
|
||||
public static final String RESET_METHOD_FILTER = "Reset Repeated Methods";
|
||||
|
||||
public static final String DISCARD_FILTERED = "Discard Filtered Trace";
|
||||
public static final String DISCARD_EXCESS = "Discard Excess Trace";
|
||||
|
|
|
|||
|
|
@ -74,32 +74,10 @@ public class InTraceUI implements ISocketCallback, IControlConnectionListener
|
|||
private static final Pattern TRACE_LINE = Pattern.compile("^\\[[^\\]]+]:(\\[[^\\]]+\\]:([^:]+:[^:]+)):.*");
|
||||
|
||||
public static final Pattern ALLOW_ALL = Pattern.compile(".*");
|
||||
public static final Pattern ALLOW_CLASSES = Pattern.compile("^[0-9a-zA-Z\\.\\$]*|\\*$");
|
||||
public static final Pattern ALLOW_CLASSES = Pattern.compile("^[0-9a-zA-Z\\.\\$_]*|\\*$");
|
||||
|
||||
public void open()
|
||||
{
|
||||
// new Thread()
|
||||
// {
|
||||
// public void run()
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// Thread.sleep(500);
|
||||
// }
|
||||
// catch (InterruptedException e)
|
||||
// {
|
||||
// // Ignore
|
||||
// }
|
||||
// sWindow.getDisplay().syncExec(new Runnable()
|
||||
// {
|
||||
// @Override
|
||||
// public void run()
|
||||
// {
|
||||
// startProgramBar.show();
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
// }.start();
|
||||
placeDialogInCenter(sWindow.getDisplay().getPrimaryMonitor().getBounds(),
|
||||
sWindow);
|
||||
sWindow.open();
|
||||
|
|
@ -127,6 +105,8 @@ public class InTraceUI implements ISocketCallback, IControlConnectionListener
|
|||
final private StartProgramBar startProgramBar;
|
||||
final private OutputTabs outputTabs;
|
||||
|
||||
private final ConfigDataInterface configInterface;
|
||||
|
||||
public void setConnCallback(IConnectionStateCallback connCallback)
|
||||
{
|
||||
this.connCallback = connCallback;
|
||||
|
|
@ -144,21 +124,72 @@ public class InTraceUI implements ISocketCallback, IControlConnectionListener
|
|||
|
||||
public static class UIModeData
|
||||
{
|
||||
public UIModeData(Color colorOne, Color colorTwo)
|
||||
public UIModeData(Color activeColorOne,
|
||||
Color activeColorTwo,
|
||||
Color inactiveColorOne,
|
||||
Color inactiveColorTwo)
|
||||
{
|
||||
this.colorOne = colorOne;
|
||||
this.colorTwo = colorTwo;
|
||||
this.activeColorOne = activeColorOne;
|
||||
this.activeColorTwo = activeColorTwo;
|
||||
this.inactiveColorOne = inactiveColorOne;
|
||||
this.inactiveColorTwo = inactiveColorTwo;
|
||||
}
|
||||
public final Color colorOne;
|
||||
public final Color colorTwo;
|
||||
public final Color activeColorOne;
|
||||
public final Color activeColorTwo;
|
||||
public final Color inactiveColorOne;
|
||||
public final Color inactiveColorTwo;
|
||||
}
|
||||
|
||||
public InTraceUI(Shell xiWindow, Composite xiRoot, UIMode xiMode, UIModeData xiModeData)
|
||||
public static class ConfigDataInterface
|
||||
{
|
||||
public final String classIncludePattern;
|
||||
public final String classExcludePattern;
|
||||
|
||||
public final List<String> outputIncludePattern;
|
||||
public final List<String> outputExcludePattern;
|
||||
public final Callback callback;
|
||||
|
||||
public ConfigDataInterface(String classIncludePattern,
|
||||
String classExcludePattern,
|
||||
List<String> outputIncludePattern,
|
||||
List<String> outputExcludePattern,
|
||||
Callback callback)
|
||||
{
|
||||
this.classIncludePattern = classIncludePattern;
|
||||
this.classExcludePattern = classExcludePattern;
|
||||
this.outputIncludePattern = outputIncludePattern;
|
||||
this.outputExcludePattern = outputExcludePattern;
|
||||
this.callback = callback;
|
||||
}
|
||||
|
||||
public static interface Callback
|
||||
{
|
||||
public void setClassConfig(String classIncludePattern,
|
||||
String classExcludePattern);
|
||||
public void setOutputConfig(List<String> outputIncludePattern,
|
||||
List<String> outputExcludePattern);
|
||||
}
|
||||
}
|
||||
|
||||
public InTraceUI(Shell xiWindow,
|
||||
Composite xiRoot,
|
||||
UIMode xiMode,
|
||||
UIModeData xiModeData,
|
||||
ConfigDataInterface xiConfigInterface)
|
||||
{
|
||||
sWindow = xiWindow;
|
||||
sRoot = xiRoot;
|
||||
mode = xiMode;
|
||||
modeData = xiModeData;
|
||||
configInterface = xiConfigInterface;
|
||||
|
||||
if ((configInterface != null) &&
|
||||
(configInterface.classIncludePattern != null) &&
|
||||
(configInterface.classExcludePattern != null))
|
||||
{
|
||||
settingsData.classRegex = configInterface.classIncludePattern;
|
||||
settingsData.classExcludeRegex = configInterface.classExcludePattern;
|
||||
}
|
||||
|
||||
rootLayout = new MigLayout("fill,hidemode 2", "[]", "0[]0[]0[]0[]0[grow]");
|
||||
xiRoot.setLayout(rootLayout);
|
||||
|
|
@ -189,6 +220,21 @@ public class InTraceUI implements ISocketCallback, IControlConnectionListener
|
|||
outputTabs = new OutputTabs(xiRoot);
|
||||
outputTabs.composite.setLayoutData("grow,wmin 0,hmin 0");
|
||||
|
||||
if ((configInterface != null) &&
|
||||
(configInterface.outputIncludePattern != null) &&
|
||||
(configInterface.outputExcludePattern != null))
|
||||
{
|
||||
lastEnteredIncludeFilterPattern = configInterface.outputIncludePattern;
|
||||
lastEnteredExcludeFilterPattern = configInterface.outputExcludePattern;
|
||||
if (outputTabs.textOutputTab.enableFilter.getSelection())
|
||||
{
|
||||
outputTabs.textOutputTab.
|
||||
applyPatterns(configInterface.outputIncludePattern,
|
||||
configInterface.outputExcludePattern, false,
|
||||
settingsTabs.localOutputSettingsTab.discardFiltered.getSelection());
|
||||
}
|
||||
}
|
||||
|
||||
updateUIStateSameThread();
|
||||
|
||||
sWindow.getDisplay().addFilter(SWT.KeyDown, new Listener()
|
||||
|
|
@ -677,8 +723,8 @@ public class InTraceUI implements ISocketCallback, IControlConnectionListener
|
|||
if (modeData != null)
|
||||
{
|
||||
mSettingsCTabs.setSelectionBackground(
|
||||
new Color[]{modeData.colorOne,
|
||||
modeData.colorTwo},
|
||||
new Color[]{modeData.inactiveColorOne,
|
||||
modeData.inactiveColorTwo},
|
||||
new int[]{100}, true);
|
||||
}
|
||||
|
||||
|
|
@ -1026,8 +1072,8 @@ public class InTraceUI implements ISocketCallback, IControlConnectionListener
|
|||
if (modeData != null)
|
||||
{
|
||||
mOutputCTabs.setSelectionBackground(
|
||||
new Color[]{modeData.colorOne,
|
||||
modeData.colorTwo},
|
||||
new Color[]{modeData.activeColorOne,
|
||||
modeData.activeColorTwo},
|
||||
new int[]{100}, true);
|
||||
}
|
||||
|
||||
|
|
@ -1089,6 +1135,9 @@ public class InTraceUI implements ISocketCallback, IControlConnectionListener
|
|||
textFilter.setText(ClientStrings.FILTER_TEXT);
|
||||
textFilter.setLayoutData("grow");
|
||||
|
||||
Button resetMethodFilterBtn = new Button(composite, SWT.PUSH);
|
||||
resetMethodFilterBtn.setText(ClientStrings.RESET_METHOD_FILTER);
|
||||
|
||||
pBar = new ProgressBar(composite, SWT.NORMAL);
|
||||
pBar.setLayoutData("grow");
|
||||
pBar.setVisible(false);
|
||||
|
|
@ -1110,9 +1159,14 @@ public class InTraceUI implements ISocketCallback, IControlConnectionListener
|
|||
|
||||
enableFilter = new Button(composite, SWT.CHECK);
|
||||
enableFilter.setText(ClientStrings.ENABLE_FILTER);
|
||||
enableFilter.setLayoutData("grow,wrap,skip 2");
|
||||
enableFilter.setLayoutData("skip 2");
|
||||
enableFilter.setSelection(true);
|
||||
|
||||
Button enableMethodFilter = new Button(composite, SWT.CHECK);
|
||||
enableMethodFilter.setText(ClientStrings.ENABLE_METHOD_FILTER);
|
||||
enableMethodFilter.setLayoutData("wrap");
|
||||
enableMethodFilter.setSelection(false);
|
||||
|
||||
textOutput = new StyledText(composite, SWT.MULTI | SWT.V_SCROLL
|
||||
| SWT.H_SCROLL | SWT.BORDER);
|
||||
textOutput.setEditable(false);
|
||||
|
|
@ -1341,6 +1395,27 @@ public class InTraceUI implements ISocketCallback, IControlConnectionListener
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
enableMethodFilter
|
||||
.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter()
|
||||
{
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent arg0)
|
||||
{
|
||||
filterThread.methodFilterRecordingEnabled = !filterThread.methodFilterRecordingEnabled;
|
||||
}
|
||||
});
|
||||
|
||||
resetMethodFilterBtn
|
||||
.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter()
|
||||
{
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent arg0)
|
||||
{
|
||||
filterThread.resetMethodFilter();
|
||||
}
|
||||
});
|
||||
|
||||
networkOutput
|
||||
.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter()
|
||||
{
|
||||
|
|
@ -1418,6 +1493,12 @@ public class InTraceUI implements ISocketCallback, IControlConnectionListener
|
|||
}
|
||||
lastEnteredIncludeFilterPattern = includePattern;
|
||||
lastEnteredExcludeFilterPattern = excludePattern;
|
||||
|
||||
if (configInterface != null)
|
||||
{
|
||||
configInterface.callback.setOutputConfig(includePattern, excludePattern);
|
||||
}
|
||||
|
||||
if (enableFilter.getSelection())
|
||||
{
|
||||
applyPatterns(includePattern, excludePattern, false,
|
||||
|
|
@ -1897,8 +1978,7 @@ public class InTraceUI implements ISocketCallback, IControlConnectionListener
|
|||
private ControlConnectionThread controlThread;
|
||||
|
||||
// Settings
|
||||
private ParsedSettingsData settingsData = new ParsedSettingsData(
|
||||
new HashMap<String, String>());
|
||||
private ParsedSettingsData settingsData = new ParsedSettingsData(new HashMap<String, String>());
|
||||
|
||||
private List<String> lastEnteredIncludeFilterPattern = TraceFilterThread.MATCH_ALL;
|
||||
private List<String> activeIncludeFilterPattern = TraceFilterThread.MATCH_ALL;
|
||||
|
|
@ -1921,6 +2001,16 @@ public class InTraceUI implements ISocketCallback, IControlConnectionListener
|
|||
remoteAddress = socket.getInetAddress();
|
||||
controlThread = new ControlConnectionThread(socket, this);
|
||||
controlThread.start();
|
||||
|
||||
if ((configInterface != null) &&
|
||||
(configInterface.classIncludePattern != null) &&
|
||||
(configInterface.classExcludePattern != null))
|
||||
{
|
||||
controlThread.sendMessage(
|
||||
AgentConfigConstants.CLASS_REGEX + configInterface.classIncludePattern
|
||||
+ AgentConfigConstants.EXCLUDE_CLASS_REGEX + configInterface.classExcludePattern);
|
||||
}
|
||||
|
||||
controlThread.sendMessage("getsettings");
|
||||
setConnectionState(ConnectState.CONNECTED);
|
||||
|
||||
|
|
@ -2251,6 +2341,15 @@ public class InTraceUI implements ISocketCallback, IControlConnectionListener
|
|||
outputTabs.textOutputTab.filterThread
|
||||
.addSystemTraceLine("Latest Settings Received");
|
||||
settingsData = new ParsedSettingsData(settingsMap);
|
||||
|
||||
if ((configInterface != null) &&
|
||||
(settingsData.classRegex != null) &&
|
||||
(settingsData.classExcludeRegex != null))
|
||||
{
|
||||
configInterface.callback.setClassConfig(settingsData.classRegex,
|
||||
settingsData.classExcludeRegex);
|
||||
}
|
||||
|
||||
setConnectionState(ConnectState.CONNECTED);
|
||||
updateUIStateSameThread();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@ public class IncludeExcludeWindow
|
|||
{
|
||||
public final Shell sWindow;
|
||||
|
||||
private final TabFolder tabs;
|
||||
private final TabFolder tabs;
|
||||
private final CTabFolder ctabs;
|
||||
|
||||
|
||||
private final PatternInputCallback callback;
|
||||
|
||||
private PatternInput patterns;
|
||||
|
|
@ -51,7 +51,7 @@ public class IncludeExcludeWindow
|
|||
public IncludeExcludeWindow(String windowTitle, String helpText,
|
||||
UIMode mode,
|
||||
UIModeData modedata,
|
||||
PatternInputCallback callback,
|
||||
PatternInputCallback callback,
|
||||
java.util.List<String> initIncludePatterns,
|
||||
java.util.List<String> initExcludePatterns,
|
||||
Pattern allowedStrings)
|
||||
|
|
@ -68,7 +68,7 @@ public class IncludeExcludeWindow
|
|||
|
||||
sWindow = new Shell(SWT.APPLICATION_MODAL | SWT.CLOSE | SWT.TITLE
|
||||
| SWT.RESIZE);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
Display display = sWindow.getDisplay();
|
||||
|
|
@ -79,12 +79,13 @@ public class IncludeExcludeWindow
|
|||
{
|
||||
// Ignore
|
||||
}
|
||||
|
||||
|
||||
sWindow.setText(windowTitle);
|
||||
sWindow.setLayout(windowLayout);
|
||||
sWindow.setSize(new Point(400, 400));
|
||||
sWindow.setMinimumSize(new Point(400, 400));
|
||||
sWindow.addListener(SWT.Traverse, new Listener() {
|
||||
@Override
|
||||
public void handleEvent(Event event) {
|
||||
switch (event.detail) {
|
||||
case SWT.TRAVERSE_ESCAPE:
|
||||
|
|
@ -98,56 +99,56 @@ public class IncludeExcludeWindow
|
|||
|
||||
if (mode == UIMode.STANDALONE)
|
||||
{
|
||||
ctabs = null;
|
||||
ctabs = null;
|
||||
tabs = new TabFolder(sWindow, SWT.NONE);
|
||||
tabs.setLayoutData("grow,wrap,wmin 0,spanx 4");
|
||||
tabs.setLayoutData("grow,wrap,wmin 0,hmin 0,spanx 4");
|
||||
fillTabs(tabs, initIncludePatterns, initExcludePatterns, helpText);
|
||||
}
|
||||
else
|
||||
{
|
||||
tabs = null;
|
||||
tabs = null;
|
||||
ctabs = new CTabFolder(sWindow, SWT.TOP | SWT.BORDER);
|
||||
ctabs.setSimple(false);
|
||||
ctabs.setLayoutData("grow,wrap,wmin 0,spanx 4");
|
||||
ctabs.setLayoutData("grow,wrap,wmin 0,hmin 0,spanx 4");
|
||||
fillCTabs(ctabs, initIncludePatterns, initExcludePatterns, helpText);
|
||||
ctabs.setSelection(0);
|
||||
if (this.modedata != null)
|
||||
{
|
||||
ctabs.setSelectionBackground(
|
||||
new Color[]{this.modedata.colorOne,
|
||||
this.modedata.colorTwo},
|
||||
new Color[]{this.modedata.activeColorOne,
|
||||
this.modedata.activeColorTwo},
|
||||
new int[]{100}, true);
|
||||
}
|
||||
}
|
||||
|
||||
saveCancelButtons = new SaveCancelButtons(sWindow);
|
||||
|
||||
|
||||
// Focus on text input
|
||||
patterns.newPattern.patternInput.setFocus();
|
||||
}
|
||||
}
|
||||
|
||||
private void fillTabs(TabFolder tabFolder,
|
||||
java.util.List<String> initIncludePatterns,
|
||||
private void fillTabs(TabFolder tabFolder,
|
||||
java.util.List<String> initIncludePatterns,
|
||||
java.util.List<String> initExcludePatterns, String helpText)
|
||||
{
|
||||
TabItem patternsTabItem = new TabItem(tabFolder, SWT.NONE);
|
||||
patternsTabItem.setText("Include/Exclude");
|
||||
patterns = new PatternInput(tabFolder, initIncludePatterns, initExcludePatterns);
|
||||
patterns = new PatternInput(tabFolder, initIncludePatterns, initExcludePatterns);
|
||||
patternsTabItem.setControl(patterns.patternInputComp);
|
||||
|
||||
TabItem helpTabItem = new TabItem(tabFolder, SWT.NONE);
|
||||
helpTabItem.setText("Help");
|
||||
HelpOutputTab helpOutputTab = new HelpOutputTab(tabFolder, helpText);
|
||||
helpTabItem.setControl(helpOutputTab.composite);
|
||||
}
|
||||
}
|
||||
|
||||
private void fillCTabs(CTabFolder tabFolder,
|
||||
java.util.List<String> initIncludePatterns,
|
||||
private void fillCTabs(CTabFolder tabFolder,
|
||||
java.util.List<String> initIncludePatterns,
|
||||
java.util.List<String> initExcludePatterns, String helpText)
|
||||
{
|
||||
CTabItem patternsTabItem = new CTabItem(tabFolder, SWT.NONE);
|
||||
patternsTabItem.setText("Include/Exclude");
|
||||
patterns = new PatternInput(tabFolder, initIncludePatterns, initExcludePatterns);
|
||||
patterns = new PatternInput(tabFolder, initIncludePatterns, initExcludePatterns);
|
||||
patternsTabItem.setControl(patterns.patternInputComp);
|
||||
|
||||
CTabItem helpTabItem = new CTabItem(tabFolder, SWT.NONE);
|
||||
|
|
@ -155,7 +156,7 @@ public class IncludeExcludeWindow
|
|||
HelpOutputTab helpOutputTab = new HelpOutputTab(tabFolder, helpText);
|
||||
helpTabItem.setControl(helpOutputTab.composite);
|
||||
}
|
||||
|
||||
|
||||
private class HelpOutputTab
|
||||
{
|
||||
final StyledText textOutput;
|
||||
|
|
@ -168,14 +169,14 @@ public class IncludeExcludeWindow
|
|||
|
||||
composite = new Composite(parent, SWT.NONE);
|
||||
composite.setLayout(windowLayout);
|
||||
|
||||
|
||||
textOutput = new StyledText(composite, SWT.MULTI | SWT.V_SCROLL
|
||||
| SWT.BORDER | SWT.WRAP);
|
||||
textOutput.setEditable(false);
|
||||
textOutput.setLayoutData("spanx,grow,wmin 0,hmin 0");
|
||||
textOutput.setBackground(Display.getCurrent().getSystemColor(
|
||||
SWT.COLOR_WHITE));
|
||||
|
||||
|
||||
textOutput.setText(helpStr);
|
||||
}
|
||||
}
|
||||
|
|
@ -186,52 +187,52 @@ public class IncludeExcludeWindow
|
|||
private final PatternList patternList;
|
||||
private final Composite patternInputComp;
|
||||
|
||||
private IncludeExcludeHeaders model;
|
||||
|
||||
public PatternInput(Composite parent,
|
||||
java.util.List<String> initIncludePatterns,
|
||||
private IncludeExcludeHeaders model;
|
||||
|
||||
public PatternInput(Composite parent,
|
||||
java.util.List<String> initIncludePatterns,
|
||||
java.util.List<String> initExcludePatterns)
|
||||
{
|
||||
patternInputComp = new Composite(parent, SWT.NONE);
|
||||
MigLayout inputLayout = new MigLayout("fill", "[grow]", "[25][grow]");
|
||||
patternInputComp.setLayout(inputLayout);
|
||||
patternInputComp.setLayoutData("grow,wrap,spanx");
|
||||
patternInputComp.setLayoutData("grow,wrap,spanx,hmin 0");
|
||||
|
||||
newPattern = new NewPattern(patternInputComp);
|
||||
patternList = new PatternList(patternInputComp);
|
||||
|
||||
|
||||
model = new IncludeExcludeHeaders(new IncludeExcludeHeaders.IncludeExcludeList()
|
||||
{
|
||||
{
|
||||
@Override
|
||||
public void remove(int xiIndex)
|
||||
{
|
||||
patternList.patternSet.remove(xiIndex);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String[] getItems()
|
||||
{
|
||||
return patternList.patternSet.getItems();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void add(String xiItem, int xiIndex)
|
||||
{
|
||||
patternList.patternSet.add(xiItem, xiIndex);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void add(String xiItem)
|
||||
{
|
||||
patternList.patternSet.add(xiItem);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
parsePatternSet(true, initIncludePatterns);
|
||||
parsePatternSet(false, initExcludePatterns);
|
||||
}
|
||||
|
||||
private void parsePatternSet(boolean xiInclude,
|
||||
|
||||
private void parsePatternSet(boolean xiInclude,
|
||||
java.util.List<String> initPattern)
|
||||
{
|
||||
for (String pattern : initPattern)
|
||||
|
|
@ -242,7 +243,7 @@ public class IncludeExcludeWindow
|
|||
|
||||
private void parsePattern(boolean xiInclude, String pattern)
|
||||
{
|
||||
if ((pattern != null) &&
|
||||
if ((pattern != null) &&
|
||||
(pattern.length() > 0) &&
|
||||
(!pattern.equals(TraceFilterThread.MATCH_ALL)))
|
||||
{
|
||||
|
|
@ -267,11 +268,11 @@ public class IncludeExcludeWindow
|
|||
includeButton = new Button(newPatternGroup, SWT.RADIO);
|
||||
includeButton.setText("Include");
|
||||
includeButton.setSelection(true);
|
||||
|
||||
|
||||
excludeButton = new Button(newPatternGroup, SWT.RADIO);
|
||||
excludeButton.setText("Exclude");
|
||||
excludeButton.setLayoutData("wrap");
|
||||
|
||||
|
||||
patternInput = new Text(newPatternGroup, SWT.BORDER);
|
||||
patternInput.setLayoutData("grow,spanx 2");
|
||||
|
||||
|
|
@ -313,9 +314,9 @@ public class IncludeExcludeWindow
|
|||
saveCancelButtons.saveButton.setFocus();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
patternInput.addVerifyListener(new VerifyListener()
|
||||
{
|
||||
{
|
||||
@Override
|
||||
public void verifyText(VerifyEvent event)
|
||||
{
|
||||
|
|
@ -324,12 +325,28 @@ public class IncludeExcludeWindow
|
|||
{
|
||||
String existingStr = newPattern.patternInput.getText();
|
||||
String newStr = existingStr + str;
|
||||
event.doit = allowedStrings.matcher(newStr).matches();
|
||||
|
||||
if (newStr.contains("|") &&
|
||||
!allowedStrings.matcher("|").matches())
|
||||
{
|
||||
String[] parts = newStr.split("\\|");
|
||||
boolean allowed = true;
|
||||
for (String part : parts)
|
||||
{
|
||||
allowed = allowed && allowedStrings.matcher(part).matches();
|
||||
}
|
||||
event.doit = allowed;
|
||||
}
|
||||
else
|
||||
{
|
||||
event.doit = allowedStrings.matcher(newStr).matches();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
sWindow.addListener(SWT.Traverse, new Listener() {
|
||||
@Override
|
||||
public void handleEvent(Event event) {
|
||||
switch (event.detail) {
|
||||
case SWT.TRAVERSE_ESCAPE:
|
||||
|
|
@ -350,13 +367,13 @@ public class IncludeExcludeWindow
|
|||
private PatternList(Composite parent)
|
||||
{
|
||||
Group patternGroup = new Group(parent, SWT.SHADOW_ETCHED_IN);
|
||||
patternGroup.setLayoutData("grow");
|
||||
patternGroup.setLayoutData("grow,hmin 0");
|
||||
MigLayout patternLayout = new MigLayout("fill");
|
||||
patternGroup.setLayout(patternLayout);
|
||||
patternGroup.setText("Patterns (Double click to Edit)");
|
||||
|
||||
patternSet = new List(patternGroup, SWT.BORDER);
|
||||
patternSet.setLayoutData("grow");
|
||||
patternSet = new List(patternGroup, SWT.BORDER | SWT.V_SCROLL);
|
||||
patternSet.setLayoutData("grow,hmin 0");
|
||||
|
||||
patternSet.addMouseListener(new org.eclipse.swt.events.MouseAdapter()
|
||||
{
|
||||
|
|
@ -374,10 +391,28 @@ public class IncludeExcludeWindow
|
|||
if (newItem.length() > 0)
|
||||
{
|
||||
boolean includeItem = newPattern.includeButton.getSelection();
|
||||
model.addItem(includeItem, newItem);
|
||||
newPattern.patternInput.setText("");
|
||||
|
||||
if (newItem.contains("|") &&
|
||||
!allowedStrings.matcher("|").matches())
|
||||
{
|
||||
String[] parts = newItem.split("\\|");
|
||||
|
||||
for (String part : parts)
|
||||
{
|
||||
if (part.length() > 0)
|
||||
{
|
||||
model.addItem(includeItem, part);
|
||||
}
|
||||
}
|
||||
newPattern.patternInput.setText("");
|
||||
}
|
||||
else
|
||||
{
|
||||
model.addItem(includeItem, newItem);
|
||||
newPattern.patternInput.setText("");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void removeItem()
|
||||
{
|
||||
|
|
@ -401,7 +436,7 @@ public class IncludeExcludeWindow
|
|||
if (selectedItems.length == 1)
|
||||
{
|
||||
int selectedItem = selectedItems[0];
|
||||
String item = patternSet.getItem(selectedItem).trim();
|
||||
String item = patternSet.getItem(selectedItem).trim();
|
||||
if (model.removeIndex(selectedItem))
|
||||
{
|
||||
newPattern.patternInput.setText(item);
|
||||
|
|
@ -412,7 +447,7 @@ public class IncludeExcludeWindow
|
|||
.length());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private java.util.List<String> getIncludePattern()
|
||||
|
|
@ -420,7 +455,7 @@ public class IncludeExcludeWindow
|
|||
java.util.List<String> includes = new ArrayList<String>();
|
||||
|
||||
includes.addAll(model.getIncludePattern());
|
||||
|
||||
|
||||
if (newPattern.includeButton.getSelection())
|
||||
{
|
||||
String newPatternStr = newPattern.patternInput.getText();
|
||||
|
|
@ -438,7 +473,7 @@ public class IncludeExcludeWindow
|
|||
java.util.List<String> excludes = new ArrayList<String>();
|
||||
|
||||
excludes.addAll(model.getExcludePattern());
|
||||
|
||||
|
||||
if (newPattern.excludeButton.getSelection())
|
||||
{
|
||||
String newPatternStr = newPattern.patternInput.getText();
|
||||
|
|
@ -474,9 +509,9 @@ public class IncludeExcludeWindow
|
|||
@Override
|
||||
public void widgetSelected(SelectionEvent arg0)
|
||||
{
|
||||
callback.setIncludePattern(patterns.getIncludePattern());
|
||||
callback.setIncludePattern(patterns.getIncludePattern());
|
||||
callback.setExcludePattern(patterns.getExcludePattern());
|
||||
|
||||
|
||||
sWindow.close();
|
||||
}
|
||||
});
|
||||
|
|
@ -498,7 +533,7 @@ public class IncludeExcludeWindow
|
|||
|
||||
public void setExcludePattern(java.util.List<String> newExcludePattern);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Class which managed the presence of include/exclude headers
|
||||
* within a list of items.
|
||||
|
|
@ -512,34 +547,34 @@ public class IncludeExcludeWindow
|
|||
public void remove(int xiIndex);
|
||||
public String[] getItems();
|
||||
}
|
||||
|
||||
private static final String INCLUDE_TITLE = "Include:";
|
||||
private static final String EXCLUDE_TITLE = "Exclude:";
|
||||
|
||||
|
||||
private static final String INCLUDE_TITLE = "Include:";
|
||||
private static final String EXCLUDE_TITLE = "Exclude:";
|
||||
|
||||
private int includeIndex = -1;
|
||||
private int excludeIndex = -1;
|
||||
|
||||
|
||||
private final IncludeExcludeList list;
|
||||
|
||||
|
||||
public IncludeExcludeHeaders(IncludeExcludeList view)
|
||||
{
|
||||
this.list = view;
|
||||
}
|
||||
|
||||
|
||||
public void addItem(boolean xiInclude, String newItem)
|
||||
{
|
||||
boolean addItem = true;
|
||||
|
||||
|
||||
// Add headers
|
||||
if (xiInclude && (includeIndex == -1))
|
||||
{
|
||||
list.add(INCLUDE_TITLE, 0);
|
||||
{
|
||||
list.add(INCLUDE_TITLE, 0);
|
||||
includeIndex = 0;
|
||||
if (excludeIndex > -1)
|
||||
{
|
||||
// Include header was already added
|
||||
excludeIndex++;
|
||||
|
||||
|
||||
// Add spacer
|
||||
list.add("", 1);
|
||||
excludeIndex++;
|
||||
|
|
@ -550,11 +585,11 @@ public class IncludeExcludeWindow
|
|||
if (includeIndex > -1)
|
||||
{
|
||||
list.add("");
|
||||
}
|
||||
}
|
||||
list.add(EXCLUDE_TITLE);
|
||||
excludeIndex = list.getItems().length - 1;
|
||||
}
|
||||
|
||||
|
||||
String[] currentItems = list.getItems();
|
||||
int startItem, endItem;
|
||||
if (xiInclude)
|
||||
|
|
@ -574,7 +609,7 @@ public class IncludeExcludeWindow
|
|||
startItem = excludeIndex + 1;
|
||||
endItem = currentItems.length;
|
||||
}
|
||||
|
||||
|
||||
for (int ii = startItem; ii < endItem; ii++)
|
||||
{
|
||||
String item = currentItems[ii].trim();
|
||||
|
|
@ -584,18 +619,18 @@ public class IncludeExcludeWindow
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (addItem)
|
||||
{
|
||||
list.add(" " + newItem, endItem);
|
||||
|
||||
|
||||
if ((excludeIndex != -1) && (endItem < excludeIndex))
|
||||
{
|
||||
excludeIndex++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean removeIndex(int index)
|
||||
{
|
||||
if ((index == includeIndex) ||
|
||||
|
|
@ -605,45 +640,45 @@ public class IncludeExcludeWindow
|
|||
// Ignore
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Remove item
|
||||
list.remove(index);
|
||||
|
||||
|
||||
// Check if we removed an included item when we already
|
||||
// had an excluded item
|
||||
int count = list.getItems().length;
|
||||
int count = list.getItems().length;
|
||||
if ((excludeIndex != -1) && (index < excludeIndex))
|
||||
{
|
||||
// Removed an item above the exclude header
|
||||
excludeIndex--;
|
||||
}
|
||||
|
||||
if ((includeIndex != -1) &&
|
||||
|
||||
if ((includeIndex != -1) &&
|
||||
((excludeIndex == 2) || (count == 1)))
|
||||
{
|
||||
// We need to remove the include header
|
||||
// We need to remove the include header
|
||||
// as we have no include items left
|
||||
list.remove(includeIndex);
|
||||
includeIndex = -1;
|
||||
|
||||
|
||||
if (excludeIndex > -1)
|
||||
{
|
||||
// We need to remove the spacer above
|
||||
// the exclude header
|
||||
|
||||
|
||||
// Include element was removed
|
||||
excludeIndex--;
|
||||
|
||||
|
||||
// Remove spacer element
|
||||
list.remove(0);
|
||||
excludeIndex--;
|
||||
}
|
||||
}
|
||||
|
||||
if ((excludeIndex != -1) &&
|
||||
|
||||
if ((excludeIndex != -1) &&
|
||||
(excludeIndex == (count - 1)))
|
||||
{
|
||||
// We need to remove the exclude header
|
||||
// We need to remove the exclude header
|
||||
// as we have no exclude items left
|
||||
if (includeIndex != -1)
|
||||
{
|
||||
|
|
@ -652,13 +687,13 @@ public class IncludeExcludeWindow
|
|||
list.remove(excludeIndex - 1);
|
||||
excludeIndex--;
|
||||
}
|
||||
|
||||
|
||||
list.remove(excludeIndex);
|
||||
excludeIndex = -1;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public java.util.List<String> getIncludePattern()
|
||||
{
|
||||
java.util.List<String> includes = new ArrayList<String>();
|
||||
|
|
@ -676,7 +711,7 @@ public class IncludeExcludeWindow
|
|||
String item = items[ii].trim();
|
||||
includes.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return includes;
|
||||
}
|
||||
|
|
@ -694,7 +729,7 @@ public class IncludeExcludeWindow
|
|||
String item = items[ii].trim();
|
||||
excludes.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return excludes;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package org.intrace.client.gui.helper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
|
@ -295,6 +297,24 @@ public class TraceFilterThread implements Runnable
|
|||
boolean matchFilter = newTraceLine.startsWith(SYSTEM_TRACE_PREFIX) ||
|
||||
(!matches(activeExcludePattern, newTraceLine) &&
|
||||
matches(activeIncludePattern, newTraceLine));
|
||||
|
||||
|
||||
|
||||
String[] splitParts = newTraceLine.split(":");
|
||||
|
||||
if ((repeatedMethods.size()>0) || methodFilterRecordingEnabled) {
|
||||
if (splitParts.length >= 6) {
|
||||
String methodName = splitParts[4] + ":" + splitParts[5];
|
||||
if (repeatedMethods.contains(methodName)) {
|
||||
matchFilter = false;
|
||||
}
|
||||
else {
|
||||
if (methodFilterRecordingEnabled) repeatedMethods.add(methodName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!discardFilteredTrace || matchFilter)
|
||||
{
|
||||
|
|
@ -514,6 +534,7 @@ public class TraceFilterThread implements Runnable
|
|||
{
|
||||
String traceLine = traceLines.get(ii);
|
||||
newTraceLines.add(traceLine);
|
||||
|
||||
if (traceLine.startsWith(SYSTEM_TRACE_PREFIX) ||
|
||||
(!matches(excludePattern, traceLine) &&
|
||||
matches(includePattern, traceLine)))
|
||||
|
|
@ -580,4 +601,11 @@ public class TraceFilterThread implements Runnable
|
|||
// Do nothing
|
||||
}
|
||||
}
|
||||
|
||||
public boolean methodFilterRecordingEnabled = false;
|
||||
private Set<String> repeatedMethods = new HashSet<String>();
|
||||
|
||||
public void resetMethodFilter() {
|
||||
repeatedMethods = new HashSet<String>();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue