Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjphillips2009-01-27 17:36:50 +0000
committerjphillips2009-01-27 17:36:50 +0000
commit12a42b6ffa8a16c66b17f330e11107abff9b4012 (patch)
tree44938c9ce15954328b780e9c0839d9e4545f98cf
parent099f2ce20fe19c815ff2620eac91d0034a92bba6 (diff)
downloadorg.eclipse.osee-12a42b6ffa8a16c66b17f330e11107abff9b4012.tar.gz
org.eclipse.osee-12a42b6ffa8a16c66b17f330e11107abff9b4012.tar.xz
org.eclipse.osee-12a42b6ffa8a16c66b17f330e11107abff9b4012.zip
-rw-r--r--org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditor.java84
-rw-r--r--org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/DeleteArtifactAction.java42
-rw-r--r--org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/HealthHelper.java4
3 files changed, 53 insertions, 77 deletions
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditor.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditor.java
index 4ae070794a3..d655bde0ac9 100644
--- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditor.java
+++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/ArtifactEditor.java
@@ -20,14 +20,10 @@ 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.jface.action.Action;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.window.Window;
import org.eclipse.osee.framework.db.connection.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -92,6 +88,7 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.part.MultiPageEditorPart;
/**
@@ -338,11 +335,12 @@ public class ArtifactEditor extends MultiPageEditorPart implements IDirtiableEdi
}
public ToolBar createToolBar(Composite parent) {
- return createToolBar(parent, this, artifact);
+ return createToolBar(parent, this, artifact, new GridData(SWT.FILL, SWT.BEGINNING, true, false, 1, 1), getSite());
}
- private ToolBar createPreviewToolBar(Composite parent) {
- ToolBar toolBar = createToolBar(parent, this, artifact);
+ public ToolBar createPreviewToolBar(Composite parent) {
+ ToolBar toolBar =
+ createToolBar(parent, this, artifact, new GridData(SWT.FILL, SWT.BEGINNING, true, false, 1, 1), getSite());
// Add Navigation Browser Navigation Buttons
back = new ToolItem(toolBar, SWT.NONE);
@@ -411,7 +409,7 @@ public class ArtifactEditor extends MultiPageEditorPart implements IDirtiableEdi
}
- private ToolBar createToolBar(Composite parent, IActionable actionable, final Artifact artifact) {
+ public static ToolBar createToolBar(Composite parent, IActionable actionable, final Artifact artifact, Object layoutData, IWorkbenchPartSite site) {
ISelectionProvider provider = new ISelectionProvider() {
private ISelection selection;
@@ -434,10 +432,9 @@ public class ArtifactEditor extends MultiPageEditorPart implements IDirtiableEdi
}
};
provider.setSelection(new StructuredSelection(new Object[] {artifact}));
- getSite().setSelectionProvider(provider);
+ site.setSelectionProvider(provider);
Composite toolBarComposite = new Composite(parent, SWT.BORDER);
- GridData gridData = new GridData(SWT.FILL, SWT.BEGINNING, true, false, 1, 1);
- toolBarComposite.setLayoutData(gridData);
+ toolBarComposite.setLayoutData(layoutData);
GridLayout layout = new GridLayout(2, false);
layout.marginHeight = 0;
layout.marginWidth = 0;
@@ -445,7 +442,7 @@ public class ArtifactEditor extends MultiPageEditorPart implements IDirtiableEdi
final ToolBar toolBar = new ToolBar(toolBarComposite, SWT.FLAT | SWT.RIGHT);
- gridData = new GridData(SWT.FILL, SWT.BEGINNING, true, true, 1, 1);
+ GridData gridData = new GridData(SWT.FILL, SWT.BEGINNING, true, true, 1, 1);
toolBar.setLayoutData(gridData);
SkynetGuiPlugin skynetGuiPlugin = SkynetGuiPlugin.getInstance();
ToolItem item;
@@ -487,45 +484,6 @@ public class ArtifactEditor extends MultiPageEditorPart implements IDirtiableEdi
List<Artifact> artifacts = new LinkedList<Artifact>();
artifacts.add(artifact);
- // try {
- // OpenWithMenuListener.loadMenuItems(editMenu, PresentationType.SPECIALIZED_EDIT, artifacts);
- // } catch (OseeCoreException ex) {
- // OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- // } catch (NotDefinedException ex) {
- // OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- // }
- // final ToolItem editItem = new ToolItem(toolBar, SWT.DROP_DOWN);
- // editItem.setImage(skynetGuiPlugin.getImage("edit_artifact.gif"));
- // editItem.setToolTipText("Present this artifact for editing");
- //
- // editItem.addListener(SWT.Selection, new Listener() {
- // @Override
- // public void handleEvent(Event event) {
- // if (event.detail == SWT.ARROW) {
- // Rectangle rect = editItem.getBounds();
- // Point pt = new Point(rect.x, rect.y + rect.height);
- // pt = toolBar.toDisplay(pt);
- // editMenu.setLocation(pt.x, pt.y);
- // editMenu.setVisible(true);
- // }
- // if (event.detail == 0) {
- // RendererManager.openInJob(artifact, PresentationType.SPECIALIZED_EDIT);
- // }
- // }
- //
- // });
- // boolean itemsEnabled = false;
- // for (MenuItem menuItems : editMenu.getItems()) {
- // if (menuItems.isEnabled()) {
- // itemsEnabled = true;
- // }
- // }
- // boolean enabled =
- // !artifact.isReadOnly() && editMenu.getItemCount() != 0 && artifact.getBranch().equals(
- // BranchManager.getDefaultBranch());
- // editItem.setEnabled(enabled && itemsEnabled);
-
- //Preview menu Item
final Menu previewMenu = new Menu(parent.getShell(), SWT.POP_UP);
boolean previewable = false;
try {
@@ -627,30 +585,6 @@ public class ArtifactEditor extends MultiPageEditorPart implements IDirtiableEdi
return toolBar;
}
- private final class DeleteArtifactAction extends Action {
-
- private final Artifact artifact;
-
- public DeleteArtifactAction(Artifact artifact) {
- super("&Delete Artifact\tDelete", Action.AS_PUSH_BUTTON);
- this.artifact = artifact;
- }
-
- @Override
- public void run() {
- try {
- MessageDialog dialog =
- new MessageDialog(Display.getCurrent().getActiveShell(), "Confirm Artifact Deletion", null,
- " Are you sure you want to delete this artifact and all of the default hierarchy children?",
- MessageDialog.QUESTION, new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL}, 1);
- if (dialog.open() == Window.OK) {
- artifact.delete();
- }
- } catch (Exception ex) {
- OSEELog.logException(SkynetGuiPlugin.class, ex, true);
- }
- }
- }
private void checkEnabledTooltems() {
if (!attributeComposite.isDisposed()) {
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/DeleteArtifactAction.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/DeleteArtifactAction.java
new file mode 100644
index 00000000000..f2345530b38
--- /dev/null
+++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/DeleteArtifactAction.java
@@ -0,0 +1,42 @@
+/*
+ * Created on Jan 26, 2009
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.framework.ui.skynet.artifact.editor;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Ryan D. Brooks
+ */
+class DeleteArtifactAction extends Action {
+ private final Artifact artifact;
+
+ public DeleteArtifactAction(Artifact artifact) {
+ super("&Delete Artifact\tDelete", Action.AS_PUSH_BUTTON);
+ this.artifact = artifact;
+ }
+
+ @Override
+ public void run() {
+ try {
+ MessageDialog dialog =
+ new MessageDialog(Display.getCurrent().getActiveShell(), "Confirm Artifact Deletion", null,
+ " Are you sure you want to delete this artifact and all of the default hierarchy children?",
+ MessageDialog.QUESTION, new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL}, 1);
+ if (dialog.open() == Window.OK) {
+ artifact.delete();
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, true);
+ }
+ }
+}
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/HealthHelper.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/HealthHelper.java
index adcbdba1d8c..8a84fc1860d 100644
--- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/HealthHelper.java
+++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dbHealth/HealthHelper.java
@@ -61,7 +61,7 @@ public class HealthHelper {
" t1 WHERE t1.",
" = ? AND t1.gamma_id = txs1.gamma_id AND txs1.transaction_id != (SELECT max(txs.transaction_id) FROM osee_tx_details det, osee_txs txs, ",
" t2 WHERE det.branch_id = ? AND txs.tx_current != 0 AND det.transaction_id = txs.transaction_id AND txs.gamma_id = t2.gamma_id AND t2.",
- " = ?))"};
+ " = ?)AND txs1.transaction_id in (Select transaction_id FROM osee_tx_details WHERE branch_id = ?))"};
private static final boolean DEBUG =
"TRUE".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.osee.framework.ui.skynet/debug/Blam"));
@@ -164,7 +164,7 @@ public class HealthHelper {
List<Object[]> insertParameters = new LinkedList<Object[]>();
for (LocalTxData link : multipleSet) {
- insertParameters.add(new Object[] {link.dataId, link.branchId, link.dataId});
+ insertParameters.add(new Object[] {link.dataId, link.branchId, link.dataId, link.branchId});
}
int total = 0;
if (insertParameters.size() > 0) {

Back to the top