Author: vyemialyanchyk
Date: 2009-06-11 08:15:09 -0400 (Thu, 11 Jun 2009)
New Revision: 15875
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4446 - Hibernate Criteria Editor - undo/redo
fix
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2009-06-11
12:06:08 UTC (rev 15874)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2009-06-11
12:15:09 UTC (rev 15875)
@@ -39,6 +39,11 @@
import org.eclipse.jface.text.ITextListener;
import org.eclipse.jface.text.TextEvent;
import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
@@ -216,6 +221,25 @@
Control control = parent.getChildren()[1];
control.setLayoutData( new GridData( GridData.FILL_BOTH ) );
+ // the following is needed to make sure the editor area gets focus when editing
after query execution
+ // TODO: find a better way since this is triggered on every mouse click and key
stroke in the editor area
+ // one more remark: without this code -> JBIDE-4446
+ StyledText textWidget = getSourceViewer().getTextWidget();
+ textWidget.addKeyListener(new KeyAdapter() {
+
+ public void keyPressed(KeyEvent e) {
+ getSite().getPage().activate(CriteriaEditor.this);
+ }
+
+ });
+ textWidget.addMouseListener(new MouseAdapter() {
+
+ public void mouseDown(MouseEvent e) {
+ getSite().getPage().activate(CriteriaEditor.this);
+ }
+
+ });
+
}
@Override
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2009-06-11
12:06:08 UTC (rev 15874)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2009-06-11
12:15:09 UTC (rev 15875)
@@ -164,7 +164,8 @@
getSite().getWorkbenchWindow().getWorkbench().getHelpSystem().setHelp( parent,
HELP_CONTEXT_ID );
// the following is needed to make sure the editor area gets focus when editing
after query execution
- // TODO: find a better way since this is triggered on evey mouse click and key
stroke in the editor area
+ // TODO: find a better way since this is triggered on every mouse click and key
stroke in the editor area
+ // one more remark: without this code -> JBIDE-4446
StyledText textWidget = getSourceViewer().getTextWidget();
textWidget.addKeyListener(new KeyAdapter() {