use of org.eclipse.titan.executor.executors.BaseExecutor in project titan.EclipsePlug-ins by eclipse.
the class LaunchElement method dispose.
@Override
public void dispose() {
if (ExecutorStorage.getExecutorMap().containsKey(launch)) {
final BaseExecutor executor = ExecutorStorage.getExecutorMap().get(launch);
executor.dispose();
ExecutorStorage.getExecutorMap().remove(launch);
}
LaunchStorage.getLaunchElementMap().remove(launch);
launch = null;
super.dispose();
}
use of org.eclipse.titan.executor.executors.BaseExecutor in project titan.EclipsePlug-ins by eclipse.
the class TestExecutionView method createTooltip.
private void createTooltip(final ITreeLeaf element) {
if (null == element) {
setTitleToolTip(null);
return;
}
final List<ExecutedTestcase> executedTestCases = new ArrayList<ExecutedTestcase>();
final List<ITreeLeaf> children = ((LaunchElement) actualInput).children();
ITreeLeaf executorElement;
for (ITreeLeaf aChildren : children) {
executorElement = aChildren;
if (executorElement instanceof MainControllerElement) {
BaseExecutor executor = ((MainControllerElement) executorElement).executor();
if (null != executor) {
executedTestCases.addAll(executor.executedTests());
}
}
}
if (executedTestCases.isEmpty()) {
setTitleToolTip(element.name());
return;
}
String statistics = createStatistics(element, executedTestCases);
setTitleToolTip(statistics);
}
use of org.eclipse.titan.executor.executors.BaseExecutor in project titan.EclipsePlug-ins by eclipse.
the class NotificationView method createActions.
private void createActions() {
clearAction = new Action("Clear") {
@Override
public void run() {
if (null != actualInput && actualInput instanceof LaunchElement) {
final List<ITreeLeaf> children = ((LaunchElement) actualInput).children();
for (ITreeLeaf aChildren : children) {
final BaseExecutor executor = ((MainControllerElement) aChildren).executor();
if (null != executor) {
executor.notifications().clear();
viewer.refresh();
}
}
}
}
};
clearAction.setToolTipText("Clear");
clearAction.setImageDescriptor(ImageCache.getImageDescriptor("trash_enabled.gif"));
clearAction.setDisabledImageDescriptor(ImageCache.getImageDescriptor("trash_disabled.gif"));
clearAction.setEnabled(false);
saveAsAction = new Action("Save As") {
@Override
public void run() {
saveAs();
}
};
saveAsAction.setToolTipText("Save As");
saveAsAction.setImageDescriptor(ImageCache.getImageDescriptor("saveas_edit.gif"));
saveAsAction.setEnabled(false);
followLastRecord = new Action("Follow the last record") {
@Override
public void run() {
isFollowing = followLastRecord.isChecked();
}
};
followLastRecord.setToolTipText("Toggles the follow the last line behavior");
followLastRecord.setEnabled(true);
followLastRecord.setChecked(isFollowing);
}
use of org.eclipse.titan.executor.executors.BaseExecutor in project titan.EclipsePlug-ins by eclipse.
the class TestExecutionView method selectionChanged.
@Override
public void selectionChanged(final IWorkbenchPart part, final ISelection selection) {
if (this.equals(part) || !(selection instanceof IStructuredSelection) || null == viewer.getContentProvider()) {
return;
}
ITreeLeaf selectedElement;
if (selection.isEmpty()) {
selectedElement = null;
} else {
selectedElement = (ITreeLeaf) ((IStructuredSelection) selection).getFirstElement();
}
if (null != selectedElement) {
while (!(selectedElement instanceof LaunchElement)) {
selectedElement = selectedElement.parent();
}
}
if (null != actualInput && actualInput.equals(selectedElement)) {
viewer.refresh(false);
} else {
viewer.setInput(selectedElement);
actualInput = selectedElement;
}
if (isFollowing && null != actualInput && actualInput instanceof LaunchElement) {
final List<ITreeLeaf> children = ((LaunchElement) actualInput).children();
for (ITreeLeaf aChildren : children) {
final BaseExecutor executor = ((MainControllerElement) aChildren).executor();
if (null != executor && !executor.executedTests().isEmpty()) {
viewer.reveal(executor.executedTests().get(executor.executedTests().size() - 1));
}
}
}
createTooltip(selectedElement);
if (null == selectedElement) {
saveAsAction.setEnabled(false);
} else {
saveAsAction.setEnabled(true);
}
}
use of org.eclipse.titan.executor.executors.BaseExecutor in project titan.EclipsePlug-ins by eclipse.
the class ExecutorMonitorView method createPartControl.
@Override
public void createPartControl(final Composite parent) {
viewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL);
contentProvider = new ExecutorMonitorContentProvider();
viewer.setContentProvider(contentProvider);
labelProvider = new ExecutorMonitorLabelProvider();
viewer.setLabelProvider(labelProvider);
createActions();
manager = new MenuManager("menuManager");
createEmptyContextMenu();
createToolBar();
Activator.setMainView(this);
viewer.setInput(getInitialInput());
viewer.expandToLevel(2);
updateActions();
getSite().setSelectionProvider(viewer);
launchListener = new LaunchesListener(this);
DebugPlugin.getDefault().getLaunchManager().addLaunchListener(launchListener);
selectionChangedListener = new ISelectionChangedListener() {
@Override
public void selectionChanged(final SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
ITreeLeaf element = (ITreeLeaf) selection.getFirstElement();
updateActions();
if (null == element) {
return;
}
if (element instanceof LaunchElement) {
createLauncherContextMenu();
} else if (element instanceof MainControllerElement) {
createExecutorContextMenu((MainControllerElement) element);
BaseExecutor executor = ((MainControllerElement) element).executor();
IProcess process = executor.getProcess();
if (null == process) {
return;
}
IConsole console = DebugUITools.getConsole(process);
if (null == console) {
return;
}
IConsole[] consoles = ConsolePlugin.getDefault().getConsoleManager().getConsoles();
boolean exists = false;
for (IConsole console2 : consoles) {
if (console2.equals(console)) {
exists = true;
}
}
if (!exists) {
ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console });
}
ConsolePlugin.getDefault().getConsoleManager().showConsoleView(console);
ConsolePlugin.getDefault().getConsoleManager().refresh(console);
} else {
createEmptyContextMenu();
}
}
};
viewer.addSelectionChangedListener(selectionChangedListener);
}
Aggregations