Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
StarUML Evológica Plugin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
evologica
StarUML Evológica Plugin
Commits
1ad2e8ca
Commit
1ad2e8ca
authored
Oct 21, 2020
by
Jucelino Fonseca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajustes e testes no SynFacilCompletion
parent
224b6f5f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
110 additions
and
32 deletions
+110
-32
ituExplorerV2.pas
EvoUMLPlugin/src/ituExplorerV2.pas
+110
-32
No files found.
EvoUMLPlugin/src/ituExplorerV2.pas
View file @
1ad2e8ca
...
...
@@ -109,6 +109,8 @@ type
procedure
FormDestroy
(
Sender
:
TObject
);
private
{ Private declarations }
fAlias
,
fKeywords
:
TStrings
;
fExecuting
:
Boolean
;
fMetaModel
:
acMetaModel
;
fMetaModelPersistenceMap
:
acMetaModelPersistenceMapSQL
;
...
...
@@ -143,8 +145,11 @@ type
function
FindParcialNodeClass
(
piClassTicketPai
:
acClassTicket
;
piFiltrar
:
boolean
):
acClassTicket
;
//procedure ExecutarSybCompletion(piSynCompletion : TSynCompletion);
procedure
LoadListCompletion
(
piLinha
:
string
;
piAceitaAtributo
:
boolean
;
piLista
:
TStrings
);
procedure
LoadAliasCompletion
(
piLinha
:
string
);
// procedure PreparaSynCompletion;
function
RetirarPalavraChaveOLQ
(
piSynEdit
:
TSynEdit
):
string
;
function
IsKeyword
(
piItem
:
string
):
boolean
;
protected
procedure
CreateParams
(
var
Params
:
TCreateParams
);
override
;
function
Connect
:
acPersistenceSession
;
...
...
@@ -451,8 +456,28 @@ begin
end
;
procedure
TExplorerV2
.
SynEditOQLKeyUp
(
Sender
:
TObject
;
var
Key
:
Word
;
Shift
:
TShiftState
);
var
lmostrar
:
boolean
;
begin
if
not
(
(
Shift
=
[
ssCtrl
])
and
(
Key
=
86
)
)
then
lmostrar
:=
true
;
// Ctrl + Espao
if
(
(
Shift
=
[
ssCtrl
])
and
(
Key
=
86
)
)
then
begin
lmostrar
:=
false
;
end
;
//Espao
if
key
=
32
then
begin
lmostrar
:=
false
;
end
;
//backspace
if
key
=
8
then
begin
lmostrar
:=
false
;
end
;
if
lmostrar
then
begin
fhlt1
.
KeyUp
(
Sender
,
Key
,
Shift
);
end
;
...
...
@@ -801,6 +826,29 @@ begin
end
;
end
;
procedure
TExplorerV2
.
LoadAliasCompletion
(
piLinhas
:
string
);
var
ls_texto
,
ls_espaco
:
string
;
li_Pos
:
integer
;
begin
ls_espaco
:=
' '
;
li_Pos
:=
Pos
(
__FROM
,
uppercase
(
piLinhas
));
if
li_Pos
>
0
then
begin
ls_texto
:=
trim
(
Copy
(
result
,
li_Pos
+
Length
(
__FROM
),
Length
(
piLinhas
)));
li_Pos
:=
Pos
(
ls_espaco
,
trim
(
ls_texto
));
while
li_Pos
>
0
do
begin
result
:=
trim
(
Copy
(
ls_texto
,
li_Pos
+
1
,
Length
(
ls_texto
)));
li_Pos
:=
Pos
(
ls_espaco
,
result
);
end
;
end
;
end
;
{
procedure TExplorerV2.PreparaSynCompletion;
var lAceitaAtributo : boolean;
...
...
@@ -888,6 +936,17 @@ begin
end
;
function
TExplorerV2
.
IsKeyword
(
piItem
:
string
):
boolean
;
var
li_index
:
integer
;
begin
result
:=
false
;
li_index
:=
fKeywords
.
IndexOf
(
piItem
);
if
li_index
>=
0
then
begin
result
:=
true
;
end
;
end
;
procedure
TExplorerV2
.
CreateParams
(
var
Params
:
TCreateParams
);
begin
inherited
CreateParams
(
Params
);
...
...
@@ -907,6 +966,7 @@ var lMetaModelGenOpt: TMetaModelGenerationOptions;
lSelectSec
,
lFromSec
,
lWhereSec
:
TFaSynBlock
;
li
:
integer
;
begin
lMetaModelGenOpt
.
CheckDBAttributeNameLength
:=
true
;
lMetaModelGenOpt
.
CheckDBTableNameLength
:=
true
;
...
...
@@ -916,6 +976,16 @@ begin
FMetaModelPersistenceMap
:=
fUtil
.
MetaModelPersistenceMap
;
MetaModel
:=
fUtil
.
MetaModel
;
fKeywords
:=
TStringList
.
Create
;
fKeywords
.
Add
(
__SELECT
);
fKeywords
.
Add
(
__FROM
);
fKeywords
.
Add
(
__WHERE
);
fKeywords
.
Add
(
'ORDER'
);
fKeywords
.
Add
(
'BY'
);
fKeywords
.
Add
(
'JOIN'
);
fAlias
:=
TStringList
.
Create
;
fhlt1
:=
TSynFacilComplet
.
Create
(
self
);
//my highlighter
//Here the syntax is defined
// ...
...
...
@@ -926,12 +996,11 @@ begin
fhlt1
.
SelectOnEnter
:=
true
;
fhlt1
.
DefTokIdentif
(
'[$A-Za-z_]'
,
'[A-Za-z0-9_]*'
);
fhlt1
.
KeywordAttribute
.
Foreground
:=
clBlue
;
fhlt1
.
AddKeyword
(
'SELECT'
);
fhlt1
.
AddKeyword
(
'FROM'
);
fhlt1
.
AddKeyword
(
'WHERE'
);
fhlt1
.
AddKeyword
(
'ORDER'
);
fhlt1
.
AddKeyword
(
'BY'
);
fhlt1
.
AddKeyword
(
'JOIN'
);
for
li
:=
0
to
fKeywords
.
Count
-
1
do
begin
fhlt1
.
AddKeyword
(
fKeywords
.
Strings
[
li
]);
end
;
lSelectSec
:=
fhlt1
.
AddSection
(
__SELECT
);
lFromSec
:=
fhlt1
.
AddSection
(
__FROM
);
...
...
@@ -988,17 +1057,25 @@ end;
procedure
TExplorerV2
.
FormDestroy
(
Sender
:
TObject
);
begin
fUtil
.
Free
;
fhlt1
.
UnSelectEditor
;
fhlt1
.
Free
;
fKeywords
.
Free
;
fAlias
.
Free
;
end
;
procedure
TExplorerV2
.
opEveLoadItems
(
opEve
:
TFaOpenEvent
;
curEnv
:
TFaCursorEnviron
;
out
Cancel
:
boolean
);
var
lLista
:
TStrings
;
ls_Texto
,
lLinha
:
string
;
lAceitaAtributo
:
boolean
;
li
:
integer
;
begin
opEve
.
ClearAvails
;
lAceitaAtributo
:=
false
;
ls_Texto
:=
SynEditOQL
.
GetWordAtRowCol
(
SynEditOQL
.
CaretXY
);
if
not
IsKeyword
(
ls_Texto
)
then
begin
if
opEve
=
fopEvenWhereAposPonto
then
begin
lAceitaAtributo
:=
true
;
...
...
@@ -1022,6 +1099,7 @@ begin
finally
lLista
.
Free
;
end
;
end
;
Cancel
:=
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment