Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJudith Gull2011-05-17 12:51:39 +0000
committerJudith Gull2011-05-17 12:51:39 +0000
commite3990d47b968068fd7b82f07bfb350fd7ca6b483 (patch)
tree8aee316e8d57f30cbf458b1d2538df25c8b8fc2e
parentfc631801c1f045f51a411308f1bfa2b734737712 (diff)
parentea87894ff855f24dd33bdaaa14e090b07f2c871a (diff)
downloadorg.eclipse.scout.rt-e3990d47b968068fd7b82f07bfb350fd7ca6b483.tar.gz
org.eclipse.scout.rt-e3990d47b968068fd7b82f07bfb350fd7ca6b483.tar.xz
org.eclipse.scout.rt-e3990d47b968068fd7b82f07bfb350fd7ca6b483.zip
rc1 release tag2011-05-17_S-3.7.0RC1
-rw-r--r--org.eclipse.scout.rt.client/Release Notes.txt16
-rw-r--r--org.eclipse.scout.rt.client/resources/icons/application_logo_large.pngbin0 -> 2974 bytes
-rw-r--r--org.eclipse.scout.rt.client/src/org/eclipse/scout/rt/client/ui/form/ScoutInfoForm.java72
-rw-r--r--org.eclipse.scout.rt.ui.swing/Release Notes.txt9
-rw-r--r--org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/ext/JTreeEx.java23
5 files changed, 101 insertions, 19 deletions
diff --git a/org.eclipse.scout.rt.client/Release Notes.txt b/org.eclipse.scout.rt.client/Release Notes.txt
index 39cf611440..f2bef42816 100644
--- a/org.eclipse.scout.rt.client/Release Notes.txt
+++ b/org.eclipse.scout.rt.client/Release Notes.txt
@@ -379,3 +379,19 @@ ITable:
AbstractTable:
- protected Class<? extends AbstractBooleanColumn> getConfiguredCheckableColumn();
Migration: None
+
+17.05.2011 sle
+bsi ticket 102'010: ScoutInfoForm looks ugly (in SWT)
+Problem:
+a) ScoutInfoForm does not look nice in SWT
+b) ... does not have a Default-Logo
+c) ... has a quirky way of getting the logo.
+
+Solution:
+a) In Swing the GridData is different than for the other ui-layers.
+b) The Bundle org.eclipse.scout.rt.client has now a Default-Logo.
+c) The Logo is searched with th IconLocator.
+
+Migration:
+If ScoutInfoForm is overwritten to be able to get the correct logo this is not necessary anymore. Just the IIconProviderService
+has to be registered and an Icon with the name application_logo_large.png must be in a bundle. \ No newline at end of file
diff --git a/org.eclipse.scout.rt.client/resources/icons/application_logo_large.png b/org.eclipse.scout.rt.client/resources/icons/application_logo_large.png
new file mode 100644
index 0000000000..6ff2f49d91
--- /dev/null
+++ b/org.eclipse.scout.rt.client/resources/icons/application_logo_large.png
Binary files differ
diff --git a/org.eclipse.scout.rt.client/src/org/eclipse/scout/rt/client/ui/form/ScoutInfoForm.java b/org.eclipse.scout.rt.client/src/org/eclipse/scout/rt/client/ui/form/ScoutInfoForm.java
index 97a3fc554a..0f35e5dc02 100644
--- a/org.eclipse.scout.rt.client/src/org/eclipse/scout/rt/client/ui/form/ScoutInfoForm.java
+++ b/org.eclipse.scout.rt.client/src/org/eclipse/scout/rt/client/ui/form/ScoutInfoForm.java
@@ -10,6 +10,7 @@
******************************************************************************/
package org.eclipse.scout.rt.client.ui.form;
+import java.io.ByteArrayInputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
@@ -17,6 +18,7 @@ import java.util.Locale;
import org.eclipse.core.runtime.IProduct;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.scout.commons.BooleanUtility;
import org.eclipse.scout.commons.annotations.Order;
import org.eclipse.scout.commons.exception.ProcessingException;
import org.eclipse.scout.commons.logger.IScoutLogger;
@@ -24,6 +26,7 @@ import org.eclipse.scout.commons.logger.ScoutLogManager;
import org.eclipse.scout.commons.nls.NlsLocale;
import org.eclipse.scout.rt.client.ClientSyncJob;
import org.eclipse.scout.rt.client.IClientSession;
+import org.eclipse.scout.rt.client.services.common.icon.IconSpec;
import org.eclipse.scout.rt.client.services.common.perf.IPerformanceAnalyzerService;
import org.eclipse.scout.rt.client.ui.form.ScoutInfoForm.MainBox.CloseButton;
import org.eclipse.scout.rt.client.ui.form.ScoutInfoForm.MainBox.GroupBox.HtmlField;
@@ -83,19 +86,21 @@ public class ScoutInfoForm extends AbstractForm {
@Order(10.0f)
public class MainBox extends AbstractGroupBox {
- @Override
- protected int getConfiguredGridColumnCount() {
- return 1;
- }
+ private Boolean m_isSwing = null;
- @Override
- protected boolean getConfiguredGridUseUiWidth() {
- return true;
+ private boolean isSwing() {
+ if (m_isSwing == null) {
+ m_isSwing = (Platform.getBundle("org.eclipse.scout.rt.ui.swing") != null);
+ }
+ return BooleanUtility.nvl(m_isSwing);
}
@Override
- protected boolean getConfiguredGridUseUiHeight() {
- return true;
+ protected boolean getConfiguredGridUseUiWidth() {
+ if (isSwing()) {
+ return true;
+ }
+ return false;
}
@Order(10.0f)
@@ -103,16 +108,15 @@ public class ScoutInfoForm extends AbstractForm {
@Override
protected boolean getConfiguredGridUseUiWidth() {
- return true;
- }
-
- @Override
- protected boolean getConfiguredGridUseUiHeight() {
- return true;
+ if (isSwing()) {
+ return true;
+ }
+ return false;
}
@Order(10.0f)
public class HtmlField extends AbstractHtmlField {
+
@Override
protected boolean getConfiguredLabelVisible() {
return false;
@@ -124,13 +128,40 @@ public class ScoutInfoForm extends AbstractForm {
}
@Override
+ protected boolean getConfiguredScrollBarEnabled() {
+ return false;
+ }
+
+ @Override
protected boolean getConfiguredGridUseUiWidth() {
- return true;
+ if (isSwing()) {
+ return true;
+ }
+ return false;
}
@Override
protected boolean getConfiguredGridUseUiHeight() {
- return true;
+ if (isSwing()) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ protected int getConfiguredGridW() {
+ if (isSwing()) {
+ return 1;
+ }
+ return 2;
+ }
+
+ @Override
+ protected int getConfiguredGridH() {
+ if (isSwing()) {
+ return 1;
+ }
+ return 20;
}
@Override
@@ -140,7 +171,6 @@ public class ScoutInfoForm extends AbstractForm {
}
}
}
-
}
@Order(20.0f)
@@ -157,7 +187,11 @@ public class ScoutInfoForm extends AbstractForm {
if (f != null && !f.hasContent()) {
// try to load bundle resource
try {
- f.readData(org.eclipse.scout.rt.shared.Activator.getDefault().getBundle().getResource("resources/icons/application_logo_large.png").openStream());
+ IClientSession clientSession = ClientSyncJob.getCurrentSession();
+ IconSpec iconSpec = clientSession.getIconLocator().getIconSpec("application_logo_large.png");
+ ByteArrayInputStream is = new ByteArrayInputStream(iconSpec.getContent());
+ f.readData(is);
+ is.close();
}
catch (Exception ex2) {
LOG.info(null, ex2);
diff --git a/org.eclipse.scout.rt.ui.swing/Release Notes.txt b/org.eclipse.scout.rt.ui.swing/Release Notes.txt
index 3a897fb460..1dbce44bc8 100644
--- a/org.eclipse.scout.rt.ui.swing/Release Notes.txt
+++ b/org.eclipse.scout.rt.ui.swing/Release Notes.txt
@@ -86,3 +86,12 @@ When the value of an checkbox is changed in the ui and the model throws an VetoE
is also set back to its original state. Problem: The user cannot unset/correct the error status.
Change: The value on the ui is kept on its state set from the user, so the user can correct it according to its error status/exclamation mark.
+
+17.05.2011 imo
+bsi ticket 102'175
+When a user double-clicks on a row in a TablePage, the tree is automatically expanded, the corresponding node is selected, and the tree is scrolled, such that the selected node and as many as possible of its sub nodes are visible.
+This behaviour is confusing when browsing trees with nodes that have long labels. The current implementation tries to move as much as possible of the target nodes rectangle to the visible area. For nodes that are on deeper levels, this means, that the tree is scrolled horizontally and the node is drawn on the left side of the tree border (Figures 1, 2). When the user wants to get back to the parent node, it might not be recognizable anymore.
+The same applies, when getConfiguredScrollToSelection() is true, or the method scrollToSelection() is called manually.
+The tree should only automatically scroll horizontally when the node would be completely off the right side of the tree's border. To prevent the tree from "jumping" too much around, only a small part of the node's label should be guaranteed to be drawn. The proposed patch (currently only for Swing, there might be better approaches...) uses a maximum of 30 pixels or 25% of the node's width. The result is more like what the user would expect.
+Change: as proposer
+Migration: None
diff --git a/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/ext/JTreeEx.java b/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/ext/JTreeEx.java
index f83f459859..4742ad43a3 100644
--- a/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/ext/JTreeEx.java
+++ b/org.eclipse.scout.rt.ui.swing/src/org/eclipse/scout/rt/ui/swing/ext/JTreeEx.java
@@ -24,6 +24,7 @@ import javax.swing.ToolTipManager;
import javax.swing.TransferHandler;
import javax.swing.UIManager;
import javax.swing.plaf.UIResource;
+import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel;
import org.eclipse.scout.rt.ui.swing.SwingUtility;
@@ -149,4 +150,26 @@ public class JTreeEx extends JTree {
m_preferredScrollableViewportSize = d;
}
+ /**
+ * Custom implementation that tries to prevent unnecessary horizontal
+ * scrolling of the tree. It's a copy of the default implementation,
+ * with the only difference that it limits the width of the visible
+ * rect of the target node to <i>max(30 Pixels, 25% of total width)</i>.
+ */
+ @Override
+ public void scrollPathToVisible(TreePath treePath) {
+ if (treePath != null) {
+ makeVisible(treePath);
+ Rectangle pathBounds = getPathBounds(treePath);
+ if (pathBounds != null) {
+ // <NoHorizontalScrollPatch>
+ pathBounds.width = Math.max(30, (int) (0.25 * pathBounds.width));
+ // </NoHorizontalScrollPatch>
+ scrollRectToVisible(pathBounds);
+ if (accessibleContext != null) {
+ ((AccessibleJTree) accessibleContext).fireVisibleDataPropertyChange();
+ }
+ }
+ }
+ }
}

Back to the top