]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/impl/WidgetSupport.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.browsing.ui.swt / src / org / simantics / browsing / ui / swt / widgets / impl / WidgetSupport.java
diff --git a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/impl/WidgetSupport.java b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/impl/WidgetSupport.java
new file mode 100644 (file)
index 0000000..d08f058
--- /dev/null
@@ -0,0 +1,55 @@
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2012 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.browsing.ui.swt.widgets.impl;\r
+\r
+import org.eclipse.jface.resource.ResourceManager;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.exception.DatabaseException;\r
+\r
+public interface WidgetSupport {\r
+\r
+       /**\r
+        * The key for {@link #setParameter(String, Object)} used to associate a\r
+        * {@link ResourceManager} instance with this widget support context.\r
+        * Widgets that need to load resources (fonts, colors or images) need this.\r
+        */\r
+       public static final String RESOURCE_MANAGER = "resourceManager";\r
+\r
+       public static final Object NO_INPUT = new Object();\r
+       \r
+       /*\r
+        * The widget is set to receive input updates from this support\r
+        */\r
+       void register(Widget widget);\r
+       /*\r
+        * Updates will start only after this call\r
+        */\r
+       void finish();\r
+       /*\r
+        * Force update of widget\r
+        */\r
+       void update(Widget widget);\r
+       /*\r
+        * Force update of all widgets\r
+        */\r
+       void update();\r
+       /*\r
+        * Query current input\r
+        */\r
+       <T> T getInput();\r
+       \r
+       <T> T getParameter(String key);\r
+       void setParameter(String key, Object value);\r
+       \r
+       <T> T getInput(ReadGraph graph) throws DatabaseException;\r
+       \r
+}\r