diff options
author | Roberto E. Escobar | 2012-08-03 21:48:00 +0000 |
---|---|---|
committer | Roberto E. Escobar | 2012-08-03 21:48:00 +0000 |
commit | 74dde7bf1ea5d4ba2c1d0abd87e2308034d106ed (patch) | |
tree | 81851637cc7772b22f01b9be236ef99662cb4fd9 /plugins/org.eclipse.osee.framework.ui.jdk/src/org/eclipse/osee/framework/ui/jdk | |
parent | 4c21f52e36617c072873d39b56844eebab893342 (diff) | |
download | org.eclipse.osee-74dde7bf1ea5d4ba2c1d0abd87e2308034d106ed.tar.gz org.eclipse.osee-74dde7bf1ea5d4ba2c1d0abd87e2308034d106ed.tar.xz org.eclipse.osee-74dde7bf1ea5d4ba2c1d0abd87e2308034d106ed.zip |
refactor: Delete org.eclipse.osee.framework.ui.jdk
Diffstat (limited to 'plugins/org.eclipse.osee.framework.ui.jdk/src/org/eclipse/osee/framework/ui/jdk')
4 files changed, 0 insertions, 466 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.jdk/src/org/eclipse/osee/framework/ui/jdk/Activator.java b/plugins/org.eclipse.osee.framework.ui.jdk/src/org/eclipse/osee/framework/ui/jdk/Activator.java deleted file mode 100644 index d41858ca2cd..00000000000 --- a/plugins/org.eclipse.osee.framework.ui.jdk/src/org/eclipse/osee/framework/ui/jdk/Activator.java +++ /dev/null @@ -1,54 +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.framework.ui.jdk; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.osee.framework.ui.jdk"; - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - plugin = this; - } - - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - } - - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/plugins/org.eclipse.osee.framework.ui.jdk/src/org/eclipse/osee/framework/ui/jdk/swing/DialogSupport.java b/plugins/org.eclipse.osee.framework.ui.jdk/src/org/eclipse/osee/framework/ui/jdk/swing/DialogSupport.java deleted file mode 100644 index c7169fe260a..00000000000 --- a/plugins/org.eclipse.osee.framework.ui.jdk/src/org/eclipse/osee/framework/ui/jdk/swing/DialogSupport.java +++ /dev/null @@ -1,25 +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.framework.ui.jdk.swing; - -import java.awt.Component; -import java.io.PrintWriter; -import java.io.StringWriter; -import javax.swing.JOptionPane; - -public class DialogSupport { - - public static void popupExceptionDialog(Component parent, String dlgTitle, Exception ex) { - PrintWriter ps = new PrintWriter(new StringWriter()); - ex.printStackTrace(ps); - JOptionPane.showMessageDialog(parent, ex.getMessage() + "\n" + ps, dlgTitle, JOptionPane.ERROR_MESSAGE); - } -} diff --git a/plugins/org.eclipse.osee.framework.ui.jdk/src/org/eclipse/osee/framework/ui/jdk/swing/EasyGridConstraint.java b/plugins/org.eclipse.osee.framework.ui.jdk/src/org/eclipse/osee/framework/ui/jdk/swing/EasyGridConstraint.java deleted file mode 100644 index 235fdea20d1..00000000000 --- a/plugins/org.eclipse.osee.framework.ui.jdk/src/org/eclipse/osee/framework/ui/jdk/swing/EasyGridConstraint.java +++ /dev/null @@ -1,222 +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.framework.ui.jdk.swing; - -import java.awt.GridBagConstraints; -import java.awt.Insets; - -/** - * @author Robert A. Fisher - */ -public class EasyGridConstraint extends GridBagConstraints { - private static final long serialVersionUID = -1745538537160837428L; - - public EasyGridConstraint setGrid(int x, int y) { - this.gridx = x; - this.gridy = y; - - return this; - } - - public EasyGridConstraint setHeight(int height) { - this.gridheight = height; - - return this; - } - - public EasyGridConstraint setWidth(int width) { - this.gridwidth = width; - - return this; - } - - public EasyGridConstraint setWeight(double x, double y) { - this.weightx = x; - this.weighty = y; - - return this; - } - - public EasyGridConstraint setXPadding(int x) { - this.ipadx = x; - - return this; - } - - public EasyGridConstraint setYPadding(int y) { - this.ipadx = y; - - return this; - } - - public EasyGridConstraint setXInsets(int x) { - this.insets.left = x; - this.insets.right = x; - - return this; - } - - public EasyGridConstraint setYInsets(int y) { - this.insets.top = y; - this.insets.bottom = y; - - return this; - } - - public EasyGridConstraint setInsets(int top, int left, int bottom, int right) { - this.insets.top = top; - this.insets.left = left; - this.insets.bottom = bottom; - this.insets.right = right; - - return this; - } - - public EasyGridConstraint fillBoth() { - this.fill = GridBagConstraints.BOTH; - - return this; - } - - public EasyGridConstraint fillVert() { - this.fill = GridBagConstraints.VERTICAL; - - return this; - } - - public EasyGridConstraint fillHorz() { - this.fill = GridBagConstraints.HORIZONTAL; - - return this; - } - - public EasyGridConstraint anchorNorth() { - this.anchor = GridBagConstraints.NORTH; - - return this; - } - - public EasyGridConstraint anchorNorthEast() { - this.anchor = GridBagConstraints.NORTHEAST; - - return this; - } - - public EasyGridConstraint anchorNorthWest() { - this.anchor = GridBagConstraints.NORTHWEST; - - return this; - } - - public EasyGridConstraint anchorSouth() { - this.anchor = GridBagConstraints.SOUTH; - - return this; - } - - public EasyGridConstraint anchorSouthEast() { - this.anchor = GridBagConstraints.SOUTHEAST; - - return this; - } - - public EasyGridConstraint anchorSouthWest() { - this.anchor = GridBagConstraints.SOUTHWEST; - - return this; - } - - public EasyGridConstraint anchorEast() { - this.anchor = GridBagConstraints.EAST; - - return this; - } - - public EasyGridConstraint anchorWest() { - this.anchor = GridBagConstraints.WEST; - - return this; - } - - public static GridBagConstraints setConstraints(int gridx, int gridy, double weightx, double weighty, int gridwidth, int gridheight, char fill, String anchor) { - return setConstraints(gridx, gridy, weightx, weighty, gridwidth, gridheight, fill, anchor, 0, 0, null); - } - - public static GridBagConstraints setConstraints(int gridx, int gridy, double weightx, double weighty, int gridwidth, int gridheight, char fill, String anchor, Insets insets) { - return setConstraints(gridx, gridy, weightx, weighty, gridwidth, gridheight, fill, anchor, 0, 0, insets); - } - - /** - * A wrapper for setting the constraints of a GridBag object. - * - * @param gridx Specifies the cell at the left of the component's display area, where the leftmost cell has gridx = - * 0. - * @param gridy Specifies the cell at the top of the component's display area, where the topmost cell has gridy = 0. - * @param weightx Specifies how to distribute extra horizontal space. - * @param weighty Specifies how to distribute extra vertical space. - * @param gridwidth Specifies the number of cells in a row for the component's display area. - * @param gridheight Specifies the number of cells in a column for the component's display area. - * @param fill This field is used when the component's display area is larger than the component's requested size. - * @param anchor This field is used when the component is smaller than its display area. - * @param insets Specifies the external padding of the component -- the minimum amount of space between the component - * and the edges of its display area. - * @param ipadx Specifies the component's horizontal internal padding - * @param ipady Specifies the component's vertical internal padding - */ - public static GridBagConstraints setConstraints(int gridx, int gridy, double weightx, double weighty, int gridwidth, int gridheight, char fill, String anchor, int ipadx, int ipady, Insets insets) { - // gridx, gridy, weightx, weighty, gridwidth, gridheight, char fill, String anchor, insets, ipadx, ipady - - GridBagConstraints gbc = new GridBagConstraints(); - gbc.gridx = gridx; - gbc.gridy = gridy; - gbc.weightx = weightx; - gbc.weighty = weighty; - gbc.gridwidth = gridwidth; - gbc.gridheight = gridheight; - gbc.ipadx = ipadx; - gbc.ipady = ipady; - if (insets != null) { - gbc.insets = insets; - } - - switch (fill) { - case 'V': - gbc.fill = GridBagConstraints.VERTICAL; - break; - case 'H': - gbc.fill = GridBagConstraints.HORIZONTAL; - break; - case 'B': - gbc.fill = GridBagConstraints.BOTH; - break; - } - - if (anchor.equals("N")) { - gbc.anchor = GridBagConstraints.NORTH; - } else if (anchor.equals("NE")) { - gbc.anchor = GridBagConstraints.NORTHEAST; - } else if (anchor.equals("E")) { - gbc.anchor = GridBagConstraints.EAST; - } else if (anchor.equals("SE")) { - gbc.anchor = GridBagConstraints.SOUTHEAST; - } else if (anchor.equals("S")) { - gbc.anchor = GridBagConstraints.SOUTH; - } else if (anchor.equals("SW")) { - gbc.anchor = GridBagConstraints.SOUTHWEST; - } else if (anchor.equals("W")) { - gbc.anchor = GridBagConstraints.WEST; - } else if (anchor.equals("NW")) { - gbc.anchor = GridBagConstraints.NORTHWEST; - } - return gbc; - } - -} diff --git a/plugins/org.eclipse.osee.framework.ui.jdk/src/org/eclipse/osee/framework/ui/jdk/swing/FileListEditor.java b/plugins/org.eclipse.osee.framework.ui.jdk/src/org/eclipse/osee/framework/ui/jdk/swing/FileListEditor.java deleted file mode 100644 index 9e1a784cb63..00000000000 --- a/plugins/org.eclipse.osee.framework.ui.jdk/src/org/eclipse/osee/framework/ui/jdk/swing/FileListEditor.java +++ /dev/null @@ -1,165 +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.framework.ui.jdk.swing; - -import java.awt.Component; -import java.awt.GridBagLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.Enumeration; -import java.util.Iterator; -import java.util.List; -import javax.swing.DefaultListModel; -import javax.swing.JButton; -import javax.swing.JFileChooser; -import javax.swing.JList; -import javax.swing.JPanel; -import javax.swing.JScrollPane; - -/** - * @author Ryan D. Brooks - */ -public class FileListEditor extends JPanel implements ActionListener { - - private static final long serialVersionUID = -4397118110586026746L; - private final DefaultListModel listModel; - private final JList list; - private final JFileChooser chooser; - private final JButton addButton; - private final JButton removeButton; - private String relativeToPath; - - public FileListEditor() { - this(null, null, JFileChooser.FILES_AND_DIRECTORIES, null); - } - - public FileListEditor(List<File> items, File currentDir, int mode, File relativeToFile) { - super(new GridBagLayout()); - - if (relativeToFile != null) { - try { - this.relativeToPath = relativeToFile.getCanonicalFile().getPath(); //ensure this has a standard name - } catch (IOException ex) { - // this.relativeToFile is already null so do nothing - } - } - - listModel = new DefaultListModel(); - list = new JList(listModel); - chooser = new JFileChooser(currentDir); - - chooser.setFileSelectionMode(mode); - chooser.setMultiSelectionEnabled(true); - - if (items != null) { - addFiles(items); - } - - JScrollPane scrollList = new JScrollPane(list); - add(scrollList, EasyGridConstraint.setConstraints(0, 0, 1, 1, 2, 1, 'B', "")); - - addButton = new JButton("Add"); - addButton.addActionListener(this); - add(addButton, EasyGridConstraint.setConstraints(0, 1, 1, 0, 1, 1, 'N', "W")); - - removeButton = new JButton("Remove"); - removeButton.addActionListener(this); - add(removeButton, EasyGridConstraint.setConstraints(1, 1, 1, 0, 1, 1, 'N', "E")); - - } - - public void setChooserTitle(String title) { - chooser.setDialogTitle(title); - } - - @Override - public void actionPerformed(ActionEvent ev) { - Component component = (Component) ev.getSource(); - if (component == addButton) { - if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { - File[] files = chooser.getSelectedFiles(); - for (int i = 0; i < files.length; i++) { - if (relativeToPath == null) { - listModel.addElement(files[i].getPath()); - } else { - try { - String path = files[i].getCanonicalFile().getPath(); - if (path.startsWith(relativeToPath)) { - listModel.addElement(path.substring(relativeToPath.length() + 1)); - } else { - System.out.println("Path is not relative to " + relativeToPath); - } - } catch (IOException ex) { - System.out.println(ex); - } - } - } - } - } else if (component == removeButton) { - int[] indices = list.getSelectedIndices(); - for (int i = indices.length - 1; i > -1; i--) { - listModel.remove(indices[i]); - } - } - } - - public void addFiles(List<File> items) { - for (Iterator<File> i = items.iterator(); i.hasNext();) { - File file = i.next(); - if (relativeToPath == null) { - listModel.addElement(file.getPath()); - } else { - try { - String path = file.getCanonicalFile().getPath(); - if (path.startsWith(relativeToPath)) { - listModel.addElement(path.substring(relativeToPath.length() + 1)); - } else { - System.out.println("Path is not relative to " + relativeToPath); - } - } catch (IOException ex) { - System.out.println(ex); - } - } - } - } - - public void addFiles(String[] files) { - for (int i = 0; i < files.length; i++) { - listModel.addElement(files[i]); - } - } - - public void addFile(String file) { - listModel.addElement(file); - } - - public void writeListTo(File file) throws IOException { - BufferedWriter out = new BufferedWriter(new FileWriter(file)); - for (Enumeration<?> e = listModel.elements(); e.hasMoreElements();) { - out.write((String) e.nextElement()); - out.newLine(); - } - out.close(); - } - - public File[] getFiles() { - File[] files = new File[listModel.size()]; - Enumeration<?> e = listModel.elements(); - for (int i = 0; i < files.length; i++) { - files[i] = new File((String) e.nextElement()); - } - return files; - } -} |