Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2013-09-16 14:08:42 +0000
committerJohn Arthorne2013-09-16 14:08:42 +0000
commitd95f3516657cb987c46078778dcb69f673cab408 (patch)
treec8776f31554b1104b579ebd537be2763a6efde50
parent9d72bc856250759be2f645e2144d2b1527adc4c3 (diff)
parent80821c74f0c08ee22b621c398e737860e3ed13c6 (diff)
downloadeclipse.platform.ui-d95f3516657cb987c46078778dcb69f673cab408.tar.gz
eclipse.platform.ui-d95f3516657cb987c46078778dcb69f673cab408.tar.xz
eclipse.platform.ui-d95f3516657cb987c46078778dcb69f673cab408.zip
Merge branch 'master' into johna/402445
-rw-r--r--bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2ColorHelper.java41
-rw-r--r--bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/ExtendedDocumentCSS.java16
-rw-r--r--bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/DocumentCSSImpl.java40
-rw-r--r--bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/MediaListImpl.java13
-rw-r--r--bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/StyleWrapper.java8
-rw-r--r--bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/ViewCSSImpl.java10
-rw-r--r--bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/serializers/CSSSerializer.java69
-rw-r--r--bundles/org.eclipse.e4.ui.css.swt/forceQualifierUpdate.txt1
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/SplitDropAgent.java8
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/LazyStackRenderer.java2
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/PerspectiveStackRenderer.java10
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashLayout.java21
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashRenderer.java19
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java7
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java4
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/forceQualifierUpdate.txt1
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java9
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/CommandLineOptionModelProcessor.java67
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4Workbench.java6
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java4
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java12
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ResourceHandler.java6
-rw-r--r--bundles/org.eclipse.ui.forms/forceQualifierUpdate.txt1
-rw-r--r--bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.ui.navigator.resources/plugin.xml22
-rw-r--r--bundles/org.eclipse.ui.navigator.resources/pom.xml2
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java50
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardActivityFilter.java32
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardCollectionElement.java61
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardPatternFilter.java22
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/DetailedProgressViewer.java4
-rw-r--r--bundles/org.eclipse.ui/forceQualifierUpdate.txt1
-rw-r--r--examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/dialogs/Snippet060DialogWithURLImageButtons.java9
-rw-r--r--examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet033CellEditorPerRowPre33.java100
-rw-r--r--examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet049StyledCellLabelProvider.java37
-rw-r--r--examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet050DelegatingStyledCellLabelProvider.java47
-rw-r--r--examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet058CellNavigationIn34.java51
-rw-r--r--examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet059CellNavigationIn33.java15
-rw-r--r--tests/org.eclipse.ui.tests.performance/META-INF/MANIFEST.MF2
-rw-r--r--tests/org.eclipse.ui.tests.performance/build.properties7
-rw-r--r--tests/org.eclipse.ui.tests.performance/pom.xml2
-rw-r--r--tests/org.eclipse.ui.tests.rcp/META-INF/MANIFEST.MF2
-rw-r--r--tests/org.eclipse.ui.tests.rcp/build.properties4
-rw-r--r--tests/org.eclipse.ui.tests.rcp/pom.xml4
44 files changed, 515 insertions, 336 deletions
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2ColorHelper.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2ColorHelper.java
index 6a6a0d09a5b..8d29847f1b9 100644
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2ColorHelper.java
+++ b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/css2/CSS2ColorHelper.java
@@ -11,9 +11,8 @@
package org.eclipse.e4.ui.css.core.css2;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
-
+import java.util.Map.Entry;
import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverterColorConfig;
import org.eclipse.e4.ui.css.core.dom.properties.converters.ICSSValueConverterConfig;
import org.w3c.dom.css.CSSPrimitiveValue;
@@ -21,27 +20,27 @@ import org.w3c.dom.css.RGBColor;
/**
* CSS2 Color Helper.
- *
+ *
* @version 1.0.0
* @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
- *
+ *
*/
public class CSS2ColorHelper {
/**
* Map with key=color name and value=hexadecimal color.
*/
- private static Map colorNamesMap = new HashMap();;
+ private static Map<String, String> colorNamesMap = new HashMap<String, String>();
/**
* Map with key=hexadecimal color and value=color name.
*/
- private static Map colorHexasMap = new HashMap();;
+ private static Map<String, String> colorHexasMap = new HashMap<String, String>();
/**
* Return w3c {@link RGBColor} from string value. Format String value is
* hexadecimal like #FFFFFF or color name like white.
- *
+ *
* @param value
* @return
*/
@@ -49,12 +48,9 @@ public class CSS2ColorHelper {
if (value.startsWith("#") && value.length() == 7) {
// Color is like #FFFFFF
try {
- int redValue = Integer.decode("0x" + value.substring(1, 3))
- .intValue();
- int greenValue = Integer.decode("0x" + value.substring(3, 5))
- .intValue();
- int blueValue = Integer.decode("0x" + value.substring(5))
- .intValue();
+ int redValue = Integer.decode("0x" + value.substring(1, 3)).intValue();
+ int greenValue = Integer.decode("0x" + value.substring(3, 5)).intValue();
+ int blueValue = Integer.decode("0x" + value.substring(5)).intValue();
return new CSS2RGBColorImpl(redValue, greenValue, blueValue);
} catch (Exception e) {
return null;
@@ -63,8 +59,9 @@ public class CSS2ColorHelper {
// Search if it's color name
value = value.toLowerCase();
value = (String) colorNamesMap.get(value);
- if (value != null)
+ if (value != null) {
return getRGBColor(value);
+ }
return null;
}
@@ -72,7 +69,7 @@ public class CSS2ColorHelper {
* Return color string form w3c <code>rgbColor</code> instance. The format
* (Hexa, color name or rgb format) of the color string is managed with
* <code>config</code> {@link ICSSValueConverterConfig}.
- *
+ *
* @param rgbColor
* @param config
* @return
@@ -108,7 +105,7 @@ public class CSS2ColorHelper {
/**
* Return rgb (ex : rgb(0,0,0)) color string value from w3c
* <code>rgbColor</code> instance.
- *
+ *
* @param rgbColor
* @return
*/
@@ -132,7 +129,7 @@ public class CSS2ColorHelper {
/**
* Return hexadecimal (ex : #FFFFFF) color string value from w3c
* <code>rgbColor</code> instance.
- *
+ *
* @param rgbColor
* @return
*/
@@ -158,7 +155,7 @@ public class CSS2ColorHelper {
/**
* Return the Hexa color (ex : #FFFFFF) from color name (ex : white).
- *
+ *
* @param colorName
* @return
*/
@@ -169,7 +166,7 @@ public class CSS2ColorHelper {
/**
* Return true if <code>value</code> is color name (ex : white) and false
* otherwise.
- *
+ *
* @param value
* @return
*/
@@ -179,7 +176,7 @@ public class CSS2ColorHelper {
/**
* Return the color name (ex : white) from Hexa color (ex : #FFFFFF).
- *
+ *
* @param hexaColor
* @return
*/
@@ -337,9 +334,7 @@ public class CSS2ColorHelper {
colorNamesMap.put("yellowgreen", "#9ACD32");
// Build Map with key=hexadecimal color and value=color name
- for (Iterator iterator = colorNamesMap.entrySet().iterator(); iterator
- .hasNext();) {
- Map.Entry entry = (Map.Entry) iterator.next();
+ for (Entry<String, String> entry : colorNamesMap.entrySet()) {
colorHexasMap.put(entry.getValue(), entry.getKey());
}
}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/ExtendedDocumentCSS.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/ExtendedDocumentCSS.java
index 5777981912f..e3943480434 100644
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/ExtendedDocumentCSS.java
+++ b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/ExtendedDocumentCSS.java
@@ -22,16 +22,12 @@ import org.w3c.dom.stylesheets.StyleSheet;
*/
public interface ExtendedDocumentCSS extends DocumentCSS {
- public static final Integer SAC_ID_CONDITION = new Integer(
- Condition.SAC_ID_CONDITION);
- public static final Integer SAC_CLASS_CONDITION = new Integer(
- Condition.SAC_CLASS_CONDITION);
- public static final Integer SAC_PSEUDO_CLASS_CONDITION = new Integer(
- Condition.SAC_PSEUDO_CLASS_CONDITION);
- public static final Integer OTHER_SAC_CONDITIONAL_SELECTOR = new Integer(
- Selector.SAC_CONDITIONAL_SELECTOR);
-
- public static final Integer OTHER_SAC_SELECTOR = new Integer(999);
+ public static final Integer SAC_ID_CONDITION = Integer.valueOf(Condition.SAC_ID_CONDITION);
+ public static final Integer SAC_CLASS_CONDITION = Integer.valueOf(Condition.SAC_CLASS_CONDITION);
+ public static final Integer SAC_PSEUDO_CLASS_CONDITION = Integer.valueOf(Condition.SAC_PSEUDO_CLASS_CONDITION);
+ public static final Integer OTHER_SAC_CONDITIONAL_SELECTOR = Integer.valueOf(Selector.SAC_CONDITIONAL_SELECTOR);
+
+ public static final Integer OTHER_SAC_SELECTOR = Integer.valueOf(999);
public void addStyleSheet(StyleSheet styleSheet);
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/DocumentCSSImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/DocumentCSSImpl.java
index 207e385a6f6..a18aad13630 100644
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/DocumentCSSImpl.java
+++ b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/DocumentCSSImpl.java
@@ -92,15 +92,13 @@ public class DocumentCSSImpl implements ExtendedDocumentCSS {
return list;
}
- protected List querySelector(CSSRuleList ruleList, int selectorType,
- int selectorConditionType) {
- List list = new ArrayList();
- int length = ruleList.getLength();
- for (int i = 0; i < length; i++) {
- CSSRule rule = ruleList.item(i);
- switch (rule.getType()) {
- case CSSRule.STYLE_RULE: {
- if (rule instanceof ExtendedCSSRule) {
+ protected List<Selector> querySelector(CSSRuleList ruleList, int selectorType, int selectorConditionType) {
+ List<Selector> list = new ArrayList<Selector>();
+ if (selectorType == Selector.SAC_CONDITIONAL_SELECTOR) {
+ int length = ruleList.getLength();
+ for (int i = 0; i < length; i++) {
+ CSSRule rule = ruleList.item(i);
+ if (rule.getType() == CSSRule.STYLE_RULE && rule instanceof ExtendedCSSRule) {
ExtendedCSSRule r = (ExtendedCSSRule) rule;
SelectorList selectorList = r.getSelectorList();
// Loop for SelectorList
@@ -108,26 +106,20 @@ public class DocumentCSSImpl implements ExtendedDocumentCSS {
for (int j = 0; j < l; j++) {
Selector selector = (Selector) selectorList.item(j);
if (selector.getSelectorType() == selectorType) {
- switch (selectorType) {
- case Selector.SAC_CONDITIONAL_SELECTOR:
- // It's conditional selector
- ConditionalSelector conditionalSelector = (ConditionalSelector) selector;
- short conditionType = conditionalSelector
- .getCondition().getConditionType();
- if (selectorConditionType == conditionType) {
- // current selector match the current CSS
- // Rule
- // CSSStyleRule styleRule = (CSSStyleRule)
- // rule;
- list.add(selector);
- }
+ // It's conditional selector
+ ConditionalSelector conditionalSelector = (ConditionalSelector) selector;
+ short conditionType = conditionalSelector.getCondition().getConditionType();
+ if (selectorConditionType == conditionType) {
+ // current selector match the current CSS
+ // Rule
+ // CSSStyleRule styleRule = (CSSStyleRule)
+ // rule;
+ list.add(selector);
}
}
-
}
}
}
- }
}
return list;
}
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/MediaListImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/MediaListImpl.java
index 232761aa638..46bee01f40d 100644
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/MediaListImpl.java
+++ b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/MediaListImpl.java
@@ -21,13 +21,13 @@ import org.w3c.dom.stylesheets.MediaList;
public class MediaListImpl implements MediaList {
private List mediaList = null;
-
+
public MediaListImpl(SACMediaList media) {
mediaList = new ArrayList();
for (int i = 0; i < media.getLength(); i++) {
mediaList.add(media.item(i));
}
-
+
}
public void appendMedium(String newMedium) throws DOMException {
@@ -44,15 +44,16 @@ public class MediaListImpl implements MediaList {
}
public String getMediaText() {
- String media = "";
+ StringBuilder media = new StringBuilder();
int size = mediaList.size();
if (size > 0) {
- media += mediaList.get(0);
+ media.append(mediaList.get(0));
for (int i = 1; i < mediaList.size(); i++) {
- media += ", " + mediaList.get(i);
+ media.append(", ");
+ media.append(mediaList.get(i));
}
}
- return media;
+ return media.toString();
}
public String item(int index) {
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/StyleWrapper.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/StyleWrapper.java
index f10e685f5fc..64e10280867 100644
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/StyleWrapper.java
+++ b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/StyleWrapper.java
@@ -1,7 +1,7 @@
/*******************************************************************************
* Copyright (c) 2009, 2013 EclipseSource 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,
+ * 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:
@@ -20,9 +20,9 @@ import org.w3c.dom.css.CSSStyleDeclaration;
*/
final class StyleWrapper {
- private static class StyleWrapperComparator implements Comparator {
-
- public int compare(final Object object1, final Object object2) {
+ private static class StyleWrapperComparator implements Comparator<StyleWrapper> {
+
+ public int compare(final StyleWrapper object1, final StyleWrapper object2) {
int result = 0;
StyleWrapper wrapper1 = (StyleWrapper) object1;
StyleWrapper wrapper2 = (StyleWrapper) object2;
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/ViewCSSImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/ViewCSSImpl.java
index 8f9e2b6426b..511fdab594f 100644
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/ViewCSSImpl.java
+++ b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/ViewCSSImpl.java
@@ -69,8 +69,7 @@ public class ViewCSSImpl implements ViewCSS {
return null;
}
- public CSSStyleDeclaration getComputedStyle(CSSStyleSheet styleSheet,
- Element elt, String pseudoElt) {
+ public CSSStyleDeclaration getComputedStyle(CSSStyleSheet styleSheet, Element elt, String pseudoElt) {
List styleDeclarations = null;
StyleWrapper firstStyleDeclaration = null;
CSSRuleList ruleList = styleSheet.getCssRules();
@@ -78,8 +77,7 @@ public class ViewCSSImpl implements ViewCSS {
int position = 0;
for (int i = 0; i < length; i++) {
CSSRule rule = ruleList.item(i);
- switch (rule.getType()) {
- case CSSRule.STYLE_RULE: {
+ if (rule.getType() == CSSRule.STYLE_RULE) {
CSSStyleRule styleRule = (CSSStyleRule) rule;
if (rule instanceof ExtendedCSSRule) {
ExtendedCSSRule r = (ExtendedCSSRule) rule;
@@ -104,8 +102,7 @@ public class ViewCSSImpl implements ViewCSS {
// match the current element
if (styleDeclarations == null) {
styleDeclarations = new ArrayList();
- styleDeclarations
- .add(firstStyleDeclaration);
+ styleDeclarations.add(firstStyleDeclaration);
}
styleDeclarations.add(wrapper);
}
@@ -120,7 +117,6 @@ public class ViewCSSImpl implements ViewCSS {
// Manage this case...
}
}
- }
}
if (styleDeclarations != null) {
// There is several Style Declarations wich match
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/serializers/CSSSerializer.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/serializers/CSSSerializer.java
index b5e9cd08a51..12e8010fb2e 100644
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/serializers/CSSSerializer.java
+++ b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/serializers/CSSSerializer.java
@@ -13,9 +13,7 @@ package org.eclipse.e4.ui.css.core.serializers;
import java.io.IOException;
import java.io.Writer;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
-
import org.eclipse.e4.ui.css.core.engine.CSSEngine;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -37,15 +35,14 @@ public class CSSSerializer {
* stored into the <code>writer</code>. If
* <code>serializeChildNodes</code> is true, the method will serialize too
* the child nodes of the <code>element</code>.
- *
+ *
* @param writer
* @param engine
* @param element
* @param serializeChildNodes
* @throws IOException
*/
- public void serialize(Writer writer, CSSEngine engine, Object element,
- boolean serializeChildNodes) throws IOException {
+ public void serialize(Writer writer, CSSEngine engine, Object element, boolean serializeChildNodes) throws IOException {
serialize(writer, engine, element, serializeChildNodes, null);
}
@@ -57,7 +54,7 @@ public class CSSSerializer {
* the child nodes of the <code>element</code>. The
* {@link CSSSerializerConfiguration} <code>configuration</code> is used
* to generate selector with condition like Text[style='SWT.MULTI'].
- *
+ *
* @param writer
* @param engine
* @param element
@@ -65,19 +62,13 @@ public class CSSSerializer {
* @param configuration
* @throws IOException
*/
- public void serialize(Writer writer, CSSEngine engine, Object element,
- boolean serializeChildNodes,
- CSSSerializerConfiguration configuration) throws IOException {
- Map selectors = new HashMap();
- serialize(writer, engine, element, serializeChildNodes, selectors,
- configuration);
+ public void serialize(Writer writer, CSSEngine engine, Object element, boolean serializeChildNodes, CSSSerializerConfiguration configuration) throws IOException {
+ Map<String, CSSStyleDeclaration> selectors = new HashMap<String, CSSStyleDeclaration>();
+ serialize(writer, engine, element, serializeChildNodes, selectors, configuration);
boolean firstSelector = true;
- for (Iterator iterator = selectors.entrySet().iterator(); iterator
- .hasNext();) {
- Map.Entry entry = (Map.Entry) iterator.next();
- String selectorName = (String) entry.getKey();
- CSSStyleDeclaration styleDeclaration = (CSSStyleDeclaration) entry
- .getValue();
+ for (Map.Entry<String, CSSStyleDeclaration> entry : selectors.entrySet()) {
+ String selectorName = entry.getKey();
+ CSSStyleDeclaration styleDeclaration = entry.getValue();
if (styleDeclaration != null) {
int length = styleDeclaration.getLength();
// Start selector
@@ -85,8 +76,7 @@ public class CSSSerializer {
firstSelector = false;
for (int i = 0; i < length; i++) {
String propertyName = styleDeclaration.item(i);
- String propertyValue = styleDeclaration
- .getPropertyValue(propertyName);
+ String propertyValue = styleDeclaration.getPropertyValue(propertyName);
property(writer, propertyName, propertyValue);
}
// End selector
@@ -103,9 +93,9 @@ public class CSSSerializer {
* the child nodes of the <code>element</code>. The
* {@link CSSSerializerConfiguration} <code>configuration</code> is used
* to generate selector with condition like Text[style='SWT.MULTI'].
- *
+ *
* Map of <code>selectors</code> contains the selector already built.
- *
+ *
* @param writer
* @param engine
* @param element
@@ -114,14 +104,12 @@ public class CSSSerializer {
* @param configuration
* @throws IOException
*/
- protected void serialize(Writer writer, CSSEngine engine, Object element,
- boolean serializeChildNodes, Map selectors,
+ protected void serialize(Writer writer, CSSEngine engine, Object element, boolean serializeChildNodes, Map<String, CSSStyleDeclaration> selectors,
CSSSerializerConfiguration configuration) throws IOException {
Element elt = engine.getElement(element);
if (elt != null) {
- String selectorName = elt.getLocalName();
- CSSStyleDeclaration styleDeclaration = engine
- .getDefaultStyleDeclaration(element, null);
+ StringBuilder selectorName = new StringBuilder(elt.getLocalName());
+ CSSStyleDeclaration styleDeclaration = engine.getDefaultStyleDeclaration(element, null);
if (configuration != null) {
String[] attributesFilter = configuration.getAttributesFilter();
@@ -129,17 +117,20 @@ public class CSSSerializer {
String attributeFilter = attributesFilter[i];
String value = elt.getAttribute(attributeFilter);
if (value != null && value.length() > 0) {
+ selectorName.append("[");
+ selectorName.append(attributeFilter);
+ selectorName.append("=");
if (value.indexOf(".") != -1) {
value = "'" + value + "'";
}
- selectorName += "[" + attributeFilter + "=" + value
- + "]";
+ selectorName.append(value);
+ selectorName.append("]");
break;
}
}
}
- selectors.put(selectorName, styleDeclaration);
+ selectors.put(selectorName.toString(), styleDeclaration);
if (serializeChildNodes) {
NodeList nodes = elt.getChildNodes();
if (nodes != null) {
@@ -154,41 +145,39 @@ public class CSSSerializer {
/**
* Generate start selector.
- *
+ *
* @param writer
* @param selectorName
* @param firstSelector
* @throws IOException
*/
- protected void startSelector(Writer writer, String selectorName,
- boolean firstSelector) throws IOException {
- if (firstSelector == false)
+ protected void startSelector(Writer writer, String selectorName, boolean firstSelector) throws IOException {
+ if (firstSelector == false) {
writer.write("\n\n");
+ }
writer.write(selectorName + " {");
}
/**
* Generate end selector.
- *
+ *
* @param writer
* @param selectorName
* @throws IOException
*/
- protected void endSelector(Writer writer, String selectorName)
- throws IOException {
+ protected void endSelector(Writer writer, String selectorName) throws IOException {
writer.write("\n}");
}
/**
* Generate CSS Property.
- *
+ *
* @param writer
* @param propertyName
* @param propertyValue
* @throws IOException
*/
- private void property(Writer writer, String propertyName,
- String propertyValue) throws IOException {
+ private void property(Writer writer, String propertyName, String propertyValue) throws IOException {
writer.write("\n\t" + propertyName + ":" + propertyValue + ";");
}
}
diff --git a/bundles/org.eclipse.e4.ui.css.swt/forceQualifierUpdate.txt b/bundles/org.eclipse.e4.ui.css.swt/forceQualifierUpdate.txt
index 56f1032a8a4..d38cb93643a 100644
--- a/bundles/org.eclipse.e4.ui.css.swt/forceQualifierUpdate.txt
+++ b/bundles/org.eclipse.e4.ui.css.swt/forceQualifierUpdate.txt
@@ -1,2 +1,3 @@
# To force a version qualifier update add the bug here
Bug 403352 - Update all parent versions to match our build stream
+Bug 416898 - Some Platform UI bundles need to be touched to get API descriptions back
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/SplitDropAgent.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/SplitDropAgent.java
index 5d346c2f1b4..0f6ed5db575 100644
--- a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/SplitDropAgent.java
+++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/SplitDropAgent.java
@@ -41,7 +41,6 @@ public class SplitDropAgent extends DropAgent {
private MPartStack dropStack;
private CTabFolder dropCTF;
private Rectangle clientBounds;
- private String weight;
private Rectangle ctfBounds;
@@ -94,7 +93,6 @@ public class SplitDropAgent extends DropAgent {
if (dragParent == dropStack && dropStack.getChildren().size() == 2)
return false;
- weight = dropStack.getContainerData();
dropCTF = (CTabFolder) dropStack.getWidget();
return true;
@@ -371,14 +369,8 @@ public class SplitDropAgent extends DropAgent {
}
float pct = (float) (onEdge ? 0.34 : 0.50);
- MUIElement relToParent = relTo.getParent();
dndManager.getModelService().insert(toInsert, relTo, where, pct);
- // Force the new sash to have the same weight as the original element
- if (relTo.getParent() != relToParent && !onEdge)
- relTo.getParent().setContainerData(weight);
- dndManager.update();
-
return true;
}
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/LazyStackRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/LazyStackRenderer.java
index fc9a404992e..78c6fe7cbb6 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/LazyStackRenderer.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/LazyStackRenderer.java
@@ -25,7 +25,6 @@ import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
import org.eclipse.e4.ui.workbench.IPresentationEngine;
import org.eclipse.e4.ui.workbench.UIEvents;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -232,7 +231,6 @@ public abstract class LazyStackRenderer extends SWTPartRenderer {
Composite phComp = (Composite) ph.getWidget();
Control refCtrl = (Control) ph.getRef().getWidget();
refCtrl.setParent(phComp);
- phComp.layout(new Control[] { refCtrl }, SWT.DEFER);
element = ref;
}
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/PerspectiveStackRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/PerspectiveStackRenderer.java
index 5356ba2ad3d..2598dcf8f69 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/PerspectiveStackRenderer.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/PerspectiveStackRenderer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 IBM Corporation and others.
+ * Copyright (c) 2009, 2013 IBM Corporation 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
@@ -120,8 +120,12 @@ public class PerspectiveStackRenderer extends LazyStackRenderer {
// Force a context switch
if (tabElement instanceof MPerspective) {
- IEclipseContext context = persp.getContext();
- context.get(EPartService.class).switchPerspective(persp);
+ MPerspective selected = (MPerspective) tabElement.getParent()
+ .getSelectedElement();
+ if (selected != null) {
+ IEclipseContext context = selected.getContext();
+ context.get(EPartService.class).switchPerspective(selected);
+ }
}
// Move any other controls to 'limbo'
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashLayout.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashLayout.java
index 5ef8fec5fbc..ed6ca58d398 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashLayout.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashLayout.java
@@ -61,6 +61,8 @@ public class SashLayout extends Layout {
boolean draggingSashes = false;
List<SashRect> sashesToDrag;
+ public boolean layoutUpdateInProgress = false;
+
public SashLayout(final Composite host, MUIElement root) {
this.root = root;
this.host = host;
@@ -78,7 +80,7 @@ public class SashLayout extends Layout {
});
host.addMouseMoveListener(new MouseMoveListener() {
- public void mouseMove(MouseEvent e) {
+ public void mouseMove(final MouseEvent e) {
if (!draggingSashes) {
// Set the cursor feedback
List<SashRect> sashList = getSashRects(e.x, e.y);
@@ -97,9 +99,14 @@ public class SashLayout extends Layout {
SWT.CURSOR_SIZEALL));
}
} else {
- adjustWeights(sashesToDrag, e.x, e.y);
- host.layout();
- host.update();
+ try {
+ layoutUpdateInProgress = true;
+ adjustWeights(sashesToDrag, e.x, e.y);
+ host.layout();
+ host.update();
+ } finally {
+ layoutUpdateInProgress = false;
+ }
}
}
});
@@ -143,7 +150,6 @@ public class SashLayout extends Layout {
public void setRootElemenr(MUIElement newRoot) {
root = newRoot;
- host.layout(null, SWT.DEFER);
}
@Override
@@ -332,15 +338,14 @@ public class SashLayout extends Layout {
private static int getWeight(MUIElement element) {
String info = element.getContainerData();
if (info == null || info.length() == 0) {
- element.setContainerData(Integer.toString(100));
- info = element.getContainerData();
+ return 0;
}
try {
int value = Integer.parseInt(info);
return value;
} catch (NumberFormatException e) {
- return 500;
+ return 0;
}
}
}
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashRenderer.java
index 1f4a3c89755..e2445db2969 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashRenderer.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SashRenderer.java
@@ -24,8 +24,7 @@ import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Layout;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventHandler;
@@ -83,13 +82,17 @@ public class SashRenderer extends SWTPartRenderer {
*/
protected void forceLayout(MElementContainer<MUIElement> pscModel) {
// layout the containing Composite
- while (!(pscModel.getWidget() instanceof Control))
+ while (!(pscModel.getWidget() instanceof Composite))
pscModel = pscModel.getParent();
- Control ctrl = (Control) pscModel.getWidget();
- if (ctrl instanceof Shell)
- ((Shell) ctrl).layout(null, SWT.ALL | SWT.CHANGED | SWT.DEFER);
- else
- ctrl.getParent().layout(null, SWT.ALL | SWT.CHANGED | SWT.DEFER);
+
+ Composite s = (Composite) pscModel.getWidget();
+ Layout layout = s.getLayout();
+ if (layout instanceof SashLayout) {
+ if (((SashLayout) layout).layoutUpdateInProgress) {
+ return;
+ }
+ }
+ s.layout(true, true);
}
@PreDestroy
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java
index 8bddac4538b..1ed9631be90 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java
@@ -616,7 +616,8 @@ public class StackRenderer extends LazyStackRenderer {
part.getToolbar().setVisible(true);
Object tbObj = renderer.createGui(part.getToolbar(),
getTRComposite(ctf), part.getContext());
- // The TB renderer actually wraps the TB in a Composite
+ // The TB renderer actually wraps the TB in a Composite, if the TB
+ // changes size we need to re-pack the composite
if (tbObj instanceof Composite) {
Control[] kids = ((Composite) tbObj).getChildren();
for (Control kid : kids) {
@@ -627,8 +628,7 @@ public class StackRenderer extends LazyStackRenderer {
if (!ctf.isDisposed()) {
Control tr = ctf.getTopRight();
if (tr != null && !tr.isDisposed())
- ctf.getTopRight().pack();
- ctf.layout(true, true);
+ tr.pack();
}
}
@@ -661,7 +661,6 @@ public class StackRenderer extends LazyStackRenderer {
}
trComp.pack();
- ctf.layout(true, true);
}
private MToolBar getViewTB(CTabFolder ctf) {
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java
index 57b403b651c..6eb722f1b48 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/WBWRenderer.java
@@ -599,7 +599,9 @@ public class WBWRenderer extends SWTPartRenderer {
if (wbwModel instanceof MTrimmedWindow) {
Shell shell = (Shell) wbwModel.getWidget();
MTrimmedWindow tWindow = (MTrimmedWindow) wbwModel;
- for (MTrimBar trimBar : tWindow.getTrimBars()) {
+ List<MTrimBar> trimBars = new ArrayList<MTrimBar>(
+ tWindow.getTrimBars());
+ for (MTrimBar trimBar : trimBars) {
renderer.createGui(trimBar, shell, wbwModel.getContext());
// bug 387161: hack around that createGui(e, parent, context)
// does not reparent the element widget to the
diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/forceQualifierUpdate.txt b/bundles/org.eclipse.e4.ui.workbench.swt/forceQualifierUpdate.txt
index d01ddc17c76..eb097d5ea61 100644
--- a/bundles/org.eclipse.e4.ui.workbench.swt/forceQualifierUpdate.txt
+++ b/bundles/org.eclipse.e4.ui.workbench.swt/forceQualifierUpdate.txt
@@ -1,4 +1,5 @@
# To force a version qualifier update add the bug here
Bug 403352 - Update all parent versions to match our build stream
Bug 407961 - Comparator log shows special problem that will require "touches"
+Bug 416898 - Some Platform UI bundles need to be touched to get API descriptions back
diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java
index 52f8e5e8400..262d4b26809 100644
--- a/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java
+++ b/bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java
@@ -104,6 +104,7 @@ public class E4Application implements IApplication {
private static final String WORKSPACE_VERSION_KEY = "org.eclipse.core.runtime"; //$NON-NLS-1$
private static final String WORKSPACE_VERSION_VALUE = "2"; //$NON-NLS-1$
private static final String APPLICATION_MODEL_PATH_DEFAULT = "Application.e4xmi";
+ private static final String PERSPECTIVE_ARG_NAME = "perspective";
private String[] args;
@@ -238,6 +239,14 @@ public class E4Application implements IApplication {
PostContextCreate.class, appContext, null);
}
}
+
+ String forcedPerspectiveId = getArgValue(PERSPECTIVE_ARG_NAME,
+ applicationContext, false);
+ if (forcedPerspectiveId != null) {
+ appContext.set(E4Workbench.FORCED_PERSPECTIVE_ID,
+ forcedPerspectiveId);
+ }
+
// Create the app model and its context
MApplication appModel = loadApplicationModel(applicationContext,
appContext);
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/CommandLineOptionModelProcessor.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/CommandLineOptionModelProcessor.java
new file mode 100644
index 00000000000..8921e270bc9
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/CommandLineOptionModelProcessor.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2013 IBM Corporation 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:
+ * IBM Corporation - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.e4.ui.internal.workbench;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.ui.model.application.MApplication;
+import org.eclipse.e4.ui.model.application.ui.advanced.MPerspective;
+import org.eclipse.e4.ui.model.application.ui.advanced.MPerspectiveStack;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
+
+/**
+ *
+ */
+public class CommandLineOptionModelProcessor {
+ @Inject
+ private IEclipseContext context;
+
+ @Inject
+ private MApplication application;
+
+ @Inject
+ private EModelService modelService;
+
+ @SuppressWarnings("javadoc")
+ public void process() {
+ selectForcedPerspective();
+ }
+
+ private void selectForcedPerspective() {
+ String forcedPerspectiveId = (String) context.get(E4Workbench.FORCED_PERSPECTIVE_ID);
+ if (forcedPerspectiveId == null) {
+ return;
+ }
+
+ List<MPerspectiveStack> perspStackList = modelService.findElements(application, null,
+ MPerspectiveStack.class, null);
+
+ if (perspStackList.isEmpty()) {
+ return;
+ }
+
+ MPerspectiveStack perspStack = perspStackList.get(0);
+ MPerspective selected = perspStack.getSelectedElement();
+
+ if (selected != null && selected.getElementId().equals(forcedPerspectiveId)) {
+ return;
+ }
+
+ for (MPerspective persp : perspStack.getChildren()) {
+ if (persp.getElementId().equals(forcedPerspectiveId)) {
+ perspStack.setSelectedElement(persp);
+ return;
+ }
+ }
+ }
+}
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4Workbench.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4Workbench.java
index 5bec0c16f50..0c031aa3440 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4Workbench.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/E4Workbench.java
@@ -71,6 +71,12 @@ public class E4Workbench implements IWorkbench {
* Value is: <code>dir</code>
*/
public static final String RTL_MODE = "dir"; //$NON-NLS-1$
+ /**
+ * The argument for the perspective to activate <br>
+ * <br>
+ * Value is: <code>perspectiveId</code>
+ */
+ public static final String FORCED_PERSPECTIVE_ID = "forcedPerspetiveId"; //$NON-NLS-1$
private final String id;
private ServiceRegistration<?> osgiRegistration;
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java
index 527b5a75924..9679db1a011 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ModelServiceImpl.java
@@ -755,6 +755,10 @@ public class ModelServiceImpl implements EModelService {
} else {
MPartSashContainer newSash = BasicFactoryImpl.eINSTANCE.createPartSashContainer();
newSash.setHorizontal(horizontal);
+
+ // Maintain the existing weight in the new sash
+ newSash.setContainerData(relTo.getContainerData());
+
combine(toInsert, relTo, newSash, insertBefore, ratio);
}
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java
index 98c4a8e7fa8..4b40b039a8d 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Lars Vogel (Lars.Vogel@gmail.com) - Bug 416082
******************************************************************************/
package org.eclipse.e4.ui.internal.workbench;
@@ -43,7 +44,6 @@ import org.eclipse.e4.ui.model.application.ui.basic.MInputPart;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
-import org.eclipse.e4.ui.model.application.ui.basic.impl.BasicFactoryImpl;
import org.eclipse.e4.ui.model.application.ui.menu.MToolBar;
import org.eclipse.e4.ui.services.EContextService;
import org.eclipse.e4.ui.services.IServiceConstants;
@@ -666,8 +666,7 @@ public class PartServiceImpl implements EPartService {
if (descriptor == null) {
return null;
}
-
- MPart part = BasicFactoryImpl.eINSTANCE.createPart();
+ MPart part = modelService.createModelElement(MPart.class);
part.setElementId(descriptor.getElementId());
part.getMenus().addAll(EcoreUtil.copyAll(descriptor.getMenus()));
if (descriptor.getToolbar() != null) {
@@ -897,18 +896,18 @@ public class PartServiceImpl implements EPartService {
MElementContainer<MUIElement> searchRoot = getContainer();
List<MUIElement> children = searchRoot.getChildren();
if (children.size() == 0) {
- MPartStack stack = BasicFactoryImpl.eINSTANCE.createPartStack();
+ MPartStack stack = modelService.createModelElement(MPartStack.class);
searchRoot.getChildren().add(stack);
return stack;
}
MElementContainer<?> lastContainer = getLastContainer(searchRoot, children);
if (lastContainer == null) {
- MPartStack stack = BasicFactoryImpl.eINSTANCE.createPartStack();
+ MPartStack stack = modelService.createModelElement(MPartStack.class);
searchRoot.getChildren().add(stack);
return stack;
} else if (!(lastContainer instanceof MPartStack)) {
- MPartStack stack = BasicFactoryImpl.eINSTANCE.createPartStack();
+ MPartStack stack = modelService.createModelElement(MPartStack.class);
((List) lastContainer.getChildren()).add(stack);
return stack;
}
@@ -1029,6 +1028,7 @@ public class PartServiceImpl implements EPartService {
case VISIBLE:
MPart activePart = getActivePart();
if (activePart == null || getParent(activePart) == getParent(addedPart)) {
+ delegateBringToTop(addedPart);
activate(addedPart);
} else {
bringToTop(addedPart);
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ResourceHandler.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ResourceHandler.java
index 177a9af2a14..11d200c8139 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ResourceHandler.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ResourceHandler.java
@@ -218,6 +218,12 @@ public class ResourceHandler implements IModelResourceHandler {
context);
contribProcessor.processModel();
+ if (!clearPersistedState) {
+ CommandLineOptionModelProcessor processor = ContextInjectionFactory.make(
+ CommandLineOptionModelProcessor.class, context);
+ processor.process();
+ }
+
return resource;
}
diff --git a/bundles/org.eclipse.ui.forms/forceQualifierUpdate.txt b/bundles/org.eclipse.ui.forms/forceQualifierUpdate.txt
index 56f1032a8a4..d38cb93643a 100644
--- a/bundles/org.eclipse.ui.forms/forceQualifierUpdate.txt
+++ b/bundles/org.eclipse.ui.forms/forceQualifierUpdate.txt
@@ -1,2 +1,3 @@
# To force a version qualifier update add the bug here
Bug 403352 - Update all parent versions to match our build stream
+Bug 416898 - Some Platform UI bundles need to be touched to get API descriptions back
diff --git a/bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF b/bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF
index 639ff9287c0..d66bef060c0 100644
--- a/bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.ui.navigator.resources/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Plugin.name
Bundle-SymbolicName: org.eclipse.ui.navigator.resources; singleton:=true
-Bundle-Version: 3.4.500.qualifier
+Bundle-Version: 3.4.600.qualifier
Bundle-Activator: org.eclipse.ui.internal.navigator.resources.plugin.WorkbenchNavigatorPlugin
Bundle-Vendor: %Plugin.providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.ui.navigator.resources/plugin.xml b/bundles/org.eclipse.ui.navigator.resources/plugin.xml
index 71daa83944f..64405193e54 100644
--- a/bundles/org.eclipse.ui.navigator.resources/plugin.xml
+++ b/bundles/org.eclipse.ui.navigator.resources/plugin.xml
@@ -174,11 +174,12 @@
<enablement>
<and>
<or>
- <and>
- <adapt type="org.eclipse.core.resources.IProject" />
- <test property="org.eclipse.core.resources.open"
- value="true"/>
- </and>
+ <adapt
+ type="org.eclipse.core.resources.IProject">
+ <test
+ property="org.eclipse.core.resources.open">
+ </test>
+ </adapt>
<adapt type="org.eclipse.core.resources.IFolder" />
<adapt type="org.eclipse.ui.IWorkingSet" />
</or>
@@ -283,10 +284,13 @@
activeByDefault="false"
>
<filterExpression>
- <and>
- <instanceof value="org.eclipse.core.resources.IProject"/>
- <test property="org.eclipse.core.resources.open" value="false"/>
- </and>
+ <adapt
+ type="org.eclipse.core.resources.IProject">
+ <test
+ property="org.eclipse.core.resources.open"
+ value="false">
+ </test>
+ </adapt>
</filterExpression>
</commonFilter>
<commonFilter
diff --git a/bundles/org.eclipse.ui.navigator.resources/pom.xml b/bundles/org.eclipse.ui.navigator.resources/pom.xml
index 0215f5d0756..01b4fba02e4 100644
--- a/bundles/org.eclipse.ui.navigator.resources/pom.xml
+++ b/bundles/org.eclipse.ui.navigator.resources/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.ui</groupId>
<artifactId>org.eclipse.ui.navigator.resources</artifactId>
- <version>3.4.500-SNAPSHOT</version>
+ <version>3.4.600-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
index ccff10a7b8a..b3846c5b97f 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
@@ -47,6 +47,7 @@ import org.eclipse.e4.core.di.InjectionException;
import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.core.services.events.IEventBroker;
import org.eclipse.e4.core.services.log.Logger;
+import org.eclipse.e4.ui.internal.workbench.E4Workbench;
import org.eclipse.e4.ui.internal.workbench.PartServiceSaveHandler;
import org.eclipse.e4.ui.internal.workbench.URIHelper;
import org.eclipse.e4.ui.internal.workbench.renderers.swt.IUpdateService;
@@ -121,6 +122,7 @@ import org.eclipse.ui.IPageListener;
import org.eclipse.ui.IPageService;
import org.eclipse.ui.IPartService;
import org.eclipse.ui.IPerspectiveDescriptor;
+import org.eclipse.ui.IPerspectiveRegistry;
import org.eclipse.ui.ISaveablePart;
import org.eclipse.ui.ISelectionService;
import org.eclipse.ui.ISources;
@@ -590,23 +592,6 @@ public class WorkbenchWindow implements IWorkbenchWindow {
fillActionBars(FILL_ALL_ACTION_BARS);
firePageOpened();
- List<MPerspectiveStack> ps = modelService.findElements(model, null,
- MPerspectiveStack.class, null);
- MPerspective curPersp = null;
- boolean newWindow = true;
- if (ps.size() > 0) {
- MPerspectiveStack stack = ps.get(0);
- if (stack.getSelectedElement() != null) {
- curPersp = stack.getSelectedElement();
- IPerspectiveDescriptor thePersp = getWorkbench().getPerspectiveRegistry()
- .findPerspectiveWithId(curPersp.getElementId());
- if (thePersp != null) {
- perspective = thePersp;
- newWindow = false;
- }
- }
- }
-
populateTopTrimContributions();
populateBottomTrimContributions();
@@ -669,8 +654,10 @@ public class WorkbenchWindow implements IWorkbenchWindow {
eventBroker.subscribe(UIEvents.UIElement.TOPIC_WIDGET, windowWidgetHandler);
+ boolean newWindow = setupPerspectiveStack(windowContext);
page.setPerspective(perspective);
firePageActivated();
+
if (newWindow) {
page.fireInitialPartVisibilityEvents();
} else {
@@ -712,6 +699,35 @@ public class WorkbenchWindow implements IWorkbenchWindow {
contextService.registerShell(shell, IContextService.TYPE_WINDOW);
}
+ private boolean setupPerspectiveStack(IEclipseContext context) {
+ IPerspectiveRegistry registry = getWorkbench().getPerspectiveRegistry();
+ String forcedPerspectiveId = (String) context.get(E4Workbench.FORCED_PERSPECTIVE_ID);
+
+ if (forcedPerspectiveId != null) {
+ perspective = registry.findPerspectiveWithId(forcedPerspectiveId);
+ }
+
+ List<MPerspectiveStack> perspStackList = modelService.findElements(model, null,
+ MPerspectiveStack.class, null);
+ MPerspective selectedPersp = null;
+
+ if (!perspStackList.isEmpty()) {
+ selectedPersp = perspStackList.get(0).getSelectedElement();
+ }
+
+ if (forcedPerspectiveId == null && selectedPersp != null) {
+ perspective = registry.findPerspectiveWithId(selectedPersp.getElementId());
+ }
+
+ if (perspective == null) {
+ perspective = registry.findPerspectiveWithId(registry.getDefaultPerspective());
+ }
+
+ // the perspective stack doesn't have a selected element what means that
+ // we have a new window
+ return selectedPersp == null;
+ }
+
private boolean manageChanges = true;
private boolean canUpdateMenus = true;
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardActivityFilter.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardActivityFilter.java
index 74f21b64ecb..c32ce3d7221 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardActivityFilter.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardActivityFilter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation 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
@@ -10,8 +10,7 @@
*******************************************************************************/
package org.eclipse.ui.internal.dialogs;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.ITreeContentProvider;
+import java.util.ArrayList;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.ui.activities.WorkbenchActivityHelper;
@@ -24,17 +23,10 @@ import org.eclipse.ui.model.AdaptableList;
* @since 3.0
*/
public class WizardActivityFilter extends ViewerFilter {
-
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
- Object[] children = ((ITreeContentProvider) ((AbstractTreeViewer) viewer)
- .getContentProvider()).getChildren(element);
- if (children.length > 0) {
- return filter(viewer, element, children).length > 0;
- }
-
if (parentElement.getClass().equals(AdaptableList.class)) {
return true; //top-level ("primary") wizards should always be returned
}
@@ -45,4 +37,24 @@ public class WizardActivityFilter extends ViewerFilter {
return true;
}
+
+ @Override
+ public Object[] filter(Viewer viewer, Object parent, Object[] elements) {
+ int size = elements.length;
+ ArrayList<Object> out = new ArrayList<Object>(size);
+
+ for (int i = 0; i < size; ++i) {
+ Object element = elements[i];
+ if (element instanceof WizardCollectionElement) {
+ Object wizardCollection = WizardCollectionElement.filter(viewer, this,
+ (WizardCollectionElement) element);
+ if (wizardCollection != null) {
+ out.add(wizardCollection);
+ }
+ } else if (select(viewer, parent, element)) {
+ out.add(element);
+ }
+ }
+ return out.toArray();
+ }
}
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardCollectionElement.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardCollectionElement.java
index deff78ce3eb..c827ea2a58e 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardCollectionElement.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardCollectionElement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation 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
@@ -14,13 +14,14 @@ package org.eclipse.ui.internal.dialogs;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.ui.IPluginContribution;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.activities.WorkbenchActivityHelper;
@@ -36,8 +37,8 @@ import org.eclipse.ui.wizards.IWizardDescriptor;
* thereby facilitating the definition of tree structures composed of these
* elements. Instances also store a list of wizards.
*/
-public class WizardCollectionElement extends AdaptableList implements
- IPluginContribution, IWizardCategory {
+public class WizardCollectionElement extends AdaptableList implements IPluginContribution,
+ IWizardCategory {
private String id;
private String pluginId;
@@ -80,6 +81,16 @@ public class WizardCollectionElement extends AdaptableList implements
this.parent = parent;
}
+ private WizardCollectionElement(WizardCollectionElement input, AdaptableList wizards) {
+ this(input.id, input.pluginId, input.name, input.parent);
+ this.configElement = input.configElement;
+ this.wizards = wizards;
+
+ for (Object child : input.children) {
+ children.add(child);
+ }
+ }
+
/**
* Adds a wizard collection to this collection.
*/
@@ -413,4 +424,46 @@ public class WizardCollectionElement extends AdaptableList implements
public IWizardCategory findCategory(IPath path) {
return findChildCollection(path);
}
+
+ /**
+ * The helper method used to filter <code>WizardCollectionElement</code>
+ * using <code>ViewerFilter</code>.<br>
+ * It returns the result in the following way:<br>
+ * - if some of the wizards from the input collection is skipped by the
+ * viewerFilter then the modified copy of the collection (without skipped
+ * wizards) is returned<br>
+ * - when all wizards are skipped then null will be returned<br>
+ * - if none of the wizards is skipped during filtering then the original
+ * input collection is returned
+ *
+ * @param viewer
+ * the Viewer used by <code>ViewerFilter.select</code> method
+ * @param viewerFilter
+ * the ViewerFilter
+ * @param inputCollection
+ * collection to filter
+ * @return inputCollection, modified copy of inputCollection or null
+ *
+ */
+ static WizardCollectionElement filter(Viewer viewer, ViewerFilter viewerFilter,
+ WizardCollectionElement inputCollection) {
+ AdaptableList wizards = null;
+
+ for (Object child : inputCollection.getWizardAdaptableList().getChildren()) {
+ if (viewerFilter.select(viewer, inputCollection, child)) {
+ if (wizards == null) {
+ wizards = new AdaptableList();
+ }
+ wizards.add((IAdaptable) child);
+ }
+ }
+
+ if (wizards == null) {
+ return null;
+ }
+ if (inputCollection.getWizardAdaptableList().size() == wizards.size()) {
+ return inputCollection;
+ }
+ return new WizardCollectionElement(inputCollection, wizards);
+ }
}
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardPatternFilter.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardPatternFilter.java
index ba94c9d6307..7f9b33e3b3a 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardPatternFilter.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WizardPatternFilter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation 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
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.ui.internal.dialogs;
+import java.util.ArrayList;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.dialogs.PatternFilter;
@@ -21,7 +22,6 @@ import org.eclipse.ui.dialogs.PatternFilter;
*
*/
public class WizardPatternFilter extends PatternFilter {
-
/**
* Create a new instance of a WizardPatternFilter
* @param isMatchItem
@@ -63,4 +63,22 @@ public class WizardPatternFilter extends PatternFilter {
return false;
}
+ @Override
+ public Object[] filter(Viewer viewer, Object parent, Object[] elements) {
+ ArrayList<Object> result = new ArrayList<Object>();
+
+ for (Object elem : super.filter(viewer, parent, elements)) {
+ if (elem instanceof WizardCollectionElement) {
+ Object wizardCollection = WizardCollectionElement.filter(viewer, this,
+ (WizardCollectionElement) elem);
+ if (wizardCollection != null) {
+ result.add(wizardCollection);
+ }
+ } else {
+ result.add(elem);
+ }
+ }
+
+ return result.toArray();
+ }
}
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/DetailedProgressViewer.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/DetailedProgressViewer.java
index f9341878813..291ac0c802d 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/DetailedProgressViewer.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/DetailedProgressViewer.java
@@ -123,11 +123,13 @@ public class DetailedProgressViewer extends AbstractProgressViewer {
noEntryArea = new Composite(scrolled, SWT.NONE);
noEntryArea.setLayout(new GridLayout());
+ noEntryArea.setBackground(noEntryArea.getDisplay()
+ .getSystemColor(SWT.COLOR_LIST_BACKGROUND));
Text noEntryLabel = new Text(noEntryArea, SWT.SINGLE);
noEntryLabel.setText(ProgressMessages.ProgressView_NoOperations);
noEntryLabel.setBackground(noEntryArea.getDisplay().getSystemColor(
- SWT.COLOR_WIDGET_BACKGROUND));
+ SWT.COLOR_LIST_BACKGROUND));
GridData textData = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
noEntryLabel.setLayoutData(textData);
noEntryLabel.setEditable(false);
diff --git a/bundles/org.eclipse.ui/forceQualifierUpdate.txt b/bundles/org.eclipse.ui/forceQualifierUpdate.txt
index 56f1032a8a4..d38cb93643a 100644
--- a/bundles/org.eclipse.ui/forceQualifierUpdate.txt
+++ b/bundles/org.eclipse.ui/forceQualifierUpdate.txt
@@ -1,2 +1,3 @@
# To force a version qualifier update add the bug here
Bug 403352 - Update all parent versions to match our build stream
+Bug 416898 - Some Platform UI bundles need to be touched to get API descriptions back
diff --git a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/dialogs/Snippet060DialogWithURLImageButtons.java b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/dialogs/Snippet060DialogWithURLImageButtons.java
index a39da9112bd..79682909a14 100644
--- a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/dialogs/Snippet060DialogWithURLImageButtons.java
+++ b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/dialogs/Snippet060DialogWithURLImageButtons.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 Tom Schindl and others.
+ * Copyright (c) 2006, 2013 Tom Schindl 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Tom Schindl - initial API and implementation
+ * Lars Vogel (lars.vogel@gmail.com) - Bug 413427
*******************************************************************************/
package org.eclipse.jface.snippets.dialogs;
@@ -25,7 +26,7 @@ import org.eclipse.swt.widgets.Shell;
/**
* A snippet to demonstrate a dialog with image buttons.
- *
+ *
*/
public class Snippet060DialogWithURLImageButtons {
private ImageRegistry registry;
@@ -58,9 +59,9 @@ public class Snippet060DialogWithURLImageButtons {
URL url;
try {
url = new URL(
- "http://www.eclipse.org/home/images/enterprise.gif");
+ "http://www.eclipse.org/home/images/enterprise.gif"); //$NON-NLS-N$
b.setImage(ImageDescriptor.createFromURL(url)
- .createImage()); //$NON-NLS-1$
+ .createImage());
} catch (MalformedURLException e) {
e.printStackTrace();
}
diff --git a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet033CellEditorPerRowPre33.java b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet033CellEditorPerRowPre33.java
index 75892848721..59dc1e2c58a 100644
--- a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet033CellEditorPerRowPre33.java
+++ b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet033CellEditorPerRowPre33.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Tom Schindl and others.
+ * Copyright (c) 2007 - 2013 Tom Schindl 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Tom Schindl - initial API and implementation
+ * Lars Vogel (lars.vogel@gmail.com) - Bug 413427
*******************************************************************************/
package org.eclipse.jface.snippets.viewers;
@@ -39,16 +40,15 @@ import org.eclipse.swt.widgets.TableItem;
/**
* Snippet to present editor different CellEditors within one column in 3.2
* for 3.3 and above please use the new EditingSupport class
- *
+ *
* @author Tom Schindl <tom.schindl@bestsolution.at>
- *
+ *
+ *
*/
public class Snippet033CellEditorPerRowPre33 {
private class MyCellModifier implements ICellModifier {
-
+
private TableViewer viewer;
-
- private boolean enabled = true;
public void setViewer(TableViewer viewer) {
this.viewer = viewer;
@@ -56,7 +56,7 @@ public class Snippet033CellEditorPerRowPre33 {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object,
* java.lang.String)
*/
@@ -66,7 +66,7 @@ public class Snippet033CellEditorPerRowPre33 {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object,
* java.lang.String)
*/
@@ -82,29 +82,29 @@ public class Snippet033CellEditorPerRowPre33 {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object,
* java.lang.String, java.lang.Object)
*/
public void modify(Object element, String property, Object value) {
TableItem item = (TableItem) element;
-
+
if( item.getData() instanceof MyModel3 ) {
((MyModel3) item.getData()).checked=((Boolean)value).booleanValue();
} else {
((MyModel) item.getData()).counter = Integer.parseInt(value
.toString());
}
-
+
viewer.update(item.getData(), null);
}
}
-
+
private class MyContentProvider implements IStructuredContentProvider {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
*/
public Object[] getElements(Object inputElement) {
@@ -113,7 +113,7 @@ public class Snippet033CellEditorPerRowPre33 {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
public void dispose() {
@@ -122,7 +122,7 @@ public class Snippet033CellEditorPerRowPre33 {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
* java.lang.Object, java.lang.Object)
*/
@@ -154,10 +154,10 @@ public class Snippet033CellEditorPerRowPre33 {
return "Special Item " + this.counter;
}
}
-
+
public class MyModel3 extends MyModel {
public boolean checked;
-
+
public MyModel3(int counter) {
super(counter);
}
@@ -166,20 +166,20 @@ public class Snippet033CellEditorPerRowPre33 {
return "Special Item " + this.counter;
}
}
-
-
+
+
public class DelegatingEditor extends CellEditor {
-
- private StructuredViewer viewer;
-
- private CellEditor delegatingTextEditor;
-
- private CellEditor delegatingDropDownEditor;
-
+
+ private final StructuredViewer viewer;
+
+ private final CellEditor delegatingTextEditor;
+
+ private final CellEditor delegatingDropDownEditor;
+
private CellEditor activeEditor;
-
- private CellEditor delegatingCheckBoxEditor;
-
+
+ private final CellEditor delegatingCheckBoxEditor;
+
private class DelegatingListener implements ICellEditorListener {
public void applyEditorValue() {
@@ -194,29 +194,29 @@ public class Snippet033CellEditorPerRowPre33 {
boolean newValidState) {
fireEditorValueChanged(oldValidState, newValidState);
}
-
+
}
-
+
public DelegatingEditor(StructuredViewer viewer, Composite parent) {
super(parent);
this.viewer = viewer;
DelegatingListener l = new DelegatingListener();
this.delegatingTextEditor = new TextCellEditor(parent);
this.delegatingTextEditor.addListener(l);
-
+
String[] elements = new String[10];
-
+
for (int i = 0; i < 10; i++) {
elements[i] = i+"";
}
-
+
this.delegatingDropDownEditor = new ComboBoxCellEditor(parent,elements);
this.delegatingDropDownEditor.addListener(l);
-
+
this.delegatingCheckBoxEditor = new CheckboxCellEditor(parent);
this.delegatingCheckBoxEditor.addListener(l);
}
-
+
protected Control createControl(Composite parent) {
return null;
}
@@ -236,7 +236,7 @@ public class Snippet033CellEditorPerRowPre33 {
}
protected void doSetValue(Object value) {
-
+
if( ((IStructuredSelection)this.viewer.getSelection()).getFirstElement() instanceof MyModel3 ) {
activeEditor = delegatingCheckBoxEditor;
} else if( ((IStructuredSelection)this.viewer.getSelection()).getFirstElement() instanceof MyModel2 ) {
@@ -244,10 +244,10 @@ public class Snippet033CellEditorPerRowPre33 {
} else {
activeEditor = delegatingTextEditor;
}
-
+
activeEditor.setValue(value);
}
-
+
public void deactivate() {
if( activeEditor != null ) {
Control control = activeEditor.getControl();
@@ -256,23 +256,23 @@ public class Snippet033CellEditorPerRowPre33 {
}
}
}
-
+
public void dispose() {
-
+
}
-
+
public Control getControl() {
return activeEditor.getControl();
}
}
-
+
public Snippet033CellEditorPerRowPre33(Shell shell) {
final Table table = new Table(shell, SWT.BORDER | SWT.FULL_SELECTION);
final MyCellModifier modifier = new MyCellModifier();
-
+
final TableViewer v = new TableViewer(table);
modifier.setViewer(v);
-
+
TableColumn column = new TableColumn(table, SWT.NONE);
column.setWidth(200);
@@ -295,20 +295,20 @@ public class Snippet033CellEditorPerRowPre33 {
} else {
return JFaceResources.getImage("IMG_2");
}
-
+
}
return super.getImage(element);
}
-
+
}
-
+
private MyModel[] createModel() {
MyModel[] elements = new MyModel[30];
for (int i = 0; i < 10; i++) {
elements[i] = new MyModel3(i);
}
-
+
for (int i = 0; i < 10; i++) {
elements[i+10] = new MyModel(i);
}
@@ -316,7 +316,7 @@ public class Snippet033CellEditorPerRowPre33 {
for (int i = 0; i < 10; i++) {
elements[i+20] = new MyModel2(i);
}
-
+
return elements;
}
diff --git a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet049StyledCellLabelProvider.java b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet049StyledCellLabelProvider.java
index 09cd55d78bf..ec786f47f78 100644
--- a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet049StyledCellLabelProvider.java
+++ b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet049StyledCellLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation 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
@@ -8,6 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Michael Krkoska - initial API and implementation (bug 188333)
+ * Lars Vogel (lars.vogel@gmail.com) - Bug 413427
*******************************************************************************/
package org.eclipse.jface.snippets.viewers;
@@ -19,10 +20,10 @@ import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.StyledCellLabelProvider;
import org.eclipse.jface.viewers.StyledString;
+import org.eclipse.jface.viewers.StyledString.Styler;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerCell;
-import org.eclipse.jface.viewers.StyledString.Styler;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
@@ -43,8 +44,8 @@ import org.eclipse.swt.widgets.Shell;
*/
public class Snippet049StyledCellLabelProvider {
-
-
+
+
private static final int SHELL_WIDTH= 400;
private static final Display DISPLAY= Display.getDefault();
@@ -52,7 +53,7 @@ public class Snippet049StyledCellLabelProvider {
public static void main(String[] args) {
JFaceResources.getColorRegistry().put(JFacePreferences.COUNTER_COLOR, new RGB(0,127,174));
-
+
Shell shell= new Shell(DISPLAY, SWT.CLOSE | SWT.RESIZE);
shell.setSize(SHELL_WIDTH, 400);
shell.setLayout(new GridLayout(1, false));
@@ -60,7 +61,7 @@ public class Snippet049StyledCellLabelProvider {
Snippet049StyledCellLabelProvider example= new Snippet049StyledCellLabelProvider();
Control composite= example.createPartControl(shell);
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
-
+
shell.open();
while (!shell.isDisposed()) {
@@ -82,7 +83,7 @@ public class Snippet049StyledCellLabelProvider {
Label label= new Label(composite, SWT.NONE);
label.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
label.setText("Viewer with a StyledCellLabelProvider:"); //$NON-NLS-1$
-
+
final TableViewer tableViewer= new TableViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
// Multi-font support only works in JFace 3.5 and above (specifically, 3.5 M4 and above).
@@ -92,7 +93,7 @@ public class Snippet049StyledCellLabelProvider {
Font boldFont = new Font(Display.getCurrent(), boldFontData);
ExampleLabelProvider labelProvider= new ExampleLabelProvider(boldFont);
FileSystemContentProvider contentProvider= new FileSystemContentProvider();
-
+
tableViewer.setContentProvider(contentProvider);
tableViewer.setLabelProvider(labelProvider);
@@ -102,7 +103,7 @@ public class Snippet049StyledCellLabelProvider {
return composite;
}
-
+
private static FontData[] getModifiedFontData(FontData[] originalData, int additionalStyle) {
FontData[] styleData = new FontData[originalData.length];
for (int i = 0; i < styleData.length; i++) {
@@ -111,15 +112,15 @@ public class Snippet049StyledCellLabelProvider {
}
return styleData;
}
-
+
private static class ExampleLabelProvider extends StyledCellLabelProvider {
private static int IMAGE_SIZE= 16;
private static final Image IMAGE1= new Image(DISPLAY, DISPLAY.getSystemImage(SWT.ICON_WARNING).getImageData().scaledTo(IMAGE_SIZE, IMAGE_SIZE));
private static final Image IMAGE2= new Image(DISPLAY, DISPLAY.getSystemImage(SWT.ICON_ERROR).getImageData().scaledTo(IMAGE_SIZE, IMAGE_SIZE));
- private final Styler fBoldStyler;
-
+ private final Styler fBoldStyler;
+
public ExampleLabelProvider(final Font boldFont) {
fBoldStyler= new Styler() {
public void applyStyles(TextStyle textStyle) {
@@ -127,23 +128,23 @@ public class Snippet049StyledCellLabelProvider {
}
};
}
-
+
public void update(ViewerCell cell) {
Object element= cell.getElement();
-
+
if (element instanceof File) {
File file= (File) element;
-
+
// Multi-font support only works in JFace 3.5 and above (specifically, 3.5 M4 and above).
// With JFace 3.4, the font information (bold in this example) will be ignored.
Styler style= file.isDirectory() ? fBoldStyler: null;
StyledString styledString= new StyledString(file.getName(), style);
String decoration = MessageFormat.format(" ({0} bytes)", new Object[] { new Long(file.length()) }); //$NON-NLS-1$
styledString.append(decoration, StyledString.COUNTER_STYLER);
-
+
cell.setText(styledString.toString());
cell.setStyleRanges(styledString.getStyleRanges());
-
+
if (file.isDirectory()) {
cell.setImage(IMAGE1);
} else {
@@ -155,7 +156,7 @@ public class Snippet049StyledCellLabelProvider {
super.update(cell);
}
-
+
protected void measure(Event event, Object element) {
super.measure(event, element);
}
diff --git a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet050DelegatingStyledCellLabelProvider.java b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet050DelegatingStyledCellLabelProvider.java
index 35e8f130f52..8f4f2ba1046 100644
--- a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet050DelegatingStyledCellLabelProvider.java
+++ b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet050DelegatingStyledCellLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation 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
@@ -8,6 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Michael Krkoska - initial API and implementation (bug 188333)
+ * Lars Vogel (lars.vogel@gmail.com) - Bug 413427
*******************************************************************************/
package org.eclipse.jface.snippets.viewers;
@@ -22,12 +23,12 @@ import org.eclipse.jface.viewers.CellLabelProvider;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.ColumnViewer;
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.TreeViewerColumn;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -46,17 +47,17 @@ import org.eclipse.swt.widgets.Shell;
* Using a {@link DelegatingStyledCellLabelProvider} on tree viewer with multiple columns. Compare the result with a native tree viewer.
*/
public class Snippet050DelegatingStyledCellLabelProvider {
-
-
+
+
private static final int SHELL_WIDTH= 640;
private static final Display DISPLAY= Display.getDefault();
public static void main(String[] args) {
-
+
JFaceResources.getColorRegistry().put(JFacePreferences.COUNTER_COLOR, new RGB(0,127,174));
-
-
+
+
Shell shell= new Shell(DISPLAY, SWT.CLOSE | SWT.RESIZE);
shell.setSize(SHELL_WIDTH, 300);
@@ -82,7 +83,7 @@ public class Snippet050DelegatingStyledCellLabelProvider {
Composite composite= new Composite(parent, SWT.NONE);
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
composite.setLayout(new GridLayout(2, true));
-
+
final DelegatingStyledCellLabelProvider styledCellLP1= new DelegatingStyledCellLabelProvider(new NameAndSizeLabelProvider());
final DelegatingStyledCellLabelProvider styledCellLP2= new DelegatingStyledCellLabelProvider(new ModifiedDateLabelProvider());
final ColumnViewer ownerDrawViewer= createViewer("Owner draw viewer:", composite, styledCellLP1, styledCellLP2); //$NON-NLS-1$
@@ -94,8 +95,8 @@ public class Snippet050DelegatingStyledCellLabelProvider {
Composite buttons= new Composite(parent, SWT.NONE);
buttons.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
buttons.setLayout(new GridLayout(3, false));
-
-
+
+
Button button1= new Button(buttons, SWT.PUSH);
button1.setText("Refresh Viewers"); //$NON-NLS-1$
button1.addSelectionListener(new SelectionAdapter() {
@@ -105,7 +106,7 @@ public class Snippet050DelegatingStyledCellLabelProvider {
normalViewer.refresh();
}
});
-
+
final Button button2= new Button(buttons, SWT.CHECK);
button2.setText("Owner draw on column 1"); //$NON-NLS-1$
button2.setSelection(true);
@@ -117,7 +118,7 @@ public class Snippet050DelegatingStyledCellLabelProvider {
ownerDrawViewer.refresh();
}
});
-
+
final Button button3= new Button(buttons, SWT.CHECK);
button3.setText("Owner draw on column 2"); //$NON-NLS-1$
button3.setSelection(true);
@@ -130,7 +131,7 @@ public class Snippet050DelegatingStyledCellLabelProvider {
}
});
}
-
+
private static class FileSystemRoot {
public File[] getRoots() {
return File.listRoots();
@@ -150,7 +151,7 @@ public class Snippet050DelegatingStyledCellLabelProvider {
TreeViewer treeViewer= new TreeViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
treeViewer.getTree().setHeaderVisible(true);
treeViewer.setContentProvider(new FileSystemContentProvider());
-
+
TreeViewerColumn tvc1 = new TreeViewerColumn(treeViewer, SWT.NONE);
tvc1.getColumn().setText("Name"); //$NON-NLS-1$
tvc1.getColumn().setWidth(200);
@@ -160,7 +161,7 @@ public class Snippet050DelegatingStyledCellLabelProvider {
tvc2.getColumn().setText("Date Modified"); //$NON-NLS-1$
tvc2.getColumn().setWidth(200);
tvc2.setLabelProvider(labelProvider2);
-
+
GridData data= new GridData(GridData.FILL, GridData.FILL, true, true);
treeViewer.getControl().setLayoutData(data);
@@ -173,7 +174,7 @@ public class Snippet050DelegatingStyledCellLabelProvider {
* A simple label provider
*/
private static class NameAndSizeLabelProvider extends ColumnLabelProvider implements IStyledLabelProvider {
-
+
private static int IMAGE_SIZE= 16;
private static final Image IMAGE1= new Image(DISPLAY, DISPLAY.getSystemImage(SWT.ICON_WARNING).getImageData().scaledTo(IMAGE_SIZE, IMAGE_SIZE));
private static final Image IMAGE2= new Image(DISPLAY, DISPLAY.getSystemImage(SWT.ICON_ERROR).getImageData().scaledTo(IMAGE_SIZE, IMAGE_SIZE));
@@ -207,33 +208,33 @@ public class Snippet050DelegatingStyledCellLabelProvider {
String decoration= MessageFormat.format(" ({0} bytes)", new Object[] { new Long(file.length()) }); //$NON-NLS-1$
styledString.append(decoration, StyledString.COUNTER_STYLER);
}
- }
+ }
return styledString;
}
}
-
+
private static class ModifiedDateLabelProvider extends ColumnLabelProvider implements IStyledLabelProvider {
public String getText(Object element) {
return getStyledText(element).toString();
}
-
+
public StyledString getStyledText(Object element) {
StyledString styledString= new StyledString();
if (element instanceof File) {
File file= (File) element;
-
+
String date= DateFormat.getDateInstance().format(new Date(file.lastModified()));
styledString.append(date);
-
+
styledString.append(' ');
-
+
String time = DateFormat.getTimeInstance(3).format(new Date(file.lastModified()));
styledString.append(time, StyledString.COUNTER_STYLER);
}
return styledString;
}
}
-
+
private static class FileSystemContentProvider implements ITreeContentProvider {
public Object[] getChildren(Object element) {
diff --git a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet058CellNavigationIn34.java b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet058CellNavigationIn34.java
index df7e1f10412..ad220d250d6 100644
--- a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet058CellNavigationIn34.java
+++ b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet058CellNavigationIn34.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 Tom Schindl and others.
+ * Copyright (c) 2006, 2013 Tom Schindl 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
@@ -8,6 +8,7 @@
* Contributors:
* Tom Schindl - initial API and implementation
* Niels Lippke - initial API and implementation
+ * Lars Vogel (lars.vogel@gmail.com) - Bug 413427
*******************************************************************************/
package org.eclipse.jface.snippets.viewers;
@@ -40,9 +41,9 @@ import org.eclipse.swt.widgets.Shell;
/**
* Example for full feature cell navigation until bug 230955 is fixed
- *
+ *
* @author Tom Schindl <tom.schindl@bestsolution.at>, Niels Lippke <niels.lippke@airpas.com>
- *
+ *
*/
public class Snippet058CellNavigationIn34 {
@@ -76,13 +77,13 @@ public class Snippet058CellNavigationIn34 {
}
protected abstract class AbstractEditingSupport extends EditingSupport {
- private CellEditor editor;
+ private final CellEditor editor;
public AbstractEditingSupport(TableViewer viewer) {
super(viewer);
this.editor = new TextCellEditor(viewer.getTable());
}
-
+
public AbstractEditingSupport(TableViewer viewer, CellEditor editor) {
super(viewer);
this.editor = editor;
@@ -167,11 +168,11 @@ public class Snippet058CellNavigationIn34 {
});
-
+
column.setEditingSupport(new AbstractEditingSupport(v) {
- protected Object getValue(Object element) {
- return ((Person) element).email;
+ protected Object getValue(Object element) {
+ return ((Person) element).email;
}
protected void doSetValue(Object element, Object value) {
@@ -192,13 +193,13 @@ public class Snippet058CellNavigationIn34 {
}
});
-
- ComboBoxCellEditor editor = new ComboBoxCellEditor(((TableViewer) v).getTable(), new String[] {"M","F"});
- editor.setActivationStyle(ComboBoxCellEditor.DROP_DOWN_ON_TRAVERSE_ACTIVATION |
+
+ ComboBoxCellEditor editor = new ComboBoxCellEditor(v.getTable(), new String[] {"M","F"});
+ editor.setActivationStyle(ComboBoxCellEditor.DROP_DOWN_ON_TRAVERSE_ACTIVATION |
ComboBoxCellEditor.DROP_DOWN_ON_PROGRAMMATIC_ACTIVATION |
ComboBoxCellEditor.DROP_DOWN_ON_MOUSE_ACTIVATION |
ComboBoxCellEditor.DROP_DOWN_ON_KEY_ACTIVATION);
-
+
column.setEditingSupport(new AbstractEditingSupport(v, editor) {
protected Object getValue(Object element) {
@@ -216,24 +217,24 @@ public class Snippet058CellNavigationIn34 {
}
});
-
+
CellNavigationStrategy naviStrat = new CellNavigationStrategy() {
public ViewerCell findSelectedCell(ColumnViewer viewer,
ViewerCell currentSelectedCell, Event event) {
ViewerCell cell = super.findSelectedCell(viewer, currentSelectedCell, event);
-
+
if( cell != null ) {
v.getTable().showColumn(v.getTable().getColumn(cell.getColumnIndex()));
}
-
+
return cell;
}
-
+
};
-
+
TableViewerFocusCellManager focusCellManager = new TableViewerFocusCellManager(v,new FocusCellOwnerDrawHighlighter(v),naviStrat);
-
+
ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy(v) {
protected boolean isEditorActivationEvent(
ColumnViewerEditorActivationEvent event) {
@@ -243,21 +244,21 @@ public class Snippet058CellNavigationIn34 {
|| event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
}
};
-
+
TableViewerEditor.create(v, focusCellManager, actSupport, ColumnViewerEditor.TABBING_HORIZONTAL
| ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR
| ColumnViewerEditor.TABBING_VERTICAL | ColumnViewerEditor.KEYBOARD_ACTIVATION);
-
+
v.getColumnViewerEditor().addEditorActivationListener(new ColumnViewerEditorActivationListener() {
public void afterEditorActivated(
ColumnViewerEditorActivationEvent event) {
-
+
}
public void afterEditorDeactivated(
ColumnViewerEditorDeactivationEvent event) {
-
+
}
public void beforeEditorActivated(
@@ -268,11 +269,11 @@ public class Snippet058CellNavigationIn34 {
public void beforeEditorDeactivated(
ColumnViewerEditorDeactivationEvent event) {
-
+
}
-
+
});
-
+
Person[] model = createModel();
v.setInput(model);
v.getTable().setLinesVisible(true);
diff --git a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet059CellNavigationIn33.java b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet059CellNavigationIn33.java
index e9b1630880a..f4c919811e2 100644
--- a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet059CellNavigationIn33.java
+++ b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet059CellNavigationIn33.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 Tom Schindl and others.
+ * Copyright (c) 2006, 2013 Tom Schindl 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Tom Schindl - initial API and implementation
+ * Lars Vogel (lars.vogel@gmail.com) - Bug 413427
*******************************************************************************/
package org.eclipse.jface.snippets.viewers;
@@ -18,6 +19,7 @@ import java.util.List;
import org.eclipse.jface.viewers.AbstractTableViewer;
import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.CellEditor.LayoutData;
import org.eclipse.jface.viewers.CellNavigationStrategy;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.ColumnViewer;
@@ -39,7 +41,6 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.jface.viewers.ViewerColumn;
import org.eclipse.jface.viewers.ViewerRow;
-import org.eclipse.jface.viewers.CellEditor.LayoutData;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.TableEditor;
import org.eclipse.swt.events.SelectionAdapter;
@@ -98,7 +99,7 @@ public class Snippet059CellNavigationIn33 {
}
protected abstract class AbstractEditingSupport extends EditingSupport {
- private CellEditor editor;
+ private final CellEditor editor;
public AbstractEditingSupport(TableViewer viewer) {
super(viewer);
@@ -214,7 +215,7 @@ public class Snippet059CellNavigationIn33 {
});
- ComboBoxCellEditor editor = new ComboBoxCellEditor(((TableViewer) v)
+ ComboBoxCellEditor editor = new ComboBoxCellEditor(v
.getTable(), new String[] { "M", "F" });
column.setEditingSupport(new AbstractEditingSupport(v, editor) {
@@ -404,11 +405,11 @@ public class Snippet059CellNavigationIn33 {
/**
* This viewer's table editor.
*/
- private TableEditor tableEditor;
+ private final TableEditor tableEditor;
- private TableViewerFocusCellManager focusCellManager;
+ private final TableViewerFocusCellManager focusCellManager;
- private int feature;
+ private final int feature;
/**
* @param viewer
diff --git a/tests/org.eclipse.ui.tests.performance/META-INF/MANIFEST.MF b/tests/org.eclipse.ui.tests.performance/META-INF/MANIFEST.MF
index 1aee33fd7eb..7a5dfd4f71d 100644
--- a/tests/org.eclipse.ui.tests.performance/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.ui.tests.performance/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: Performance Plug-in
Bundle-ClassPath: uiperformance.jar
Bundle-SymbolicName: org.eclipse.ui.tests.performance;singleton:=true
-Bundle-Version: 1.1.400.qualifier
+Bundle-Version: 1.1.500.qualifier
Bundle-Activator: org.eclipse.ui.tests.performance.UIPerformancePlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
diff --git a/tests/org.eclipse.ui.tests.performance/build.properties b/tests/org.eclipse.ui.tests.performance/build.properties
index ac90ea526d7..1fbec334fec 100644
--- a/tests/org.eclipse.ui.tests.performance/build.properties
+++ b/tests/org.eclipse.ui.tests.performance/build.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2005, 2009 IBM Corporation and others.
+# Copyright (c) 2005, 2013 IBM Corporation 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
@@ -9,8 +9,9 @@
# IBM Corporation - initial API and implementation
###############################################################################
source.uiperformance.jar = src/
-bin.includes = META-INF/,\
- *.xml,\
+bin.includes = plugin.xml,\
+ test.xml,\
+ META-INF/,\
icons/,\
uiperformance.jar,\
data/ \ No newline at end of file
diff --git a/tests/org.eclipse.ui.tests.performance/pom.xml b/tests/org.eclipse.ui.tests.performance/pom.xml
index 78f5d51f8df..a795ceaa3ed 100644
--- a/tests/org.eclipse.ui.tests.performance/pom.xml
+++ b/tests/org.eclipse.ui.tests.performance/pom.xml
@@ -18,6 +18,6 @@
</parent>
<groupId>org.eclipse.ui</groupId>
<artifactId>org.eclipse.ui.tests.performance</artifactId>
- <version>1.1.400-SNAPSHOT</version>
+ <version>1.1.500-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/tests/org.eclipse.ui.tests.rcp/META-INF/MANIFEST.MF b/tests/org.eclipse.ui.tests.rcp/META-INF/MANIFEST.MF
index bb73be802f5..c7738e85bea 100644
--- a/tests/org.eclipse.ui.tests.rcp/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.ui.tests.rcp/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.ui.tests.rcp; singleton:=true
-Bundle-Version: 3.3.100.qualifier
+Bundle-Version: 3.3.200.qualifier
Bundle-ClassPath: rcptests.jar
Bundle-Activator: org.eclipse.core.internal.compatibility.PluginActivator
Bundle-Vendor: %providerName
diff --git a/tests/org.eclipse.ui.tests.rcp/build.properties b/tests/org.eclipse.ui.tests.rcp/build.properties
index c51eb2e0673..5ae693e02ac 100644
--- a/tests/org.eclipse.ui.tests.rcp/build.properties
+++ b/tests/org.eclipse.ui.tests.rcp/build.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2005 IBM Corporation and others.
+# Copyright (c) 2005, 2013 IBM Corporation 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
@@ -10,9 +10,9 @@
###############################################################################
bin.includes = plugin.properties,\
plugin.xml,\
+ test.xml,\
*.html,\
*.jar,\
- *.xml,\
rcptests.jar,\
META-INF/
src.includes = about.html
diff --git a/tests/org.eclipse.ui.tests.rcp/pom.xml b/tests/org.eclipse.ui.tests.rcp/pom.xml
index 3e95b721356..0f7772634f0 100644
--- a/tests/org.eclipse.ui.tests.rcp/pom.xml
+++ b/tests/org.eclipse.ui.tests.rcp/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012 Eclipse Foundation.
+ Copyright (c) 2012, 2013 Eclipse Foundation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
@@ -18,6 +18,6 @@
</parent>
<groupId>org.eclipse.ui</groupId>
<artifactId>org.eclipse.ui.tests.rcp</artifactId>
- <version>3.3.100-SNAPSHOT</version>
+ <version>3.3.200-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>

Back to the top