Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchSetupItem.java')
-rw-r--r--plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchSetupItem.java90
1 files changed, 0 insertions, 90 deletions
diff --git a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchSetupItem.java b/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchSetupItem.java
deleted file mode 100644
index be77a8444d8..00000000000
--- a/plugins/org.eclipse.osee.ote.ui.test.manager/src/org/eclipse/osee/ote/ui/test/manager/batches/navigate/TestBatchSetupItem.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * 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:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.ote.ui.test.manager.batches.navigate;
-
-import java.io.File;
-import java.net.URI;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
-import org.eclipse.osee.framework.ui.swt.KeyedImage;
-import org.eclipse.osee.ote.ui.test.manager.configuration.LoadConfigurationOperation;
-import org.eclipse.osee.ote.ui.test.manager.core.TestManagerEditor;
-import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;
-import org.eclipse.osee.ote.ui.test.manager.util.PluginUtil;
-import org.eclipse.osee.ote.ui.test.manager.util.TestManagerSelectDialog;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * @author Roberto E. Escobar
- */
-final class TestBatchSetupItem extends XNavigateItem implements Runnable {
- private final URI testBatchFile;
- private final String jobName;
-
- public TestBatchSetupItem(XNavigateItem parent, String name, KeyedImage oseeImage, URI testBatchFile) {
- super(parent, name, oseeImage);
- this.jobName = String.format("Test Manager Configuration: [%s]", name);
- this.testBatchFile = testBatchFile;
- }
-
- @Override
- public void run() {
- Job job = new UIJob(jobName) {
- @Override
- public IStatus runInUIThread(IProgressMonitor monitor) {
- IStatus status = Status.CANCEL_STATUS;
- if (PluginUtil.areTestManagersAvailable() != true) {
- Exception exception =
- new IllegalStateException("Test Manager was not opened before this operation was selected.");
- status =
- new Status(IStatus.ERROR, TestManagerPlugin.PLUGIN_ID, IStatus.ERROR,
- "A Test Manager must be opened for this operation to work.", exception);
- } else {
- TestManagerEditor[] itemsToOpen = PluginUtil.getTestManagers();
- if (itemsToOpen.length > 1) {
- itemsToOpen = TestManagerSelectDialog.getTestManagerFromUser();
- }
-
- if (itemsToOpen.length > 0) {
- boolean result = configureSelectedItems(itemsToOpen);
- if (result != false) {
- status = Status.OK_STATUS;
- } else {
- Exception exception = new IllegalStateException("Test Manager setup failed.");
- status =
- new Status(IStatus.ERROR, TestManagerPlugin.PLUGIN_ID,
- "Test Manager configuration failed for some unknown reason. Please try again.", exception);
- }
- } else {
- Exception exception = new IllegalStateException("No Test Manager was selected.");
- status =
- new Status(IStatus.ERROR, TestManagerPlugin.PLUGIN_ID,
- "A Test Manager must be selected for this operation to work.", exception);
- }
- }
- return status;
- }
-
- private boolean configureSelectedItems(TestManagerEditor[] items) {
- boolean result = true;
- for (TestManagerEditor testManager : items) {
- result &= LoadConfigurationOperation.load(testManager, new File(testBatchFile));
- }
- return result;
- }
- };
- job.setUser(true);
- job.schedule();
- }
-}

Back to the top