aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDawid Pakuła2018-07-26 08:53:24 -0400
committerDawid Pakula2018-08-04 05:50:38 -0400
commit54a9f0b23863d2f5d90ca14ab7ac899abd036928 (patch)
treec9676f96c7d5ccf1949d9bc5fcfa1c095702733a
parent095c543682aebb60d82441f969d20573a22f7bc8 (diff)
downloadorg.eclipse.pdt-54a9f0b23863d2f5d90ca14ab7ac899abd036928.tar.gz
org.eclipse.pdt-54a9f0b23863d2f5d90ca14ab7ac899abd036928.tar.xz
org.eclipse.pdt-54a9f0b23863d2f5d90ca14ab7ac899abd036928.zip
No bug - Drop PHPStructuredEditor outline listeners
Signed-off-by: Dawid Pakuła <zulus@w3des.net>
-rw-r--r--features/org.eclipse.php-feature/feature.xml2
-rw-r--r--plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/PHPStructuredEditor.java43
-rw-r--r--plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/adapter/DOMModelAdapterFactory.java19
-rw-r--r--plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/selectionactions/messages.properties56
4 files changed, 47 insertions, 73 deletions
diff --git a/features/org.eclipse.php-feature/feature.xml b/features/org.eclipse.php-feature/feature.xml
index 5f05e769d..efa09fe7e 100644
--- a/features/org.eclipse.php-feature/feature.xml
+++ b/features/org.eclipse.php-feature/feature.xml
@@ -37,7 +37,7 @@
<import feature="org.eclipse.dltk.core" version="5.9.0" match="greaterOrEqual"/>
<import feature="org.eclipse.dltk.core.index.lucene" version="5.9.0" match="greaterOrEqual"/>
<import feature="org.eclipse.wst.jsdt.feature"/>
- <import feature="org.eclipse.wst.web_ui.feature" version="3.9.0.v201802222200" match="greaterOrEqual"/>
+ <import feature="org.eclipse.wst.web_ui.feature" version="3.11.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.platform" version="4.8.0" match="greaterOrEqual"/>
</requires>
diff --git a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/PHPStructuredEditor.java b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/PHPStructuredEditor.java
index ecfc75cf1..6e8f178b4 100644
--- a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/PHPStructuredEditor.java
+++ b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/PHPStructuredEditor.java
@@ -130,7 +130,6 @@ import org.eclipse.wst.sse.ui.internal.contentoutline.ConfigurableContentOutline
import org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy;
import org.eclipse.wst.sse.ui.internal.reconcile.ReconcileAnnotationKey;
import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
-import org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineConfiguration;
import com.ibm.icu.text.BreakIterator;
@@ -375,33 +374,6 @@ public class PHPStructuredEditor extends StructuredTextEditor {
}
}
- /**
- * Updates the selection in the editor's widget with the selection of the
- * outline page.
- */
- class OutlineSelectionChangedListener extends AbstractSelectionChangedListener implements IDoubleClickListener {
-
- private ContentOutlineConfiguration configuration;
-
- public OutlineSelectionChangedListener(ContentOutlineConfiguration configuration) {
- this.configuration = configuration;
- }
-
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- if (!configuration.isLinkedWithEditor(null)) {
- return;
- }
- doSelectionChanged(event);
- }
-
- @Override
- public void doubleClick(DoubleClickEvent event) {
- doSelectionChanged(event);
- }
-
- }
-
private class ExitPolicy implements IExitPolicy {
final char fExitCharacter;
@@ -1563,14 +1535,6 @@ public class PHPStructuredEditor extends StructuredTextEditor {
}
// some things in the configuration need to clean
// up after themselves
- if (fPHPOutlinePage != null) {
- if (fPHPOutlinePage instanceof ConfigurableContentOutlinePage && fPHPOutlinePageListener != null) {
- ((ConfigurableContentOutlinePage) fPHPOutlinePage).removeDoubleClickListener(fPHPOutlinePageListener);
- }
- if (fPHPOutlinePageListener != null) {
- fPHPOutlinePageListener.uninstall(fPHPOutlinePage);
- }
- }
uninstallOccurrencesFinder();
uninstallOverrideIndicator();
@@ -2707,8 +2671,6 @@ public class PHPStructuredEditor extends StructuredTextEditor {
return null;
}
- OutlineSelectionChangedListener fPHPOutlinePageListener;
-
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class required) {
@@ -2734,11 +2696,6 @@ public class PHPStructuredEditor extends StructuredTextEditor {
if (adapter instanceof ConfigurableContentOutlinePage && IContentOutlinePage.class.equals(required)
&& shouldOutlineViewBeLoaded()) {
final ConfigurableContentOutlinePage outlinePage = (ConfigurableContentOutlinePage) adapter;
- if (fPHPOutlinePageListener == null) {
- fPHPOutlinePageListener = new OutlineSelectionChangedListener(outlinePage.getConfiguration());
- outlinePage.addDoubleClickListener(fPHPOutlinePageListener);
- }
- fPHPOutlinePageListener.install(outlinePage);
fPHPOutlinePage = outlinePage;
outlinePage.setInput(getModelElement());
}
diff --git a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/adapter/DOMModelAdapterFactory.java b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/adapter/DOMModelAdapterFactory.java
index 9a3406198..e6c08f443 100644
--- a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/adapter/DOMModelAdapterFactory.java
+++ b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/adapter/DOMModelAdapterFactory.java
@@ -42,7 +42,7 @@ public class DOMModelAdapterFactory implements IAdapterFactory {
return new Class<?>[] { SelectionConverter.class };
}
- private class PHPSelectionConverter extends SelectionConverter {
+ private static class PHPSelectionConverter extends SelectionConverter {
@Override
public Object[] getElements(IStructuredModel model, int start, int end) {
DOMModelForPHP impl = (DOMModelForPHP) model;
@@ -90,6 +90,23 @@ public class DOMModelAdapterFactory implements IAdapterFactory {
}
return super.getRegion(o);
}
+
+ @Override
+ public IRegion getSelectionRegion(Object o) {
+ if (o instanceof ISourceReference) {
+ ISourceRange sourceRange;
+ try {
+ sourceRange = ((ISourceReference) o).getNameRange();
+ if (sourceRange == null) {
+ sourceRange = ((ISourceReference) o).getSourceRange();
+ }
+ return new Region(sourceRange.getOffset(), sourceRange.getLength());
+ } catch (ModelException e) {
+ Logger.logException(e);
+ }
+ }
+ return super.getRegion(o);
+ }
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/selectionactions/messages.properties b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/selectionactions/messages.properties
index 2c0eb972a..6f1b0ae3e 100644
--- a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/selectionactions/messages.properties
+++ b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/editor/selectionactions/messages.properties
@@ -1,28 +1,28 @@
-StructureSelectEnclosingAction_0=&Enclosing Element
-StructureSelectEnclosingAction_1=Expand Selection to Include Enclosing Element
-StructureSelectEnclosingAction_2=Expand selection to include enclosing element
-StructureSelectEnclosingAction_3=&Enclosing Element
-StructureSelectEnclosingAction_4=Expand Selection to Include Enclosing Element
-StructureSelectEnclosingAction_5=Expand selection to include enclosing element
-StructureSelectHistoryAction_0=&Restore Last Selection
-StructureSelectHistoryAction_1=Restore Last Selection
-StructureSelectHistoryAction_2=Restore last selection
-StructureSelectHistoryAction_3=&Restore Last Selection
-StructureSelectHistoryAction_4=Restore Last Selection
-StructureSelectHistoryAction_5=Restore last selection
-StructureSelectionAction_0=Expand Selection To
-StructureSelectionAction_1=No source code attached to class file. To perform this operation you will need to attach source.
-StructureSelectionAction_5=Expand Selection To
-StructureSelectionAction_6=No source code attached to class file. To perform this operation you will need to attach source.
-StructureSelectNextAction_0=&Next Element
-StructureSelectNextAction_1=Expand Selection to Include Next Sibling
-StructureSelectNextAction_2=Expand selection to include next sibling
-StructureSelectNextAction_3=&Next Element
-StructureSelectNextAction_4=Expand Selection to Include Next Sibling
-StructureSelectNextAction_5=Expand selection to include next sibling
-StructureSelectPreviousAction_0=&Next Element
-StructureSelectPreviousAction_1=Expand Selection to Include Next Sibling
-StructureSelectPreviousAction_2=Expand selection to include next sibling
-StructureSelectPreviousAction_3=&Next Element
-StructureSelectPreviousAction_4=Expand Selection to Include Next Sibling
-StructureSelectPreviousAction_5=Expand selection to include next sibling
+StructureSelectEnclosingAction_0=&Enclosing Element
+StructureSelectEnclosingAction_1=Expand Selection to Include Enclosing Element
+StructureSelectEnclosingAction_2=Expand selection to include enclosing element
+StructureSelectEnclosingAction_3=&Enclosing Element
+StructureSelectEnclosingAction_4=Expand Selection to Include Enclosing Element
+StructureSelectEnclosingAction_5=Expand selection to include enclosing element
+StructureSelectHistoryAction_0=&Restore Last Selection
+StructureSelectHistoryAction_1=Restore Last Selection
+StructureSelectHistoryAction_2=Restore last selection
+StructureSelectHistoryAction_3=&Restore Last Selection
+StructureSelectHistoryAction_4=Restore Last Selection
+StructureSelectHistoryAction_5=Restore last selection
+StructureSelectionAction_0=Expand Selection To
+StructureSelectionAction_1=No source code attached to class file. To perform this operation you will need to attach source.
+StructureSelectionAction_5=Expand Selection To
+StructureSelectionAction_6=No source code attached to class file. To perform this operation you will need to attach source.
+StructureSelectNextAction_0=&Next Element
+StructureSelectNextAction_1=Expand Selection to Include Next Sibling
+StructureSelectNextAction_2=Expand selection to include next sibling
+StructureSelectNextAction_3=&Next Element
+StructureSelectNextAction_4=Expand Selection to Include Next Sibling
+StructureSelectNextAction_5=Expand selection to include next sibling
+StructureSelectPreviousAction_0=&Next Element
+StructureSelectPreviousAction_1=Expand Selection to Include Previous Sibling
+StructureSelectPreviousAction_2=Expand selection to include previous sibling
+StructureSelectPreviousAction_3=&Next Element
+StructureSelectPreviousAction_4=Expand Selection to Include Previous Sibling
+StructureSelectPreviousAction_5=Expand selection to include previous sibling