Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2015-04-28 13:01:18 +0000
committerJonah Graham2015-04-28 13:01:18 +0000
commit34503e133eddc09872aaef315a6c9ab03e44f323 (patch)
tree38b62515be3688cf10cd88729563f8f3276a495e /org.eclipse.ui.editors.tests/src
parentb936046a1d0037087c1e87b96597b22cbb16e244 (diff)
downloadeclipse.platform.text-34503e133eddc09872aaef315a6c9ab03e44f323.tar.gz
eclipse.platform.text-34503e133eddc09872aaef315a6c9ab03e44f323.tar.xz
eclipse.platform.text-34503e133eddc09872aaef315a6c9ab03e44f323.zip
Change-Id: I8f79dbf19a4ee9994f545865c499974f0644bd5a Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
Diffstat (limited to 'org.eclipse.ui.editors.tests/src')
-rw-r--r--org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/SegmentedModeTest.java38
1 files changed, 37 insertions, 1 deletions
diff --git a/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/SegmentedModeTest.java b/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/SegmentedModeTest.java
index ec4094d55..b3481fed0 100644
--- a/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/SegmentedModeTest.java
+++ b/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/SegmentedModeTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Jonah Graham (Kichwa Coders) - Bug 465684 - Fix initial setVisibleRegion of 0, 0
*******************************************************************************/
package org.eclipse.ui.editors.tests;
@@ -16,6 +17,7 @@ import junit.framework.TestSuite;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
@@ -99,4 +101,38 @@ public class SegmentedModeTest extends TestCase {
assertTrue(false);
}
}
+
+ /*
+ * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=465684
+ */
+ public void testShowNothing() {
+ IWorkbench workbench= PlatformUI.getWorkbench();
+ IWorkbenchPage page= workbench.getActiveWorkbenchWindow().getActivePage();
+ try {
+ while (Display.getDefault().readAndDispatch()) {
+ }
+ IEditorPart part= IDE.openEditor(page, fFile);
+
+ try {
+ if (part instanceof ITextEditor) {
+ ITextEditor editor= (ITextEditor)part;
+
+ editor.showHighlightRangeOnly(true);
+ editor.setHighlightRange(0, 0, true);
+
+ Control control= (Control)part.getAdapter(Control.class);
+ if (control instanceof StyledText) {
+ StyledText styledText= (StyledText)control;
+ String text= styledText.getText();
+ assertEquals("", text);
+ }
+ }
+ } finally {
+ page.saveEditor(part, false);
+ }
+
+ } catch (PartInitException e) {
+ assertTrue(false);
+ }
+ }
}

Back to the top