summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2008-06-19 09:55:41 (EDT)
committerCarsten Drossel2008-06-19 09:55:41 (EDT)
commit53f8d1b07476727270a1af7f8533946a7426f425 (patch)
tree0c410c62dc539b4a9b62e5e08f183aeda100efcc
parent187f4904d91d84835071db1ce1962c53284c46aa (diff)
downloadorg.eclipse.riena-53f8d1b07476727270a1af7f8533946a7426f425.zip
org.eclipse.riena-53f8d1b07476727270a1af7f8533946a7426f425.tar.gz
org.eclipse.riena-53f8d1b07476727270a1af7f8533946a7426f425.tar.bz2
added StatusabrViewer for IMessageMarkers
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/AllTests.java1
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/marker/AllTests.java29
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/marker/StatusbarViewerTest.java239
-rw-r--r--org.eclipse.riena.ui.ridgets/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/marker/AbstractMessageMarkerViewer.java64
-rw-r--r--org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/marker/IMessageMarkerViewer.java40
-rw-r--r--org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/marker/StatusbarViewer.java160
7 files changed, 533 insertions, 1 deletions
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/AllTests.java b/org.eclipse.riena.tests/src/org/eclipse/riena/AllTests.java
index fd0aa65..5fd1b8b 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/AllTests.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/AllTests.java
@@ -29,6 +29,7 @@ public class AllTests extends TestCase {
suite.addTest(org.eclipse.riena.navigation.ui.swt.AllTests.suite());
suite.addTest(org.eclipse.riena.internal.ui.ridgets.swt.AllTests.suite());
suite.addTest(org.eclipse.riena.ui.ridgets.AllTests.suite());
+ suite.addTest(org.eclipse.riena.ui.ridgets.marker.AllTests.suite());
return suite;
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/marker/AllTests.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/marker/AllTests.java
new file mode 100644
index 0000000..e434e16
--- /dev/null
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/marker/AllTests.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 compeople AG and others.
+ * 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:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.ui.ridgets.marker;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * All tests of the package org.eclipse.riena.ui.ridgets.marker.
+ */
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Test for org.eclipse.riena.ui.ridgets.marker");
+ // $JUnit-BEGIN$
+ suite.addTestSuite(StatusbarViewerTest.class);
+ // $JUnit-END$
+ return suite;
+ }
+
+}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/marker/StatusbarViewerTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/marker/StatusbarViewerTest.java
new file mode 100644
index 0000000..5ea9789
--- /dev/null
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/marker/StatusbarViewerTest.java
@@ -0,0 +1,239 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 compeople AG and others.
+ * 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:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.ui.ridgets.marker;
+
+import junit.framework.TestCase;
+
+import org.easymock.EasyMock;
+import org.eclipse.riena.internal.ui.ridgets.swt.DefaultRealm;
+import org.eclipse.riena.internal.ui.ridgets.swt.TextRidget;
+import org.eclipse.riena.ui.core.marker.ErrorMessageMarker;
+import org.eclipse.riena.ui.ridgets.IStatusbarRidget;
+import org.eclipse.riena.ui.ridgets.listener.FocusEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Tests for the StatusbarViewer.
+ */
+public class StatusbarViewerTest extends TestCase {
+
+ private static final String EMPTY_STATUSBAR_MESSAGE = "TestEmptyStatusbar";
+
+ private DefaultRealm realm;
+ private Shell shell;
+ private StatusbarViewer statusbarViewer;
+ private IStatusbarRidget statusbarRidget;
+ private Text text1;
+ private Text text2;
+ private TextRidget ridget1;
+ private TextRidget ridget2;
+
+ /**
+ * @see junit.framework.TestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ realm = new DefaultRealm();
+ shell = new Shell();
+ shell.setLayout(new RowLayout(SWT.VERTICAL));
+
+ text1 = new Text(shell, SWT.SINGLE);
+ text2 = new Text(shell, SWT.SINGLE);
+ ridget1 = new TextRidget();
+ ridget2 = new TextRidget();
+ ridget1.setUIControl(text1);
+ ridget2.setUIControl(text2);
+
+ statusbarRidget = EasyMock.createMock(IStatusbarRidget.class);
+
+ statusbarViewer = new StatusbarViewer(statusbarRidget);
+ statusbarViewer.addRidget(ridget1);
+ statusbarViewer.addRidget(ridget2);
+ statusbarViewer.addMarkerType(ErrorMessageMarker.class);
+
+ shell.setSize(100, 100);
+ shell.setLocation(0, 0);
+ shell.open();
+ text1.setFocus();
+ }
+
+ /**
+ * @see junit.framework.TestCase#tearDown()
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ ridget1 = null;
+ ridget2 = null;
+ text1.dispose();
+ text1 = null;
+ text2.dispose();
+ text2 = null;
+ shell.dispose();
+ shell = null;
+ realm.dispose();
+ realm = null;
+ super.tearDown();
+ }
+
+ /**
+ * @throws Exception
+ * Handled by JUnit.
+ */
+ public void testHandleFocusEvents() throws Exception {
+
+ String testErrorMessage = "Test Error in Adapter 1";
+
+ EasyMock.expect(statusbarRidget.getMessage()).andReturn(EMPTY_STATUSBAR_MESSAGE);
+ statusbarRidget.setMessage(testErrorMessage);
+ EasyMock.replay(statusbarRidget);
+
+ ridget1.addMarker(new ErrorMessageMarker(testErrorMessage));
+
+ EasyMock.verify(statusbarRidget);
+ EasyMock.reset(statusbarRidget);
+
+ EasyMock.expect(statusbarRidget.getMessage()).andReturn(testErrorMessage);
+ statusbarRidget.setMessage(EMPTY_STATUSBAR_MESSAGE);
+ EasyMock.replay(statusbarRidget);
+
+ text2.addFocusListener(new FocusListener() {
+
+ public void focusLost(org.eclipse.swt.events.FocusEvent e) {
+ System.out.println("FL");
+ }
+
+ public void focusGained(org.eclipse.swt.events.FocusEvent e) {
+ System.out.println("FG");
+ }
+ });
+
+ text2.setFocus();
+
+ EasyMock.verify(statusbarRidget);
+ }
+
+ // /**
+ // * Test for problem report #429.
+ // *
+ // * @throws Exception
+ // * Handled by JUnit.
+ // */
+ // public void testHandleReversedFocusEvents() throws Exception {
+ //
+ // String testErrorMessage = "Test Error in Adapter 1";
+ //
+ // EasyMock.expect(statusbarRidget.getMessage()).andReturn(EMPTY_STATUSBAR_MESSAGE);
+ // statusbarRidget.setMessage(testErrorMessage);
+ // EasyMock.replay(statusbarRidget);
+ //
+ // ridget1.addMarker(new ErrorMessageMarker(testErrorMessage));
+ //
+ // EasyMock.verify(statusbarRidget);
+ // EasyMock.reset(statusbarRidget);
+ //
+ // EasyMock.expect(statusbarRidget.getMessage()).andReturn(testErrorMessage);
+ // statusbarRidget.setMessage(EMPTY_STATUSBAR_MESSAGE);
+ // EasyMock.replay(statusbarRidget);
+ //
+ // ridget2.fireFocusGained();
+ // ridget1.fireFocusLost();
+ //
+ // EasyMock.verify(statusbarRidget);
+ // }
+
+ /**
+ * @throws Exception
+ * Handled by JUnit.
+ */
+ public void testHandleFocusEventsAndModifiedMessage() throws Exception {
+
+ String testErrorMessage = "Test Error in Adapter 1";
+ String testMessageBySomebodyElse = "Some message by somebody else";
+ ErrorMessageMarker errorMessageMarker1 = new ErrorMessageMarker(testErrorMessage);
+
+ EasyMock.expect(statusbarRidget.getMessage()).andReturn(EMPTY_STATUSBAR_MESSAGE);
+ statusbarRidget.setMessage(testErrorMessage);
+ EasyMock.replay(statusbarRidget);
+
+ ridget1.addMarker(errorMessageMarker1);
+
+ EasyMock.verify(statusbarRidget);
+ EasyMock.reset(statusbarRidget);
+
+ // at this point somebody else changes the statusbar
+
+ EasyMock.expect(statusbarRidget.getMessage()).andReturn(testMessageBySomebodyElse);
+ EasyMock.replay(statusbarRidget);
+
+ text2.setFocus();
+
+ EasyMock.verify(statusbarRidget);
+ EasyMock.reset(statusbarRidget);
+
+ EasyMock.expect(statusbarRidget.getMessage()).andReturn(testMessageBySomebodyElse);
+ statusbarRidget.setMessage(testErrorMessage);
+ EasyMock.replay(statusbarRidget);
+
+ text1.setFocus();
+
+ EasyMock.verify(statusbarRidget);
+ EasyMock.reset(statusbarRidget);
+
+ EasyMock.expect(statusbarRidget.getMessage()).andReturn(testErrorMessage);
+ statusbarRidget.setMessage(testMessageBySomebodyElse);
+ EasyMock.replay(statusbarRidget);
+
+ ridget1.removeMarker(errorMessageMarker1);
+
+ EasyMock.verify(statusbarRidget);
+ EasyMock.reset(statusbarRidget);
+
+ String anotherTestErrorMessage = "Another Test Error in Adapter 1";
+ EasyMock.expect(statusbarRidget.getMessage()).andReturn(testMessageBySomebodyElse);
+ statusbarRidget.setMessage(anotherTestErrorMessage);
+ EasyMock.replay(statusbarRidget);
+
+ ridget1.addMarker(new ErrorMessageMarker(anotherTestErrorMessage));
+
+ EasyMock.verify(statusbarRidget);
+ EasyMock.reset(statusbarRidget);
+
+ EasyMock.expect(statusbarRidget.getMessage()).andReturn(anotherTestErrorMessage);
+ statusbarRidget.setMessage(testMessageBySomebodyElse);
+ EasyMock.replay(statusbarRidget);
+
+ text2.setFocus();
+
+ EasyMock.verify(statusbarRidget);
+ }
+
+ private class TestRidget extends TextRidget {
+
+ private boolean focused = false;
+
+ private void fireFocusGained() {
+ focused = true;
+ fireFocusGained(new FocusEvent(null, this));
+ }
+
+ private void fireFocusLost() {
+ focused = false;
+ fireFocusLost(new FocusEvent(this, null));
+ }
+
+ }
+
+}
diff --git a/org.eclipse.riena.ui.ridgets/META-INF/MANIFEST.MF b/org.eclipse.riena.ui.ridgets/META-INF/MANIFEST.MF
index e2f0906..668831b 100644
--- a/org.eclipse.riena.ui.ridgets/META-INF/MANIFEST.MF
+++ b/org.eclipse.riena.ui.ridgets/META-INF/MANIFEST.MF
@@ -15,6 +15,7 @@ Eclipse-LazyStart: true
Export-Package: org.eclipse.riena.ui.ridgets,
org.eclipse.riena.ui.ridgets.databinding,
org.eclipse.riena.ui.ridgets.listener,
+ org.eclipse.riena.ui.ridgets.marker,
org.eclipse.riena.ui.ridgets.menu,
org.eclipse.riena.ui.ridgets.obsolete,
org.eclipse.riena.ui.ridgets.tree,
diff --git a/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/marker/AbstractMessageMarkerViewer.java b/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/marker/AbstractMessageMarkerViewer.java
new file mode 100644
index 0000000..2069df3
--- /dev/null
+++ b/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/marker/AbstractMessageMarkerViewer.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 compeople AG and others.
+ * 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:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.ui.ridgets.marker;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Vector;
+
+import org.eclipse.riena.ui.core.marker.IMessageMarker;
+import org.eclipse.riena.ui.ridgets.IMarkableRidget;
+
+/**
+ * Common functionality of classes visualizing certain types of message markers.
+ */
+public abstract class AbstractMessageMarkerViewer implements IMessageMarkerViewer {
+
+ private HashSet<Class<? extends IMessageMarker>> markerTypes = new LinkedHashSet<Class<? extends IMessageMarker>>();
+
+ /**
+ * @see org.eclipse.riena.ui.ridgets.marker.IMessageMarkerViewer#addMarkerType(java.lang.Class)
+ */
+ public void addMarkerType(Class<? extends IMessageMarker> markerClass) {
+ markerTypes.add(markerClass);
+ }
+
+ /**
+ * @see org.eclipse.riena.ui.ridgets.marker.IMessageMarkerViewer#removeMarkerType(java.lang.Class)
+ */
+ public void removeMarkerType(Class<? extends IMessageMarker> markerClass) {
+ markerTypes.remove(markerClass);
+ }
+
+ protected Collection<IMessageMarker> getMessageMarker(IMarkableRidget markableRidget) {
+ return getMessageMarker(markableRidget, false);
+ }
+
+ protected Collection<IMessageMarker> getMessageMarker(IMarkableRidget markableRidget, boolean pRemove) {
+ Collection<IMessageMarker> result = new Vector<IMessageMarker>();
+ for (Class<? extends IMessageMarker> nextMessageMarkerType : markerTypes) {
+ Collection<? extends IMessageMarker> nextMessageMarkers = markableRidget
+ .getMarkersOfType(nextMessageMarkerType);
+ if (nextMessageMarkers != null && nextMessageMarkers.size() > 0) {
+ result.addAll(nextMessageMarkers);
+ }
+ }
+ if (pRemove) {
+ for (Iterator j = result.iterator(); j.hasNext();) {
+ markableRidget.removeMarker((IMessageMarker) j.next());
+ }
+ }
+ return result;
+ }
+
+}
diff --git a/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/marker/IMessageMarkerViewer.java b/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/marker/IMessageMarkerViewer.java
index 2724b4b..9c0906b 100644
--- a/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/marker/IMessageMarkerViewer.java
+++ b/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/marker/IMessageMarkerViewer.java
@@ -10,9 +10,47 @@
*******************************************************************************/
package org.eclipse.riena.ui.ridgets.marker;
+import org.eclipse.riena.ui.core.marker.IMessageMarker;
+import org.eclipse.riena.ui.ridgets.IMarkableRidget;
+
/**
- *
+ * Visualizes certain types of message markers of certain Ridgets.
+ *
+ * @see org.eclipse.riena.ui.core.marker.IMessageMarker
*/
public interface IMessageMarkerViewer {
+ /**
+ * Adds a Ridget to the list of Ridgets being observed for message markers.
+ *
+ * @param markableRidget
+ * A Ridget whose message markers should be visualized.
+ */
+ void addRidget(IMarkableRidget markableRidget);
+
+ /**
+ * Removes a Ridget from the list of Ridgets being observed for message
+ * markers.
+ *
+ * @param markableRidget
+ * A Ridget whose message markers should be visualized no more.
+ */
+ void removeRidget(IMarkableRidget markableRidget);
+
+ /**
+ * Adds a type of marker to the list of markers to be visualized.
+ *
+ * @param markerClass
+ * A type of marker to visualize.
+ */
+ void addMarkerType(Class<? extends IMessageMarker> markerClass);
+
+ /**
+ * Removed a type of marker to the list of markers to be visualized.
+ *
+ * @param markerClass
+ * A type of marker to visualize no more.
+ */
+ void removeMarkerType(Class<? extends IMessageMarker> markerClass);
+
}
diff --git a/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/marker/StatusbarViewer.java b/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/marker/StatusbarViewer.java
new file mode 100644
index 0000000..80ad90f
--- /dev/null
+++ b/org.eclipse.riena.ui.ridgets/src/org/eclipse/riena/ui/ridgets/marker/StatusbarViewer.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008 compeople AG and others.
+ * 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:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.ui.ridgets.marker;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.StringWriter;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.riena.ui.core.marker.IMessageMarker;
+import org.eclipse.riena.ui.ridgets.IMarkableRidget;
+import org.eclipse.riena.ui.ridgets.IStatusbarRidget;
+import org.eclipse.riena.ui.ridgets.listener.FocusEvent;
+import org.eclipse.riena.ui.ridgets.listener.IFocusListener;
+
+/**
+ * Visualizes certain types of message markers by displaying the message in the
+ * statusbar.
+ */
+public class StatusbarViewer extends AbstractMessageMarkerViewer {
+
+ private String statusbarMessage;
+ private String originalStatusbarMessage;
+ private IStatusbarRidget statusbar = null;
+
+ private PropertyChangeListener markerPropertyChangeListener = new MarkerPropertyChangeListener();
+ private IFocusListener ridgetFocusListener = new RidgetFocusListener();
+
+ /**
+ * @param statusbarRidget
+ */
+ public StatusbarViewer(IStatusbarRidget statusbarRidget) {
+ this.statusbar = statusbarRidget;
+ }
+
+ /**
+ * @see org.eclipse.riena.ui.ridgets.marker.IMessageMarkerViewer#addRidget(org.eclipse.riena.ui.ridgets.IMarkableRidget)
+ */
+ public void addRidget(IMarkableRidget markableRidget) {
+ markableRidget.addPropertyChangeListener(markerPropertyChangeListener);
+ markableRidget.addFocusListener(ridgetFocusListener);
+ }
+
+ /**
+ * @see org.eclipse.riena.ui.ridgets.marker.IMessageMarkerViewer#removeRidget(org.eclipse.riena.ui.ridgets.IMarkableRidget)
+ */
+ public void removeRidget(IMarkableRidget markableRidget) {
+ // TODO Auto-generated method stub
+
+ }
+
+ private void showMessages(IMarkableRidget pMarkableAdapter) {
+ // if (this.isVisible()) {
+ Collection messageMarker = this.getMessageMarker(pMarkableAdapter);
+ String message = constructMessage(messageMarker).trim();
+ // show the message only if there is something to show
+ if (message.length() > 0) {
+ setStatusbarMessage(message);
+ } else {
+ resetStatusbarMessage();
+ }
+ // }
+ }
+
+ private void setStatusbarMessage(String message) {
+ if (getStatusBar() != null) {
+ if (statusbarMessage == null) {
+ originalStatusbarMessage = getStatusBar().getMessage();
+ }
+ this.getStatusBar().setMessage(message);
+ statusbarMessage = message;
+ }
+ }
+
+ private void resetStatusbarMessage() {
+ if (getStatusBar() != null) {
+ if (statusbarMessage != null && statusbarMessage.equals(getStatusBar().getMessage())) {
+ this.getStatusBar().setMessage(originalStatusbarMessage);
+ }
+ statusbarMessage = null;
+ }
+ }
+
+ private String constructMessage(Collection messageMarker) {
+ StringWriter sw = new StringWriter();
+ IMessageMarker nextMarker = null;
+ if (messageMarker != null) {
+ for (Iterator i = messageMarker.iterator(); i.hasNext();) {
+ nextMarker = (IMessageMarker) i.next();
+ if (sw.toString().trim().length() > 0) {
+ sw.write(" ");
+ }
+ if (nextMarker.getMessage() != null) {
+ sw.write(nextMarker.getMessage());
+ }
+ }
+ }
+ return sw.toString().trim();
+ }
+
+ IStatusbarRidget getStatusBar() {
+ // if ( statusbar == null ) {
+ // IModuleApplicationController moduleApplicationController =
+ // subModuleController.getModuleApplicationController();
+ // if ( moduleApplicationController != null ) {
+ // statusbar = moduleApplicationController.getStatusBar();
+ // PostCondition.assertNotNull( "The statusbar to show messages in must
+ // not be
+ // null!", statusbar );
+ // }
+ // }
+ return statusbar;
+ }
+
+ private class MarkerPropertyChangeListener implements PropertyChangeListener {
+
+ /**
+ * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
+ */
+ public void propertyChange(PropertyChangeEvent evt) {
+ if (evt.getPropertyName().equals(IMarkableRidget.PROPERTY_MARKER)
+ && evt.getSource() instanceof IMarkableRidget && ((IMarkableRidget) evt.getSource()).hasFocus()) {
+ showMessages((IMarkableRidget) evt.getSource());
+ }
+ }
+
+ }
+
+ private class RidgetFocusListener implements IFocusListener {
+
+ /**
+ * @see org.eclipse.riena.ui.ridgets.listener.IFocusListener#focusGained(org.eclipse.riena.ui.ridgets.listener.FocusEvent)
+ */
+ public void focusGained(FocusEvent event) {
+ if (event.getNewFocusOwner() instanceof IMarkableRidget) {
+ showMessages((IMarkableRidget) event.getNewFocusOwner());
+ }
+ }
+
+ /**
+ * @see org.eclipse.riena.ui.ridgets.listener.IFocusListener#focusLost(org.eclipse.riena.ui.ridgets.listener.FocusEvent)
+ */
+ public void focusLost(FocusEvent event) {
+ if (event.getOldFocusOwner() instanceof IMarkableRidget) {
+ resetStatusbarMessage();
+ }
+ }
+
+ }
+
+}