summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshawn.f.cook2011-10-31 12:16:54 (EDT)
committerRoberto E. Escobar2011-10-31 12:16:54 (EDT)
commit3997a20380f08151612a69c41cab06bc57944a9d (patch)
tree95b83bb86130b231ffa9ad31effdee45e47e921a
parentb0ff94b97acc29d32606f7e29dd7e02226c0f09d (diff)
downloadorg.eclipse.osee-3997a20380f08151612a69c41cab06bc57944a9d.zip
org.eclipse.osee-3997a20380f08151612a69c41cab06bc57944a9d.tar.gz
org.eclipse.osee-3997a20380f08151612a69c41cab06bc57944a9d.tar.bz2
feature[ats_18K4T]: Delete unused components
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/ComponentUtility.java14
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeActiveLink.java166
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeLock.java47
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeShowHideButton.java135
4 files changed, 0 insertions, 362 deletions
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/ComponentUtility.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/ComponentUtility.java
index 3440d67..ccc550b 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/ComponentUtility.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/ComponentUtility.java
@@ -24,24 +24,10 @@ import com.vaadin.ui.Component;
*/
public final class ComponentUtility {
- private static final OseeLock lockForNavigateTo = new OseeLock();
-
private ComponentUtility() {
// Utility Class
}
- public static void lockForNavigateTo() {
- lockForNavigateTo.lock();
- }
-
- public static boolean tryLockForNavigateTo() {
- return lockForNavigateTo.tryLockGreedy();
- }
-
- public static void unlockForNavigateTo() {
- lockForNavigateTo.unlock();
- }
-
public static boolean isAccessible(Component... components) {
boolean result = true;
if (components == null) {
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeActiveLink.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeActiveLink.java
deleted file mode 100644
index 07a8c28..0000000
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeActiveLink.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.display.view.web.components;
-
-import java.io.Serializable;
-import java.lang.reflect.Method;
-import java.util.HashSet;
-import java.util.Map;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Resource;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Component;
-import com.vaadin.ui.Link;
-
-/**
- * @author Shawn F. Cook
- */
-public class OseeActiveLink extends Link {
-
- private static final String TAG = "activelink";
-
- private static final Method LINK_FOLLOWED_METHOD;
-
- private final HashSet<LinkActivatedListener> listeners = new HashSet<LinkActivatedListener>();
-
- public OseeActiveLink() {
- super();
- }
-
- public OseeActiveLink(String caption, Resource resource, String targetName, int width, int height, int border) {
- super(caption, resource, targetName, width, height, border);
- }
-
- public OseeActiveLink(String caption, Resource resource) {
- super(caption, resource);
- }
-
- // @Override
- // public String getTag() {
- // return TAG;
- // }
-
- static {
- try {
- LINK_FOLLOWED_METHOD =
- LinkActivatedListener.class.getDeclaredMethod("linkActivated", new Class[] {LinkActivatedEvent.class});
- } catch (final java.lang.NoSuchMethodException e) {
- // This should never happen
- throw new java.lang.RuntimeException("Internal error finding methods in ActiveLink");
- }
- }
-
- /**
- * Adds the link activated listener.
- *
- * @param listener the Listener to be added.
- */
- public void addListener(LinkActivatedListener listener) {
- listeners.add(listener);
- addListener(LinkActivatedEvent.class, listener, LINK_FOLLOWED_METHOD);
- if (listeners.size() == 1) {
- requestRepaint();
- }
- }
-
- /**
- * Removes the link activated listener.
- *
- * @param listener the Listener to be removed.
- */
- public void removeListener(LinkActivatedListener listener) {
- listeners.remove(listener);
- removeListener(ClickEvent.class, listener, LINK_FOLLOWED_METHOD);
- if (listeners.size() == 0) {
- requestRepaint();
- }
- }
-
- /**
- * Emits the options change event.
- */
- protected void fireClick(boolean linkOpened) {
- fireEvent(new LinkActivatedEvent(this, linkOpened));
- }
-
- @Override
- public void paintContent(PaintTarget target) throws PaintException {
- super.paintContent(target);
-
- if (listeners.size() > 0) {
- target.addVariable(this, "activated", false);
- target.addVariable(this, "opened", false);
- }
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public void changeVariables(Object source, Map variables) {
- super.changeVariables(source, variables);
- if (!isReadOnly() && variables.containsKey("activated")) {
- final Boolean activated = (Boolean) variables.get("activated");
- final Boolean opened = (Boolean) variables.get("opened");
- if (activated != null && activated.booleanValue() && !isReadOnly()) {
- fireClick((opened != null && opened.booleanValue() ? true : false));
- }
- }
- }
-
- public class LinkActivatedEvent extends Component.Event {
-
- private final boolean linkOpened;
-
- /**
- * New instance of text change event.
- *
- * @param source the Source of the event.
- */
- public LinkActivatedEvent(Component source, boolean linkOpened) {
- super(source);
- this.linkOpened = linkOpened;
- }
-
- /**
- * Gets the ActiveLink where the event occurred.
- *
- * @return the Source of the event.
- */
- public OseeActiveLink getActiveLink() {
- return (OseeActiveLink) getSource();
- }
-
- /**
- * Indicates whether or not the link was opened on the client, i.e in a new window/tab. If the link was not
- * opened, the listener should react to the event and "do something", otherwise the link does nothing.
- *
- * @return true if the link was opened on the client
- */
- public boolean isLinkOpened() {
- return linkOpened;
- }
- }
-
- /**
- * ActiveLink click listener
- */
- public interface LinkActivatedListener extends Serializable {
-
- /**
- * ActiveLink has been activated.
- *
- * @param event ActiveLink click event.
- */
- public void linkActivated(LinkActivatedEvent event);
-
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeLock.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeLock.java
deleted file mode 100644
index e78722e..0000000
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeLock.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.display.view.web.components;
-
-/**
- * @author Shawn F. cook
- */
-public class OseeLock {
-
- private boolean isLocked = false;
-
- public synchronized void lock() {
- while (isLocked) {
- try {
- wait();
- } catch (InterruptedException ex) {
- //TODO: need logger
- System.out.println("OseeLock.lock - InterruptedException");
- }
- }
- isLocked = true;
- }
-
- public synchronized void unlock() {
- isLocked = false;
- }
-
- //If lock is AVAILABLE then LOCK it and return TRUE.
- // If lock is NOT AVAILABLE then do nothing and return FALSE.
- public synchronized boolean tryLockGreedy() {
- if (!isLocked) {
- lock();
- return true;
- } else {
- return false;
- }
- }
-
-}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeShowHideButton.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeShowHideButton.java
deleted file mode 100644
index bddbb17..0000000
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeShowHideButton.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.display.view.web.components;
-
-import java.io.Serializable;
-import java.lang.reflect.Method;
-import com.vaadin.ui.Alignment;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Component;
-import com.vaadin.ui.HorizontalLayout;
-
-/**
- * @author Shawn F. Cook
- */
-@SuppressWarnings("serial")
-public class OseeShowHideButton extends HorizontalLayout {
-
- private final Button plusMinusButton = new Button("-");
- private boolean isStateShow = true;
-
- public OseeShowHideButton(String caption) {
- final Button showHideButton = new Button(caption);
- showHideButton.setStyleName("link");
- showHideButton.addListener(new Button.ClickListener() {
- @Override
- public void buttonClick(Button.ClickEvent event) {
- toggleStateShow();
- }
- });
-
- plusMinusButton.setStyleName("link");
- plusMinusButton.addListener(new Button.ClickListener() {
-
- @Override
- public void buttonClick(Button.ClickEvent event) {
- toggleStateShow();
- }
- });
-
- this.addComponent(plusMinusButton);
- this.addComponent(showHideButton);
-
- this.setComponentAlignment(plusMinusButton, Alignment.MIDDLE_LEFT);
- this.setComponentAlignment(showHideButton, Alignment.MIDDLE_RIGHT);
- }
-
- private void toggleStateShow() {
- setStateShow(!isStateShow);
- fireClick();
- }
-
- public void setStateShow(boolean isStateShow) {
- this.isStateShow = isStateShow;
- if (isStateShow) {
- plusMinusButton.setCaption("-");
- } else {
- plusMinusButton.setCaption("+");
- }
- }
-
- public boolean isStateShow() {
- return isStateShow;
- }
-
- /**
- * Fires a click event to all listeners without any event details.
- */
- protected void fireClick() {
- fireEvent(new OseeShowHideButton.ClickEvent(this));
- }
-
- private static final Method SHOWHIDE_BUTTON_CLICK_METHOD;
-
- static {
- try {
- SHOWHIDE_BUTTON_CLICK_METHOD =
- ClickListener.class.getDeclaredMethod("buttonClick", new Class[] {ClickEvent.class});
- } catch (final java.lang.NoSuchMethodException e) {
- // This should never happen
- throw new java.lang.RuntimeException("Internal error finding methods in Button");
- }
- }
-
- /**
- * Interface for listening for a {@link ClickEvent} fired by a {@link Component}.
- */
- public interface ClickListener extends Serializable {
-
- /**
- * Called when a {@link Button} has been clicked. A reference to the button is given by
- * {@link ClickEvent#getButton()}.
- *
- * @param event An event containing information about the click.
- */
- public void buttonClick(ClickEvent event);
-
- }
-
- /**
- * Adds the button click listener.
- *
- * @param listener the Listener to be added.
- */
- public void addListener(ClickListener listener) {
- addListener(ClickEvent.class, listener, SHOWHIDE_BUTTON_CLICK_METHOD);
- }
-
- /**
- * Removes the button click listener.
- *
- * @param listener the Listener to be removed.
- */
- public void removeListener(ClickListener listener) {
- removeListener(ClickEvent.class, listener, SHOWHIDE_BUTTON_CLICK_METHOD);
- }
-
- /**
- * Click event. This event is thrown, when the button is clicked.
- */
- public class ClickEvent extends Component.Event {
-
- public ClickEvent(Component source) {
- super(source);
- }
-
- }
-}