Commit Graph

305 Commits

Author SHA1 Message Date
hjk
8d74fdd6d4 TextEditor: C++-ify texteditoractionhandler
Macros are not necessary here.

Change-Id: I19e5c38e64f1b7f254c1fcb33d891e02704e3657
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-27 17:06:24 +02:00
hjk
2a5c602341 TextEditor: Introduce some convenience text accessors in the editor
And adjust users.

Change-Id: I9329257cfa5f3298731deb07c2881bc37d9a051d
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-27 15:00:36 +02:00
hjk
7b67701dea TextEditor: Fix failure in cpptools autotest
The issue only appeared in the test due to the different
editor construction there. Now use the same factory access.

Change-Id: I3a8534fbe683bb88f04ad68850cecdfe32b11433
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-27 12:35:32 +02:00
hjk
306ca6fce0 TextEditor: Remove parts of old editor creation sequence
Not used anymore.

Change-Id: Iee0f6340097341bd584ae559e3f40f0c1364cba3
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-26 10:18:23 +02:00
hjk
f9f5fdcf2b TextEditor: Re-organize Plain text editor setup
Change-Id: I202e66a9cd295a85e3eea31177280e2c5d409ced
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-25 15:09:29 +02:00
hjk
4bbf6b63f1 CMakeProjectManager: Use a BaseEditorFactory derived class
Change-Id: Ia5f2b789d82c63552ec7abe5ec22bbc29100a59a
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-25 10:09:30 +02:00
hjk
2b5df11cb8 Android: Use a BaseEditorFactory derived class for JavaEditor
Change-Id: Ifc923177744af5058b22fac7fff2f2345cc99135
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-22 16:21:32 +02:00
hjk
5d41421533 TextEditor: Introduce a BaseTextEditorFactory
The BaseTextEditorFactory will keep a collection of all
relevant creation functions (document, editor, widget,
indenter, syntax highlighter) and will use them to
create or duplicate base text editors in a uniform way.

Change-Id: I255b519e35cf1c28d5e198242f99316951a0235e
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-22 15:17:23 +02:00
hjk
43035981c0 TextEditor: Add a helper function to set up code assistance
This is needed for further refactoring in the cpp and qmljs editors.

Change-Id: Ic25525e5f468e915226e9daa8d118ff76a749e9f
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-22 10:03:01 +02:00
hjk
cc351381ae TextEditor: Replace in-class connection by virtual function
Change-Id: Ifb51606f71100223631d086318c230a478d70712
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-21 09:37:26 +02:00
hjk
1dd05a1855 TextEditor: Prepare new editor construction scheme
IEditorFactory knows how to construct an *Editor, the
Editor knows how to construct the Widget.

Change-Id: I2894e6ae622cb43ef6974aac82505c1f9912ff7b
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-20 14:13:33 +02:00
hjk
cb35594800 TextEditor: Centralize settings connections setup
All editors did that manually, with varying approaches. Connect once
when the document is made known to the EditorWidget instead.

Change-Id: Ib0828b08158539859f6f89c8080435a027aa06ed
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-20 13:28:44 +02:00
hjk
c5fae0e8da TextEditor: Further *Editor/*EditorWidget disentangling
In most cases, the *Editor constructor does not need to
access the *EditorWidget.

Change-Id: I1f5c076a0f723d5d82b398e8c250c7bd1d47eb17
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-19 10:32:12 +02:00
hjk
d2ec7d80d9 TextEditor: Merge the two sets of *EditorWidget constructors
Change-Id: I45d87d0be722ac36d64af222f03f8cb76242c9df
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-19 09:19:33 +02:00
hjk
d7c2b0b681 TextEditor: Consolidate document access functions.
There was document(), textDocument() and baseTextDocument().
Two should be enough...

Change-Id: Id9e41c8d857c5cb3269a9fce5ab594d34448c982
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-08-04 10:43:56 +02:00
hjk
a9b7045803 TextEditor: Move toolbar widgets from *Editor to *Widget
Lifetime is coupled to the widgets, not the editor.

Change-Id: I01560bbdd6c399376d3a4184f0eb83e4153f830e
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-08-01 17:57:26 +02:00
hjk
e947f4ebc2 TextEditor: Move private BaseTextEditor slots to the pimpl
Change-Id: I39ada562d3ef390fee0fee303fb84033c506f41e
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-01 15:27:56 +02:00
hjk
eda0d29160 TextEditor: Make some virtual protected slots private
Not needed otherwise

Change-Id: Ie178ae7c8a5216e351360b45d9c75c8b32dd2a54
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-08-01 14:56:33 +02:00
hjk
f5b0bd32b2 TextEditor: Remove one stack of EditorWidget constructors
There are conceptually only two: one that operates a new document,
and one that shares one. Being explicit makes moving data over to
the Editor hierarchy easier. Convenience can be re-added there,
later.

Change-Id: I9b34ff26628c99ffff01201dcf99332d5e7253e9
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-08-01 14:10:23 +02:00
hjk
98fd59fd09 TextEditor: Start moving data from *EditorWidget to *Editor
Goal is to consolidate "controller" related data in the *Editor hierarchy.
This patch introduces temporary "cross-Private" accessors dd() to
keep the patches small.

First item moved is the AutoCompleter, a glimps at long term benefits
is the simplification in the JavaEditorWidget which is now essentially
a BaseTextEditorWidget, only containing the still-wrong createEditor().
But that can only be move if the *Editors are self-contained, i.e.
keep data themselves, not indirectly through the *EditorWidgets.

Change-Id: Ia0ab90f0322bb17ac20458e6581069eed30acbaf
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-07-31 16:45:31 +02:00
hjk
9fd2fe5a9a TextEditor: Make completion assist provider a data member
In case of the CppEditor a direct member is not possible due
to setup restrictions inside the CppEditor machinery. I'd expect
that to be fixable when the editor base system is in good shape.

Change-Id: I184e219ca2dff6f67c9b58c182212eb12972cc84
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-07-31 12:40:52 +02:00
hjk
f6b48950ed TextEditor: Re-work comment definition handling
No need for most of the machinery.

Change-Id: I9078174582d83da94c6c7f20282fd3a5f1742911
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-07-31 10:54:49 +02:00
hjk
1924fdb90f TextEditor: Merge PlainTextEditor into Base
Same patter. Plain is fully merged now, so remove the files, too.

Change-Id: Id8c0ba5689ad9980a0db3580cb9833344fd911f3
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-07-30 15:17:53 +02:00
hjk
faa0e5b96c TextEditor: Replace PlainTextEditorWidget by Base + a setup function
Change-Id: I91a3bfb66a72e9234ca59f97d5260bbfc3ccb0d3
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-07-30 14:41:09 +02:00
hjk
ce6f3477b5 TextEditor: Move remaining PlainTextEditorWidget functions to Base
Change-Id: Ib10d938fce352f59bcd40f1c6aa493794fe90f8d
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-07-30 14:21:23 +02:00
hjk
fde176e51c TextEditor: Move highlighting support from Plain to Base
Goal is to squash the 'Plain' layer.

Change-Id: I2513de57fbbc09e9d0d9d4f1eb008dced76038f0
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-07-30 14:19:55 +02:00
hjk
78bb9cd525 TextEditor: Pimpl BaseTextEditor
Change-Id: I876025562678513dd8e8c6537783c81aef7cb2aa
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-28 13:50:00 +02:00
hjk
5aa1b50617 TextEditor: Slim down BaseTextEditorWidget interface
By moving some private functions to the pimpl.
Also, re-order some member function declarations.

Change-Id: If8a6c7ae1c27386511a5fa0a92c88a13541c2d94
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-28 12:34:45 +02:00
hjk
adfb30743d TextEditor: Merge BaseTextEditorDocument into BaseTextDocument
That was the only user of that layer of abstraction.

Change-Id: I2bdc4abb8b2b33bfb70398dd11f7ecc4745ddc43
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-28 12:33:47 +02:00
hjk
96d3449acd TextEditor: Remove itexteditor.{h,cpp}
Move the remaining contents to more appropriate places.

Change-Id: I55eed5c572bd33dafe2187523d9aa381c211fdd6
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-25 14:53:11 +02:00
hjk
bf5e43be94 TextEditor: Merge ITextEditor and BaseTextEditor
Adjust all callers, de-export BaseTextEditorAnimator

Change-Id: I2329d976c1398e2449844bb480a4d4ed29859506
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2014-07-25 13:45:55 +02:00
hjk
cd7df865ad Remove ITextMarkable
There was only a single user (TextEditor::DocumentMarker) which
in turn was only used in a single place (BaseTextDocument), so
merge the ITextMarkable into BaseTextDocument.

Change-Id: I1ca8675f9fc22cb56097b843dc5a0fe76875d3e7
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-07-22 11:49:13 +02:00
Christian Kandeler
93304df038 Always pass Core::Id by value.
Currently we pass in some places by value, elsewhere by const ref and
for some weird reason also by const value in a lot of places. The latter
is particularly annoying, as it is also used in interfaces and therefore
forces all implementors to do the same, since leaving the "const" off is
causing compiler warnings with MSVC.

Change-Id: I65b87dc3cce0986b8a55ff6119cb752361027803
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-07-01 11:52:08 +02:00
David Schulz
6e9b724006 Editor: Blockselection rewrite.
Also adding the possibility to insert text into the blockselection.

Task-number: QTCREATORBUG-7773
Change-Id: I7a47a1d630f769a8253ee1a2f21057820ea170d5
Reviewed-by: Lukas Holecek <hluk@email.cz>
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-06-20 13:16:54 +02:00
Orgad Shaneh
04e8b332bb Unify Utils::ChangeSet usages
* Remove using Utils::ChangeSet from header files
* Remove unused typedef for Range
* Add it only in source files that contain many occurrences

Change-Id: I60a8b77e2d5a46431507f53b6d60186d511ccf30
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-06-02 23:48:14 +02:00
David Schulz
714d56a381 Editor: Add actions for view page/line up/down.
Task-number: QTCREATORBUG-4994
Change-Id: Ia6ce1a01cd78dd1987404d77f6b0c0da41b4929e
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-06-02 15:07:35 +02:00
Orgad Shaneh
245c0deb69 TextEditor: Pass some const values by reference
Change-Id: I059ee93d986425ebf6896bfad92845246d351831
Reviewed-by: David Schulz <david.schulz@digia.com>
2014-05-20 11:43:47 +02:00
Wiebe Cazemier
b63d9c6df0 Adds option to make editor not scroll on debugging
Added an option to change the behavior of the debuggercore so that
the current editor isn't always centered on the current line, to stop
unnecessary jumping of the code.

Change-Id: I9406df518bb1b977e39a0265ee7fd6fae2069ed9
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-05-08 15:20:48 +02:00
Eike Ziller
f335da7a75 Editors: Add option to not hide the mouse cursor when typing
Task-number: QTCREATORBUG-3584

Change-Id: Iae5551d36b72c5712f3276b15dfa85982a776dcf
Reviewed-by: David Schulz <david.schulz@digia.com>
2014-02-18 11:53:45 +01:00
Eike Ziller
99dec87406 TextEditors: Generalize update mechanism when editors become visible
Generalizes the special handling of font settings, which should only be
applied (on the document) when an editor is or becomes visible.

Change-Id: Icd1e3ba4355e1ff4a837c9679b537cc3f5ed7ea9
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-02-06 13:14:56 +01:00
Eike Ziller
7e30653f8f TextEditors: Update block revisions only once per document
Instead of once per editor.
Also remove a related unused function.

Change-Id: I4bcd86b9b0ec61b87500e546cf2138ec5d854561
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-29 11:22:44 +01:00
Eike Ziller
3fa6b6737c TextEditors: Move font settings to document
Change-Id: I325764cbaa9684fa2758b0ea6c6ea58de142cb73
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-24 08:00:07 +01:00
Eike Ziller
4eff289e03 TextEditors: Remove widget's setTabSettings method
Change-Id: If212b45e2d526534b7853f3fa23b170f61e1976e
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-01-21 11:22:16 +01:00
Eike Ziller
c06e68c439 TextEditors: Remove tabSettings() from widget
It's part of the document.

Change-Id: I7288b09a0792fdae9c741016594e129f6b21f8e7
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-01-21 10:53:37 +01:00
Eike Ziller
61b0aacb12 TextEditors: Remove unused signal
Change-Id: Iee8d9393b9f203f3a43d7dcc000f4a01d3e3710f
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-16 17:11:42 +01:00
Eike Ziller
3bc4bb3cb9 TextEditors: Move manual (un)indent code to document
Change-Id: I01e93a15b8280a55c31db6be28fe6eb39c7babb0
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-16 15:51:18 +01:00
Eike Ziller
8aedff7f22 TextEditors: Move some auto-indentation code to document
From the editor widget. Also name them autoIndent/autoReindent to
distinguish from the manual indent functions.

Change-Id: I4e1b9d503f53870b669fee66467e5e567eacefec
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-16 15:50:56 +01:00
Eike Ziller
7422b47942 TextEditors: Remove "optimization"
I couldn't find a situation where this code actually resulted in
performance improvement.

Change-Id: I7d905af36ef11dcba43030dc83670c3d1558f650
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-01-16 15:50:26 +01:00
Eike Ziller
3ad3876611 TextEditors: Move indenter to document.
Change-Id: I8bdf7134562d007aa16cc63a34f5a15a708577ae
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-15 15:02:25 +01:00
Eike Ziller
b7ce718d4c TextEditors: Make function static
Change-Id: I4297651458f6efb28a3bbeb83b4c038956d64305
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-01-15 10:44:12 +01:00