use of org.eclipse.titan.executor.executors.ITreeLeaf in project titan.EclipsePlug-ins by eclipse.
the class LaunchesListener method launchesChanged.
@Override
public void launchesChanged(final ILaunch[] launches) {
for (int i = 0; i < launches.length; i++) {
ILaunch launched = launches[i];
List<ITreeLeaf> children = executorMonitorView.getRoot().children();
for (int j = 0, size = children.size(); i < size; i++) {
final LaunchElement launchElement = (LaunchElement) children.get(j);
if (launched.equals(launchElement.launch())) {
launchElement.changed();
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
executorMonitorView.getTreeViewer().expandToLevel(launchElement, 3);
executorMonitorView.getTreeViewer().refresh(launchElement);
}
});
}
}
}
executorMonitorView.updateActions();
}
use of org.eclipse.titan.executor.executors.ITreeLeaf 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.ITreeLeaf in project titan.EclipsePlug-ins by eclipse.
the class NotificationView method getInitialInput.
private ITreeLeaf getInitialInput() {
final ISelection selection = getSite().getPage().getSelection(EXECUTORMONITOR_VIEW_ID);
if (null == selection || selection.isEmpty()) {
return null;
}
final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
ITreeLeaf element = (ITreeLeaf) structuredSelection.getFirstElement();
if (null != element) {
while (!(element instanceof LaunchElement)) {
element = element.parent();
}
}
return element;
}
use of org.eclipse.titan.executor.executors.ITreeLeaf 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.ITreeLeaf in project titan.EclipsePlug-ins by eclipse.
the class TestSetTab method performApply.
@Override
public void performApply(final ILaunchConfigurationWorkingCopy configuration) {
List<String> testsetNames = new ArrayList<String>();
List<List<String>> testSets = new ArrayList<List<String>>();
for (ITreeLeaf testSet : treeRoot.children()) {
testsetNames.add(testSet.name());
List<String> testcases = new ArrayList<String>();
for (ITreeLeaf testcase : ((TestsetTreeElement) testSet).children()) {
testcases.add(testcase.name());
}
testSets.add(testcases);
}
configuration.setAttribute(AVAILABLECONTROLPARTS_LABEL, availableControlparts);
configuration.setAttribute(AVAILABLETESTCASES_LABEL, availableTestcases);
configuration.setAttribute(TESTSETNAMES_LABEL, testsetNames);
for (int i = 0, size = testSets.size(); i < size; i++) {
configuration.setAttribute(TESTCASESOF_PREFIX + testsetNames.get(i), testSets.get(i));
}
setErrorMessage(null);
}
Aggregations