
org.appdapter.gui.swing.EmptyDisplayContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.appdapter.lib.gui Show documentation
Show all versions of org.appdapter.lib.gui Show documentation
Appdapter Maven project including Java and Scala, produces jar, not bundle. Excludes concrete SLF4J binding.
The newest version!
package org.appdapter.gui.swing;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyVetoException;
import java.util.Collection;
import java.util.Iterator;
import java.util.Vector;
import org.appdapter.api.trigger.Trigger;
import org.appdapter.api.trigger.UserResult;
import org.appdapter.core.log.Debuggable;
import org.appdapter.gui.api.BT;
import org.appdapter.gui.api.BoxPanelSwitchableView;
import org.appdapter.gui.api.BrowserPanelGUI;
import org.appdapter.gui.api.DisplayContext;
import org.appdapter.gui.api.NamedObjectCollection;
import org.appdapter.gui.api.POJOCollectionListener;
import org.appdapter.gui.box.BoxedCollectionImpl;
import org.appdapter.gui.box.ScreenBoxImpl;
import org.appdapter.gui.browse.Utility;
public class EmptyDisplayContext extends BoxedCollectionImpl implements BrowserPanelGUI, NamedObjectCollection {
/**
* Adds a new value, if it wasn't already there
*
* @returns true if the value was added, false if the value was already there
*/
public BT addObject(Object value) {
return null;
}
/**
* Removes a value, if it is there
*
* @returns true if the value was removed, false if that value wasn't in this context
*/
@Override
public boolean removeObject(Object value) {
return false;
}
@Override
public Collection findObjectsByType(Class type) {
return new Vector();
}
@Override
public boolean containsObject(Object value) {
return false;
}
public void addListener(POJOCollectionListener o) {
}
@Override
public void removeListener(POJOCollectionListener o) {
}
public Collection getTriggersFromUI(BT box, Object value) {
return new Vector();
}
public Object findObject(String name) {
return null;
}
@Override
public String getTitleOf(Object value) {
return "" + value;
}
@Override
public UserResult showError(String msg, Throwable e) {
return Utility.showError(null, msg, e);
}
@Override public void renameObject(String oldName, String newName) throws PropertyVetoException {
BT value = findOrCreateBox(newName, findObjectByName(oldName));
value.setUniqueName(newName);
}
@Override
public BT findOrCreateBox(String newName, Object obj) throws PropertyVetoException {
throw new PropertyVetoException("Cant create objects in " + this, new PropertyChangeEvent(this, "objects", null, obj));
}
@Override public DisplayContext getDisplayContext() {
return Utility.getDisplayContext();
}
@Override public ScreenBoxImpl findOrCreateBox(Object value) {
Debuggable.notImplemented();
return null;
}
@Override public Iterator
© 2015 - 2025 Weber Informatics LLC | Privacy Policy