Commit d36b4459 authored by Sandro Camata Santana's avatar Sandro Camata Santana

Ajustes para compatibilização Linux
parent 1f872ceb
......@@ -11,9 +11,12 @@ uses
cthreads,
{$ENDIF}{$ENDIF}
SysUtils,
LCLType,
Classes,
Interfaces,
{$IFDEF DARWIN}
CocoaInt,
{$ENDIF}
Forms,
acuObject,
utuMessage,
......@@ -37,12 +40,26 @@ uses
utuXSD in 'utuXSD.pas',
DelphiAddInObj in 'DelphiAddInObj.pas';
type
{ ExceptionCatch }
ExceptionCatch= Class
public
procedure CustomExceptionHandler(Sender: TObject; E: Exception);
end;
exports
InitializeAddIn,
FinalizeAddIn,
DoMenuAction;
{$R *.res}
{ ExceptionCatch }
procedure ExceptionCatch.CustomExceptionHandler(Sender: TObject; E: Exception);
begin
Application.MessageBox(PChar(E.message), 'Error...', MB_ICONERROR or MB_OK);
end;
begin
ChangeLocaleFormatSetting;
......@@ -50,13 +67,18 @@ begin
PersistenceManager.DefaultRepositoryClass := typeOf(acRepositorySQL);
PersistenceManager.RegisterClass(typeOf(acPersistentObject), acPersistentObjectClassFactory.Create);
gSQLDialectManager.RegisterSQLDialect('MS SQL Server', typeOf(acSQLDialectSQLServer), acSQLDialectSQLServerClassFactory.Create);
// gSQLDialectManager.RegisterSQLDialect('Oracle', typeOf(acSQLDialectOracle), acSQLDialectOracleClassFactory.Create);
// gSQLDialectManager.RegisterSQLDialect('DB2', typeOf(acSQLDialectDB2), acSQLDialectDB2ClassFactory.Create);
gSQLDialectManager.RegisterSQLDialect('Oracle', typeOf(acSQLDialectOracle), acSQLDialectOracleClassFactory.Create);
gSQLDialectManager.RegisterSQLDialect('DB2', typeOf(acSQLDialectDB2), acSQLDialectDB2ClassFactory.Create);
gLinksManager.RegisterLink('tcp/ip', typeOf(utLinkSock), utLinkSockClassFactory.Create);
{$IFDEF DARWIN}
MainPool := Nil;
{$ENDIF}
Application.Initialize;
Application.Scaled := True;
Application.OnException := ExceptionCatch.CustomExceptionHandler;
// Application.CaptureExceptions := True;
// ExtensionManager.LoadProfiles;
......
......@@ -3,7 +3,7 @@ unit DelphiAddInObj;
interface
uses
LCLType, IntegracaoDelphiSUML, StarUMLintf, Classes;
LCLType, IntegracaoDelphiSUML, StarUMLintf, cxuSession, Classes;
type
......@@ -40,7 +40,7 @@ type
procedure ListOwnedClasses( piPackage : IUMLPackage ; piObjectList : TInterfaceList ; piStringList : TStringList);
procedure ListOwnedUseCases ( piPackage : IUMLPackage ; piObjectList : TInterfaceList ; piStringList : TStringList);
class function GetServiceConnectionString: string;
class function GetServiceSession: cxSession;
class function DoMenuAction(const ActionID: Integer): Integer;
// function NotifyEvent(AEvent: EventKind): HResult; stdcall;
end;
......@@ -50,7 +50,8 @@ implementation
uses
InstantCode, SysUtils, Mostra_Processamento, utuStateMachine, fCodeGen, Controls, Forms,
fModelMappingsGenerationOptions, fXSDEditor, ituDataBaseLogin, cxuSession, formMemo,
fModelMappingsGenerationOptions, fXSDEditor, ituDataBaseLogin, formMemo,
cxuCadastroClasse, cxuCadastroCasoDeUso,
utuMessage, uCadastroCasoDeUso, uCadastroClasse, ituServiceParameters, ituExplorerV2,
Registry, uRTFEditor, ituXSDExplorer, ituExportUnits, ituOQLExplorerV2;
......@@ -107,7 +108,7 @@ begin
result := gStarUMLApp.SelectionManager.GetSelectedModelAt(0);
end;
class function TDelphiAddInObj.GetServiceConnectionString: string;
class function TDelphiAddInObj.GetServiceSession: cxSession;
var lServiceParamDialog: TitServiceParameters;
lReg: TRegistry;
begin
......@@ -135,13 +136,10 @@ begin
gStarUMLApp.ProjectManager.Project.SetTaggedValueAsInteger('DBMappings', 'ProjectMap', 'SystemCode', lServiceParamDialog.SystemCode);
gStarUMLApp.ProjectManager.Project.SetTaggedValueAsInteger('DBMappings', 'ProjectMap', 'PortNumber', lServiceParamDialog.PortNumber);
result := format('ServerName=%s;PortNumber=%d;SystemCode=%d;UserName=%s;Password=%s;',
[lServiceParamDialog.ServerName, lServiceParamDialog.PortNumber,
lServiceParamDialog.SystemCode, lServiceParamDialog.UserName,
lServiceParamDialog.Password]);
result := lServiceParamDialog.Session;
end
else
result := '';
result := Nil;
finally
lReg.free;
end;
......@@ -177,7 +175,6 @@ begin
on E: Exception do
begin
Application.MessageBox(PAnsiChar(e.Message), 'Staruml', MB_ICONERROR);
raise;
end;
end;
end;
......@@ -274,29 +271,32 @@ end;
class procedure TDelphiAddInObj.ActionMenu_InsertClass;
var lCadClasse: TCadastroClasse;
lConnString: string;
lSession: cxSession;
lCadastroClasseUC: cxCadastroClasse;
lModel: IModel;
lUMLPackageAux: IUMLPackage;
begin
lCadClasse := nil;
lConnString := GetServiceConnectionString;
if lConnString <> '' then
lSession := GetServiceSession;
if Assigned(lSession) then
begin
lModel := gStarUMLApp.SelectionManager.GetSelectedModelAt(0);
lCadastroClasseUC := cxCadastroClasse.Create(lSession);
try
lCadClasse := TCadastroClasse.Create(nil, lCadastroClasseUC, Nil);
try
if lModel.QueryInterface(IUMLPackage, lUMLPackageAux) = S_OK then
begin
lCadClasse := TCadastroClasse.Create(nil, lConnString, Nil);
lCadClasse.ClassPackage := lModel as IUMLPackage;
end
else
begin
lCadClasse := TCadastroClasse.Create(nil, lConnString, Nil);
end;
if lCadClasse.ShowModal = mrok then
gStarUMLApp.SelectInModelExplorer(lCadClasse.UMLClass);
finally
if assigned(lCadClasse) then lCadClasse.Free;
lCadClasse.Free;
end;
finally
lCadastroClasseUC.Free;
end;
end;
end;
......@@ -327,58 +327,66 @@ end;
class procedure TDelphiAddInObj.ActionMenu_EditClass;
var lCadClasse: TCadastroClasse;
lConnString: string;
lSession: cxSession;
lCadastroClasseUC: cxCadastroClasse;
lModel: IModel;
lUMLClassAux: IUMLClass;
begin
lCadClasse := nil;
lConnString := GetServiceConnectionString;
if lConnString <> '' then
begin
lModel := gStarUMLApp.SelectionManager.GetSelectedModelAt(0);
if lModel.QueryInterface(IUMLClass, lUMLClassAux) = S_OK then
begin
lUMLClassAux := lModel as IUMLClass;
lSession := GetServiceSession;
if Assigned(lSession) then
begin
lCadastroClasseUC := cxCadastroClasse.Create(lSession);
try
lCadClasse := TCadastroClasse.Create(nil, lCadastroClasseUC, lUMLClassAux);
try
lCadClasse := TCadastroClasse.Create(nil, lConnString, lUMLClassAux);
if lCadClasse.ShowModal = mrok then
gStarUMLApp.SelectInModelExplorer(lCadClasse.UMLClass);
finally
if assigned(lCadClasse) then lCadClasse.Free;
lCadClasse.Free;
end;
finally
lCadastroClasseUC.Free;
end;
end
else
raise Exception.Create('This option is avaliable only for classes.');
end;
end else raise Exception.Create('This option is avaliable only for classes.');
end;
class procedure TDelphiAddInObj.ActionMenu_EditUseCase;
var lCadCasoDeUso: TCadastroCasoDeUso;
lConnString: string;
lSession: cxSession;
lCadastroCasoUsoUC: cxCadatroCasoDeUso;
lModel: IModel;
lUMLUseCaseAux: IUMLUseCase;
begin
lCadCasoDeUso := nil;
lConnString := GetServiceConnectionString;
if lConnString <> '' then
begin
lModel := gStarUMLApp.SelectionManager.GetSelectedModelAt(0);
try
if lModel.QueryInterface(IUMLUsecase, lUMLUseCaseAux) = S_OK then
begin
lUMLUseCaseAux := lModel as IUMLUsecase;
lCadCasoDeUso := TCadastroCasoDeUso.Create(nil, lConnString, lUMLUseCaseAux);
end
else
raise exception.Create('This option is only avaliable for Usecases.');
lSession := GetServiceSession;
if assigned(lSession) then
begin
lCadastroCasoUsoUC := cxCadatroCasoDeUso.Create(lSession);
try
lCadCasoDeUso := TCadastroCasoDeUso.Create(nil, lCadastroCasoUsoUC, lUMLUseCaseAux);
try
if lCadCasoDeUso.ShowModal = mrok then
gStarUMLApp.SelectInModelExplorer(lCadCasoDeUso.UseCase);
finally
if assigned(lCadCasoDeUso) then lCadCasoDeUso.Free;
lCadCasoDeUso.Free;
end;
finally
lCadastroCasoUsoUC.Free;
end;
end;
end
else raise exception.Create('This option is only avaliable for Usecases.');
end;
class procedure TDelphiAddInObj.ActionMenu_GeneratePreview;
......@@ -616,33 +624,34 @@ end;
class procedure TDelphiAddInObj.ActionMenu_InsertUseCase;
var lCadCasoDeUso: TCadastroCasoDeUso;
lConnString: string;
lSession: cxSession;
lCadastroCasoUsoUC: cxCadatroCasoDeUso;
lModel: IModel;
lUMLPackageAux: IUMLPackage;
begin
lCadCasoDeUso := nil;
lConnString := GetServiceConnectionString;
if lConnString <> '' then
lSession := GetServiceSession;
if assigned(lSession) then
begin
lModel := gStarUMLApp.SelectionManager.GetSelectedModelAt(0);
lCadastroCasoUsoUC := cxCadatroCasoDeUso.Create(lSession);
try
lCadCasoDeUso := TCadastroCasoDeUso.Create(nil, lCadastroCasoUsoUC, Nil);
try
if lModel.QueryInterface(IUMLPackage, lUMLPackageAux) = S_OK then
begin
lCadCasoDeUso := TCadastroCasoDeUso.Create(nil, lConnString, Nil);
lCadCasoDeUso.UseCasePackage := lModel as IUMLPackage;
end
else
begin
lCadCasoDeUso := TCadastroCasoDeUso.Create(nil, lConnString, Nil);
end;
if lCadCasoDeUso.ShowModal = mrok then
gStarUMLApp.SelectInModelExplorer(lCadCasoDeUso.UseCase);
finally
if assigned(lCadCasoDeUso) then lCadCasoDeUso.Free;
end;
finally
lCadastroCasoUsoUC.Free;
end;
end;
end;
......
......@@ -30,11 +30,7 @@
unit InstantTextFiler;
{$IFDEF LINUX}
{$I '../InstantDefines.inc'}
{$ELSE}
{$I 'InstantDefines.inc'}
{$ENDIF}
interface
......
......@@ -118,8 +118,6 @@ type
function GerarBodyStateMachine_CSharp(piModelMappingsOptions: TModelMappingsOptions; piStateMachine: utStateMachine; piUseCaseTicketCode: string; piUnitRegisterMappings: PStringWriter): string;
function GerarBodyStateMachine_Java(piModelMappingsOptions: TModelMappingsOptions; piStateMachine: utStateMachine; piUseCaseTicketCode: string; piUnitRegisterMappings: PStringWriter): string;
function GerarUnitOQL(piXMLFileName: string): string;
procedure SaveUseCaseDiagramJPG(piUseCaseName, piTargetDirectory: string);
procedure SaveAllDiagrams(const piTargetDirectory: string);
......@@ -168,34 +166,40 @@ type
property StarUMLApp: IStarUMLApplication read fStarUMLApp;
end;
function InitializeAddIn(AApplicationHandle: THandle; AStarUMLApplication: TObject): Integer; cdecl;
function FinalizeAddIn: Integer; cdecl;
function DoMenuAction(ActionID: Integer): Integer; cdecl;
function InitializeAddIn(AApplicationHandle: THandle; AStarUMLApplication: TObject): Integer; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
function FinalizeAddIn: Integer; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
function DoMenuAction(ActionID: Integer): Integer; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
var gStarUMLApp: IStarUMLApplication;
implementation
uses dialogs, uDBAttributeParameters, acuUseCaseStateMachine, acuFramework, Forms, DelphiAddInObj,
Controls, strutils, utuMessage, acuOQL, utuXSD, utuOQL, acuModelMapping;
Controls, strutils, utuMessage, utuXSD, acuModelMapping;
function InitializeAddIn(AApplicationHandle: THandle; AStarUMLApplication: TObject): Integer; cdecl;
function InitializeAddIn(AApplicationHandle: THandle; AStarUMLApplication: TObject): Integer; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
begin
// Application.Handle := AApplicationHandle;
if AStarUMLApplication.GetInterface(IID_IStarUMLApplication, gStarUMLApp)
then Result := 0
else Result := -1;
end;
function FinalizeAddIn: Integer; cdecl;
function FinalizeAddIn: Integer; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
begin
Result := 0;
gStarUMLApp := Nil;
end;
function DoMenuAction(ActionID: Integer): Integer; cdecl;
function DoMenuAction(ActionID: Integer): Integer; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
begin
try
Result := TDelphiAddInObj.DoMenuAction(ActionID);
except
on E: Exception do
begin
Application.MessageBox(PAnsiChar(e.Message), 'Error...', MB_ICONERROR);
end;
end;
end;
......@@ -1542,18 +1546,20 @@ begin
try
// Obtm Gerenciador de Projeto do STARUML
lPrjManager := gStarUMLApp.Get_ProjectManager;
// lPrjManager.OpenProject(pFileName);
// Obtm projeto do STARUML de onde sero extrados os elementos UML
lPrj := lPrjManager.Get_Project;
if assigned(lPrj) then
begin
// Meta Modelo do Star UML
lIMetaModel := gStarUMLApp.MetaModel;
//Obtem a classe acPersistentObject do modelo do StarUML
lElement := gStarUMLApp.FindByPathname(MODELO + '::FrameworkModel::acuFrameworkPackage::' + cBASE_PERSISTENT_OBJECT_CLASS);
if not assigned(lElement) then
raise Exception.Create(format('Base class "%s" not found. Try to reopen model.', [cBASE_PERSISTENT_OBJECT_CLASS]));
if assigned(lElement) then
begin
lClassePersistentObject := lElement as IUMLClass;
lLostClasses := TStringList.Create;
......@@ -1566,22 +1572,14 @@ begin
lLostClasses.Free;
end;
// if (lacMetaModel.ClassTickets.Count = 0) then
result := AlimentarMetamodelRegisterMapping(lClassePersistentObject, MetaModel, piMetaModelOptions, piProgress);
// Busca metaclasse UMLMODEL no metamodelo
// lMetaClass := lIMetaModel.FindMetaClass('UMLModel');
// Obtem modelo especfico para geraao de cdigo fonte
// lModel := pStarUMLApp.SelectionManager.GetSelectedModelAt(0) as IUMLModel;
lElement := gStarUMLApp.FindByPathname(MODELO);
lModel := lElement as IUMLModel;
lPackage := lModel as IUMLPackage;
// if (lacMetaModel.RelationTickets.Count = 0) then
result := AlimentarMetamodelRelationsAll(lPackage, MetaModel, piMetaModelOptions, piProgress);
// lElement := pStarUMLApp.FindByPathname(MODELO + '::FrameworkModel::ApplicationFramework::ucSecuredUseCase');
lElement := gStarUMLApp.FindByPathname(MODELO + '::FrameworkModel::acuFrameworkPackage::UCU::ucUseCase');
if not assigned(lElement) then raise Exception.Create('Use case "ucUseCase" not found.');
......@@ -1607,11 +1605,11 @@ begin
lUMLBaseSubmachineState.Submachine := nil;
lElement := nil;
if not piMetaModelOptions.SilentMode then PutMessage(FormatDateTime('hh:nn:ss', Time) + ' - Model mappings generated.', gStarUMLApp.GetProject, 2);
// MetaModel.SetOrder;
end;
end;
finally
end;
end;
function TUtil.AlimentarMetamodelRegisterMapping(poClasseRaiz: IUMLClass; poMetaModel: acMetaModel; piMetaModelOptions: TMetaModelGenerationOptions; piProgress: TFShowProgress): string;
......@@ -2667,242 +2665,6 @@ begin
piUnitRegisterMappings.Outdent();
end;
function TUtil.GerarUnitOQL(piXMLFileName: String): string;
procedure AddText(piStringStream: TStringStream; piIndent: integer = 0; piText: string = '');
begin
piText := StringOfChar(' ', piIndent) + piText;
piStringStream.WriteString(concat(piText,#13#10));
end;
var
lUnit: TStringStream;
lFieldOQLFile, lFieldOQL: utField;
lAux: TStringList;
lOQLName, lOQLQuery: string;
lEnum, lEnumParams: acEnumerator;
lOQLParam: acOQLParam;
// lQuery: acAbstractOQLQuery;
lFileName: string;
lOQLType: integer;
begin
if not FileExists(piXMLFileName) then
raise Exception.Create('File "' + piXMLFileName + '" does not exist');
lUnit := TStringStream.Create('');
try
lFieldOQLFile := utField.Create;
try
lAux := TStringList.Create;
try
lAux.LoadFromFile(piXMLFileName);
lFieldOQLFile.LoadFieldFromXMLString(lAux.Text);
finally
lAux.free;
end;
lFileName := ExtractFileName(piXMLFileName);
lFileName := LeftStr(lFileName, pos('.', lFileName) - 1);
AddText(lUnit, 0, 'unit utu' + lFileName + ';');
AddText(lUnit);
AddText(lUnit, 0, 'interface');
AddText(lUnit);
AddText(lUnit, 0, 'uses acuOQL, acuFramework;');
AddText(lUnit);
AddText(lUnit, 0, 'type');
AddText(lUnit);
lEnum := lFieldOQLFile.GetFieldsEnumerator;
try
//OQL Interfaces
while not lEnum.EOL do
begin
lFieldOQL := utField(lEnum.Current);
if not lFieldOQL.HasAttribute('name') then raise Exception.Create('Attribute "name" not found for OQL. Not a valid XML OQL file.');
lOQLName := lFieldOQL.AttributeByName('name').AsString;
if not lFieldOQL.HasField('query') then raise Exception.Create('Field "query" not found for OQL. Not a valid XML OQL file.');
lOQLQuery := lFieldOQL.FieldByName('query').AsString;
//Default cOQLQuery
lOQLType := cOQLQuery;
if lFieldOQL.HasAttribute('oqltype') then
lOQLType := lFieldOQL.AttributeByName('oqltype').AsInteger;
case lOQLType of
cDataSetOQLDataSet: AddText(lUnit, 2, 'I' + lOQLName + ' = interface(IDataSetOQLQuery)');
else AddText(lUnit, 2, 'I' + lOQLName + ' = interface(IOQLQuery)');
end;
// case lOQLType of
// cDataSetOQLDataSet: lQuery := acDataSetOQLQuery.Create(piSession, lOQLQuery);
// else lQuery := acOQLQuery.Create(piSession, lOQLQuery);
// end;
// try
// lEnumParams := lQuery.Parameters.GetEnumerator;
// try
// while not lEnumParams.EOL do
// begin
// lOQLParam := acOQLParam(lEnumParams.Current);
// AddText(lUnit, 4, 'function Param_' + lOQLParam.Name + ': ' + lOQLParam.ClassName + ';');
// lEnumParams.MoveNext;
// end;
// finally
// lEnumParams.free;
// end;
// AddText(lUnit, 2, 'end;');
// AddText(lUnit);
// finally
// lQuery.Free;
// end;
// lEnum.MoveNext;
end;
//Factory Class Interface
AddText(lUnit, 2, 'ut' + lFileName + ' = class');
lEnum.MoveFirst;
while not lEnum.EOL do
begin
lFieldOQL := utField(lEnum.Current);
lOQLName := lFieldOQL.AttributeByName('name').AsString;
AddText(lUnit, 4, 'class function ' + lOQLName + '(piSessao: acPersistenceSession): ' + 'I' + lOQLName + ';');
lEnum.MoveNext;
end;
AddText(lUnit, 2, 'end;');
AddText(lUnit);
AddText(lUnit, 0, 'implementation');
AddText(lUnit);
AddText(lUnit, 0, 'type');
AddText(lUnit);
//OQL Types
lEnum.MoveFirst;
while not lEnum.EOL do
begin
lFieldOQL := utField(lEnum.Current);
lOQLName := lFieldOQL.AttributeByName('name').AsString;
lOQLQuery := lFieldOQL.FieldByName('query').AsString;
//Default cOQLQuery
lOQLType := cOQLQuery;
if lFieldOQL.HasAttribute('oqltype') then
lOQLType := lFieldOQL.AttributeByName('oqltype').AsInteger;
case lOQLType of
cDataSetOQLDataSet: AddText(lUnit, 2, 'T' + lOQLName + ' = class(acDataSetOQLQuery, ' + 'I' + lOQLName + ')');
else AddText(lUnit, 2, 'T' + lOQLName + ' = class(acOQLQuery, ' + 'I' + lOQLName + ')');
end;
// case lOQLType of
// cDataSetOQLDataSet: lQuery := acDataSetOQLQuery.Create(piSession, lOQLQuery);
// else lQuery := acOQLQuery.Create(piSession, lOQLQuery);
// end;
// try
// lEnumParams := lQuery.Parameters.GetEnumerator;
// try
// while not lEnumParams.EOL do
// begin
// lOQLParam := acOQLParam(lEnumParams.Current);
// AddText(lUnit, 4, 'function Param_' + lOQLParam.Name + ': ' + lOQLParam.ClassName + ';');
// lEnumParams.MoveNext;
// end;
// finally
// lEnumParams.free;
// end;
// AddText(lUnit, 2, 'end;');
// AddText(lUnit);
// finally
// lQuery.Free;
// end;
lEnum.MoveNext;
end;
//OQL Types Implementation
lEnum.MoveFirst;
while not lEnum.EOL do
begin
lFieldOQL := utField(lEnum.Current);
lOQLName := lFieldOQL.AttributeByName('name').AsString;
lOQLQuery := lFieldOQL.FieldByName('query').AsString;
//Default cOQLQuery
lOQLType := cOQLQuery;
if lFieldOQL.HasAttribute('oqltype') then
lOQLType := lFieldOQL.AttributeByName('oqltype').AsInteger;
AddText(lUnit, 0, '{ T' + lOQLName + ' }');
AddText(lUnit);
// case lOQLType of
// cDataSetOQLDataSet: lQuery := acDataSetOQLQuery.Create(piSession, lOQLQuery);
// else lQuery := acOQLQuery.Create(piSession, lOQLQuery);
// end;
// try
// lEnumParams := lQuery.Parameters.GetEnumerator;
// try
// while not lEnumParams.EOL do
// begin
// lOQLParam := acOQLParam(lEnumParams.Current);
// AddText(lUnit, 0, 'function T' + lOQLName + '.Param_' + lOQLParam.Name + ': ' + lOQLParam.ClassName + ';');
// AddText(lUnit, 0,'begin');
// AddText(lUnit, 2,'result := ' + lOQLParam.ClassName + '(Self.ParamByName(' + QuotedStr(lOQLParam.Name) + '));');
// AddText(lUnit, 0,'end;');
// AddText(lUnit);
// lEnumParams.MoveNext;
// end;
// finally
// lEnumParams.free;
// end;
// finally
// lQuery.Free;
// end;
lEnum.MoveNext;
end;
//Factory Class Implementation
AddText(lUnit, 0, '{ utOQLs }');
AddText(lUnit);
lEnum.MoveFirst;
while not lEnum.EOL do
begin
lFieldOQL := utField(lEnum.Current);
lOQLName := lFieldOQL.AttributeByName('name').AsString;
lOQLQuery := lFieldOQL.FieldByName('query').AsString;
AddText(lUnit, 0, 'class function ut' + lFileName + '.' + lOQLName + '(piSessao: acPersistenceSession): I' + lOQLName + ';');
AddText(lUnit, 0, 'begin');
AddText(lUnit, 2, 'result := T' + lOQLName + '.Create(pisessao,');
lOQLQuery := StringReplace(lOQLQuery, '''', '''''', [rfReplaceAll]);
lOQLQuery := StringReplace(lOQLQuery, #13#10, ''' + #13#10 +' + #13#10 + '''', [rfReplaceAll]);
AddText(lUnit, 0, '''' + lOQLQuery + ''');');
AddText(lUnit, 0, 'end;');
AddText(lUnit);
lEnum.MoveNext;
end;
finally
lEnum.free;
end;
AddText(lUnit, 0, 'end.');
result := lUnit.DataString;
finally
lFieldOQLFile.free;
end;
finally
lUnit.free;
end;
end;
procedure TUtil.GerarUnitRegisterModelMappings(piModelMappingsOptions: TModelMappingsOptions; piProgress: TFShowProgress);
const
MAX_UC = 100;
......@@ -5316,7 +5078,7 @@ begin
GerarRelationsPartnerShips(lClassTicket, lInstantCodeClass);
lInstantCodeModule.ImplementationSection.Clear;
lInstantCodeModule.InitializationSection.CodeText := 'PersistenceManager.RegisterClass('+lsNomeClasse+');';
lInstantCodeModule.InitializationSection.CodeText := '// PersistenceManager.RegisterClass(TypeOf('+lsNomeClasse+'));';
result := lInstantCodeModule.AsString;
// end
......
......@@ -10,8 +10,10 @@ object CodeGen: TCodeGen
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
KeyPreview = True
OnShow = FormShow
Position = poDesktopCenter
LCLVersion = '2.0.0.4'
object PageControl1: TPageControl
Left = 0
Height = 616
......@@ -23,26 +25,26 @@ object CodeGen: TCodeGen
TabOrder = 0
object TabSheet1: TTabSheet
Caption = 'UseCase'
ClientHeight = 577
ClientWidth = 883
ClientHeight = 588
ClientWidth = 879
object Panel3: TPanel
Left = 0
Height = 577
Height = 588
Top = 0
Width = 883
Width = 879
Align = alClient
BevelOuter = bvLowered
ClientHeight = 577
ClientWidth = 883
ClientHeight = 588
ClientWidth = 879
TabOrder = 0
object Panel2: TPanel
Left = 1
Height = 452
Height = 463
Top = 124
Width = 280
Align = alLeft
BevelOuter = bvNone
ClientHeight = 452
ClientHeight = 463
ClientWidth = 280
TabOrder = 0
object Panel4: TPanel
......@@ -197,7 +199,7 @@ object CodeGen: TCodeGen
end
object lvUseCases: TListView
Left = 0
Height = 367
Height = 378
Top = 41
Width = 280
Align = alClient
......@@ -205,7 +207,7 @@ object CodeGen: TCodeGen
Columns = <
item
Caption = 'UseCase'
Width = 250
Width = 258
end>
MultiSelect = True
ReadOnly = True
......@@ -218,7 +220,7 @@ object CodeGen: TCodeGen
object Panel13: TPanel
Left = 0
Height = 44
Top = 408
Top = 419
Width = 280
Align = alBottom
BevelInner = bvLowered
......@@ -241,33 +243,33 @@ object CodeGen: TCodeGen
end
object PageControl2: TPageControl
Left = 281
Height = 452
Height = 463
Top = 124
Width = 601
Width = 597
ActivePage = TabSheet2
Align = alClient
TabIndex = 0
TabOrder = 1
object TabSheet2: TTabSheet
Caption = 'Usecase'
ClientHeight = 413
ClientWidth = 595
ClientHeight = 435
ClientWidth = 587
object Panel5: TPanel
Left = 0
Height = 413
Height = 435
Top = 0
Width = 595
Width = 587
Align = alClient
BevelInner = bvLowered
Caption = 'Panel5'
ClientHeight = 413
ClientWidth = 595
ClientHeight = 435
ClientWidth = 587
TabOrder = 0
object Panel6: TPanel
Left = 2
Height = 20
Top = 2
Width = 591
Width = 583
Align = alTop
BevelInner = bvLowered
Caption = 'UseCase code preview'
......@@ -275,9 +277,9 @@ object CodeGen: TCodeGen
end
inline memCode: TSynEdit
Left = 2
Height = 389
Height = 411
Top = 22
Width = 591
Width = 583
Align = alClient
Font.Color = clWindowText
Font.Height = -13
......@@ -355,8 +357,8 @@ object CodeGen: TCodeGen
end
object TabSheet3: TTabSheet
Caption = 'XSD'
ClientHeight = 413
ClientWidth = 595
ClientHeight = 435
ClientWidth = 587
ImageIndex = 1
object lvXSD: TListView
Left = 0
......@@ -404,8 +406,8 @@ object CodeGen: TCodeGen
TabOrder = 1
object TabSheet4: TTabSheet
Caption = 'XSD In'
ClientHeight = 245
ClientWidth = 589
ClientHeight = 280
ClientWidth = 591
inline memXSDIn: TSynEdit
Left = 0
Height = 245
......@@ -487,8 +489,8 @@ object CodeGen: TCodeGen
end
object TabSheet5: TTabSheet
Caption = 'XSD Out'
ClientHeight = 245
ClientWidth = 589
ClientHeight = 280
ClientWidth = 591
ImageIndex = 1
inline memXSDOut: TSynEdit
Left = 0
......@@ -576,27 +578,27 @@ object CodeGen: TCodeGen
Left = 1
Height = 123
Top = 1
Width = 881
Width = 877
ActivePage = TabSheet7
Align = alTop
TabIndex = 0
TabOrder = 2
object TabSheet7: TTabSheet
Caption = 'General'
ClientHeight = 84
ClientWidth = 875
ClientHeight = 95
ClientWidth = 867
object Panel1: TPanel
Left = 0
Height = 84
Height = 95
Top = 0
Width = 875
Width = 867
Align = alClient
Caption = 'General'
ClientHeight = 84
ClientWidth = 875
ClientHeight = 95
ClientWidth = 867
TabOrder = 0
object SpeedButton6: TSpeedButton
Left = 768
Left = 761
Height = 71
Top = 15
Width = 100
......@@ -837,8 +839,8 @@ object CodeGen: TCodeGen
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 67
ClientWidth = 87
ClientHeight = 69
ClientWidth = 93
ItemIndex = 0
Items.Strings = (
'Server'
......@@ -861,8 +863,8 @@ object CodeGen: TCodeGen
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 67
ClientWidth = 90
ClientHeight = 69
ClientWidth = 96
ItemIndex = 0
Items.Strings = (
'Delphi'
......@@ -878,8 +880,8 @@ object CodeGen: TCodeGen
Top = 7
Width = 537
Caption = 'Output directory'
ClientHeight = 67
ClientWidth = 529
ClientHeight = 69
ClientWidth = 535
TabOrder = 2
object SpeedButton5: TSpeedButton
Left = 503
......@@ -919,7 +921,7 @@ object CodeGen: TCodeGen
end
object edtDirectory: TEdit
Left = 10
Height = 22
Height = 31
Top = 33
Width = 487
TabOrder = 0
......@@ -929,8 +931,8 @@ object CodeGen: TCodeGen
end
object Options: TTabSheet
Caption = 'Options'
ClientHeight = 97
ClientWidth = 871
ClientHeight = 95
ClientWidth = 867
ImageIndex = 1
object Panel9: TPanel
Left = 380
......@@ -953,8 +955,8 @@ object CodeGen: TCodeGen
TabOrder = 0
object TabSheet8: TTabSheet
Caption = 'Java'
ClientHeight = 54
ClientWidth = 481
ClientHeight = 89
ClientWidth = 483
object Label1: TLabel
Left = 10
Height = 13
......@@ -1012,8 +1014,8 @@ object CodeGen: TCodeGen
end
object TabSheet6: TTabSheet
Caption = 'SQL'
ClientHeight = 590
ClientWidth = 881
ClientHeight = 588
ClientWidth = 879
ImageIndex = 1
object PageControl5: TPageControl
Left = 0
......@@ -1026,8 +1028,8 @@ object CodeGen: TCodeGen
TabOrder = 0
object TabSheet9: TTabSheet
Caption = 'SQL Server'
ClientHeight = 551
ClientWidth = 875
ClientHeight = 586
ClientWidth = 877
object Panel7: TPanel
Left = 0
Height = 564
......@@ -1035,8 +1037,8 @@ object CodeGen: TCodeGen
Width = 873
Align = alClient
BevelOuter = bvLowered
ClientHeight = 564
ClientWidth = 873
ClientHeight = 560
ClientWidth = 869
TabOrder = 0
object Panel8: TPanel
Left = 1
......@@ -1044,8 +1046,8 @@ object CodeGen: TCodeGen
Top = 1
Width = 871
Align = alTop
ClientHeight = 40
ClientWidth = 871
ClientHeight = 36
ClientWidth = 867
TabOrder = 0
object SpeedButton4: TSpeedButton
Left = 9
......@@ -1138,8 +1140,8 @@ object CodeGen: TCodeGen
end
object TabSheet10: TTabSheet
Caption = 'Oracle'
ClientHeight = 564
ClientWidth = 873
ClientHeight = 586
ClientWidth = 877
ImageIndex = 1
object Panel11: TPanel
Left = 0
......@@ -1148,8 +1150,8 @@ object CodeGen: TCodeGen
Width = 873
Align = alClient
BevelOuter = bvLowered
ClientHeight = 564
ClientWidth = 873
ClientHeight = 560
ClientWidth = 869
TabOrder = 0
object Panel12: TPanel
Left = 1
......@@ -1157,8 +1159,8 @@ object CodeGen: TCodeGen
Top = 1
Width = 871
Align = alTop
ClientHeight = 40
ClientWidth = 871
ClientHeight = 36
ClientWidth = 867
TabOrder = 0
object SpeedButton7: TSpeedButton
Left = 9
......@@ -1251,8 +1253,8 @@ object CodeGen: TCodeGen
end
object TabSheet11: TTabSheet
Caption = 'DB2'
ClientHeight = 564
ClientWidth = 873
ClientHeight = 586
ClientWidth = 877
ImageIndex = 2
object Panel14: TPanel
Left = 0
......@@ -1261,8 +1263,8 @@ object CodeGen: TCodeGen
Width = 873
Align = alClient
BevelOuter = bvLowered
ClientHeight = 564
ClientWidth = 873
ClientHeight = 560
ClientWidth = 869
TabOrder = 0
object Panel15: TPanel
Left = 1
......@@ -1270,8 +1272,8 @@ object CodeGen: TCodeGen
Top = 1
Width = 871
Align = alTop
ClientHeight = 40
ClientWidth = 871
ClientHeight = 36
ClientWidth = 867
TabOrder = 0
object SpeedButton8: TSpeedButton
Left = 9
......
object PreviewClassCode: TPreviewClassCode
Left = 0
Height = 573
Top = 0
Width = 799
Left = 2149
Height = 580
Top = 247
Width = 803
Caption = 'Preview Class Code'
ClientHeight = 573
ClientWidth = 799
ClientHeight = 580
ClientWidth = 803
Color = clBtnFace
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
KeyPreview = True
Position = poScreenCenter
LCLVersion = '2.0.0.4'
object Panel2: TPanel
Left = 0
Height = 573
Height = 580
Top = 0
Width = 799
Width = 803
Align = alClient
BevelOuter = bvLowered
ClientHeight = 573
ClientWidth = 799
ClientHeight = 580
ClientWidth = 803
TabOrder = 0
object Panel1: TPanel
Left = 1
Height = 40
Top = 1
Width = 797
Width = 801
Align = alTop
ClientHeight = 40
ClientWidth = 797
ClientWidth = 801
TabOrder = 0
object Button1: TButton
Left = 12
......@@ -42,9 +44,9 @@ object PreviewClassCode: TPreviewClassCode
end
object pgc_Main: TPageControl
Left = 1
Height = 531
Height = 538
Top = 41
Width = 797
Width = 801
ActivePage = TabSheet1
Align = alClient
ShowTabs = False
......@@ -52,45 +54,476 @@ object PreviewClassCode: TPreviewClassCode
TabOrder = 1
object TabSheet1: TTabSheet
Caption = 'Class Preview'
ClientHeight = 524
ClientWidth = 789
ClientHeight = 534
ClientWidth = 791
object pgc_ClassCode: TPageControl
Left = 0
Height = 524
Height = 534
Top = 0
Width = 789
Width = 791
ActivePage = TabSheet3
Align = alClient
TabIndex = 0
TabOrder = 0
object TabSheet3: TTabSheet
Caption = 'Delphi'
ClientHeight = 485
ClientWidth = 783
Caption = 'ObjPascal'
ClientHeight = 506
ClientWidth = 781
inline mem_ClassPascal: TSynEdit
Left = 0
Height = 485
Height = 506
Top = 0
Width = 783
Width = 781
Align = alClient
Color = clWindow
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Courier New'
Font.Height = 13
Font.Name = 'DejaVu Sans Mono'
Font.Pitch = fpFixed
Font.Quality = fqNonAntialiased
ParentColor = False
ParentFont = False
TabOrder = 0
Gutter.Width = 57
BorderStyle = bsNone
Gutter.Width = 23
Gutter.MouseActions = <>
RightGutter.Width = 0
RightGutter.MouseActions = <>
Keystrokes = <>
Highlighter = SynFreePascalSyn1
Keystrokes = <
item
Command = ecUp
ShortCut = 38
end
item
Command = ecSelUp
ShortCut = 8230
end
item
Command = ecScrollUp
ShortCut = 16422
end
item
Command = ecDown
ShortCut = 40
end
item
Command = ecSelDown
ShortCut = 8232
end
item
Command = ecScrollDown
ShortCut = 16424
end
item
Command = ecLeft
ShortCut = 37
end
item
Command = ecSelLeft
ShortCut = 8229
end
item
Command = ecWordLeft
ShortCut = 16421
end
item
Command = ecSelWordLeft
ShortCut = 24613
end
item
Command = ecRight
ShortCut = 39
end
item
Command = ecSelRight
ShortCut = 8231
end
item
Command = ecWordRight
ShortCut = 16423
end
item
Command = ecSelWordRight
ShortCut = 24615
end
item
Command = ecPageDown
ShortCut = 34
end
item
Command = ecSelPageDown
ShortCut = 8226
end
item
Command = ecPageBottom
ShortCut = 16418
end
item
Command = ecSelPageBottom
ShortCut = 24610
end
item
Command = ecPageUp
ShortCut = 33
end
item
Command = ecSelPageUp
ShortCut = 8225
end
item
Command = ecPageTop
ShortCut = 16417
end
item
Command = ecSelPageTop
ShortCut = 24609
end
item
Command = ecLineStart
ShortCut = 36
end
item
Command = ecSelLineStart
ShortCut = 8228
end
item
Command = ecEditorTop
ShortCut = 16420
end
item
Command = ecSelEditorTop
ShortCut = 24612
end
item
Command = ecLineEnd
ShortCut = 35
end
item
Command = ecSelLineEnd
ShortCut = 8227
end
item
Command = ecEditorBottom
ShortCut = 16419
end
item
Command = ecSelEditorBottom
ShortCut = 24611
end
item
Command = ecToggleMode
ShortCut = 45
end
item
Command = ecCopy
ShortCut = 16429
end
item
Command = ecPaste
ShortCut = 8237
end
item
Command = ecDeleteChar
ShortCut = 46
end
item
Command = ecCut
ShortCut = 8238
end
item
Command = ecDeleteLastChar
ShortCut = 8
end
item
Command = ecDeleteLastChar
ShortCut = 8200
end
item
Command = ecDeleteLastWord
ShortCut = 16392
end
item
Command = ecUndo
ShortCut = 32776
end
item
Command = ecRedo
ShortCut = 40968
end
item
Command = ecLineBreak
ShortCut = 13
end
item
Command = ecSelectAll
ShortCut = 16449
end
item
Command = ecCopy
ShortCut = 16451
end
item
Command = ecBlockIndent
ShortCut = 24649
end
item
Command = ecLineBreak
ShortCut = 16461
end
item
Command = ecInsertLine
ShortCut = 16462
end
item
Command = ecDeleteWord
ShortCut = 16468
end
item
Command = ecBlockUnindent
ShortCut = 24661
end
item
Command = ecPaste
ShortCut = 16470
end
item
Command = ecCut
ShortCut = 16472
end
item
Command = ecDeleteLine
ShortCut = 16473
end
item
Command = ecDeleteEOL
ShortCut = 24665
end
item
Command = ecUndo
ShortCut = 16474
end
item
Command = ecRedo
ShortCut = 24666
end
item
Command = ecGotoMarker0
ShortCut = 16432
end
item
Command = ecGotoMarker1
ShortCut = 16433
end
item
Command = ecGotoMarker2
ShortCut = 16434
end
item
Command = ecGotoMarker3
ShortCut = 16435
end
item
Command = ecGotoMarker4
ShortCut = 16436
end
item
Command = ecGotoMarker5
ShortCut = 16437
end
item
Command = ecGotoMarker6
ShortCut = 16438
end
item
Command = ecGotoMarker7
ShortCut = 16439
end
item
Command = ecGotoMarker8
ShortCut = 16440
end
item
Command = ecGotoMarker9
ShortCut = 16441
end
item
Command = ecSetMarker0
ShortCut = 24624
end
item
Command = ecSetMarker1
ShortCut = 24625
end
item
Command = ecSetMarker2
ShortCut = 24626
end
item
Command = ecSetMarker3
ShortCut = 24627
end
item
Command = ecSetMarker4
ShortCut = 24628
end
item
Command = ecSetMarker5
ShortCut = 24629
end
item
Command = ecSetMarker6
ShortCut = 24630
end
item
Command = ecSetMarker7
ShortCut = 24631
end
item
Command = ecSetMarker8
ShortCut = 24632
end
item
Command = ecSetMarker9
ShortCut = 24633
end
item
Command = EcFoldLevel1
ShortCut = 41009
end
item
Command = EcFoldLevel2
ShortCut = 41010
end
item
Command = EcFoldLevel3
ShortCut = 41011
end
item
Command = EcFoldLevel4
ShortCut = 41012
end
item
Command = EcFoldLevel5
ShortCut = 41013
end
item
Command = EcFoldLevel6
ShortCut = 41014
end
item
Command = EcFoldLevel7
ShortCut = 41015
end
item
Command = EcFoldLevel8
ShortCut = 41016
end
item
Command = EcFoldLevel9
ShortCut = 41017
end
item
Command = EcFoldLevel0
ShortCut = 41008
end
item
Command = EcFoldCurrent
ShortCut = 41005
end
item
Command = EcUnFoldCurrent
ShortCut = 41003
end
item
Command = EcToggleMarkupWord
ShortCut = 32845
end
item
Command = ecNormalSelect
ShortCut = 24654
end
item
Command = ecColumnSelect
ShortCut = 24643
end
item
Command = ecLineSelect
ShortCut = 24652
end
item
Command = ecTab
ShortCut = 9
end
item
Command = ecShiftTab
ShortCut = 8201
end
item
Command = ecMatchBracket
ShortCut = 24642
end
item
Command = ecColSelUp
ShortCut = 40998
end
item
Command = ecColSelDown
ShortCut = 41000
end
item
Command = ecColSelLeft
ShortCut = 40997
end
item
Command = ecColSelRight
ShortCut = 40999
end
item
Command = ecColSelPageDown
ShortCut = 40994
end
item
Command = ecColSelPageBottom
ShortCut = 57378
end
item
Command = ecColSelPageUp
ShortCut = 40993
end
item
Command = ecColSelPageTop
ShortCut = 57377
end
item
Command = ecColSelLineStart
ShortCut = 40996
end
item
Command = ecColSelLineEnd
ShortCut = 40995
end
item
Command = ecColSelEditorTop
ShortCut = 57380
end
item
Command = ecColSelEditorBottom
ShortCut = 57379
end>
MouseActions = <>
MouseTextActions = <>
MouseSelActions = <>
Lines.Strings = (
''
)
Options = [eoAutoIndent, eoBracketHighlight, eoEnhanceHomeKey, eoGroupUndo, eoHalfPageScroll, eoHideRightMargin, eoSmartTabs, eoTabsToSpaces, eoTrimTrailingSpaces, eoAltSetsColumnMode]
Options2 = [eoEnhanceEndKey, eoFoldedCopyPaste, eoOverwriteBlock, eoColorSelectionTillEol]
MouseOptions = [emAltSetsColumnMode, emCtrlWheelZoom]
VisibleSpecialChars = [vscSpace, vscTabAtLast]
ReadOnly = True
RightEdge = 0
ScrollBars = ssAutoBoth
SelectedColor.BackPriority = 50
SelectedColor.ForePriority = 50
SelectedColor.FramePriority = 50
......@@ -112,6 +545,7 @@ object PreviewClassCode: TPreviewClassCode
inline SynLeftGutterPartList1: TSynGutterPartList
object SynGutterMarks1: TSynGutterMarks
Width = 24
Visible = False
MouseActions = <>
end
object SynGutterLineNumber1: TSynGutterLineNumber
......@@ -137,6 +571,7 @@ object PreviewClassCode: TPreviewClassCode
MarkupInfo.Foreground = clGray
end
object SynGutterCodeFolding1: TSynGutterCodeFolding
Visible = False
MouseActions = <>
MarkupInfo.Background = clNone
MarkupInfo.Foreground = clGray
......@@ -148,15 +583,16 @@ object PreviewClassCode: TPreviewClassCode
end
object TabSheet4: TTabSheet
Caption = 'Java'
ClientHeight = 453
ClientWidth = 785
ClientHeight = 506
ClientWidth = 781
ImageIndex = 1
inline mem_ClassJava: TSynEdit
Left = 0
Height = 453
Height = 506
Top = 0
Width = 785
Width = 781
Align = alClient
Color = clWindow
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Courier New'
......@@ -165,16 +601,446 @@ object PreviewClassCode: TPreviewClassCode
ParentColor = False
ParentFont = False
TabOrder = 0
Gutter.Width = 57
BorderStyle = bsNone
Gutter.Width = 23
Gutter.MouseActions = <>
RightGutter.Width = 0
RightGutter.MouseActions = <>
Keystrokes = <>
Highlighter = SynJavaSyn1
Keystrokes = <
item
Command = ecUp
ShortCut = 38
end
item
Command = ecSelUp
ShortCut = 8230
end
item
Command = ecScrollUp
ShortCut = 16422
end
item
Command = ecDown
ShortCut = 40
end
item
Command = ecSelDown
ShortCut = 8232
end
item
Command = ecScrollDown
ShortCut = 16424
end
item
Command = ecLeft
ShortCut = 37
end
item
Command = ecSelLeft
ShortCut = 8229
end
item
Command = ecWordLeft
ShortCut = 16421
end
item
Command = ecSelWordLeft
ShortCut = 24613
end
item
Command = ecRight
ShortCut = 39
end
item
Command = ecSelRight
ShortCut = 8231
end
item
Command = ecWordRight
ShortCut = 16423
end
item
Command = ecSelWordRight
ShortCut = 24615
end
item
Command = ecPageDown
ShortCut = 34
end
item
Command = ecSelPageDown
ShortCut = 8226
end
item
Command = ecPageBottom
ShortCut = 16418
end
item
Command = ecSelPageBottom
ShortCut = 24610
end
item
Command = ecPageUp
ShortCut = 33
end
item
Command = ecSelPageUp
ShortCut = 8225
end
item
Command = ecPageTop
ShortCut = 16417
end
item
Command = ecSelPageTop
ShortCut = 24609
end
item
Command = ecLineStart
ShortCut = 36
end
item
Command = ecSelLineStart
ShortCut = 8228
end
item
Command = ecEditorTop
ShortCut = 16420
end
item
Command = ecSelEditorTop
ShortCut = 24612
end
item
Command = ecLineEnd
ShortCut = 35
end
item
Command = ecSelLineEnd
ShortCut = 8227
end
item
Command = ecEditorBottom
ShortCut = 16419
end
item
Command = ecSelEditorBottom
ShortCut = 24611
end
item
Command = ecToggleMode
ShortCut = 45
end
item
Command = ecCopy
ShortCut = 16429
end
item
Command = ecPaste
ShortCut = 8237
end
item
Command = ecDeleteChar
ShortCut = 46
end
item
Command = ecCut
ShortCut = 8238
end
item
Command = ecDeleteLastChar
ShortCut = 8
end
item
Command = ecDeleteLastChar
ShortCut = 8200
end
item
Command = ecDeleteLastWord
ShortCut = 16392
end
item
Command = ecUndo
ShortCut = 32776
end
item
Command = ecRedo
ShortCut = 40968
end
item
Command = ecLineBreak
ShortCut = 13
end
item
Command = ecSelectAll
ShortCut = 16449
end
item
Command = ecCopy
ShortCut = 16451
end
item
Command = ecBlockIndent
ShortCut = 24649
end
item
Command = ecLineBreak
ShortCut = 16461
end
item
Command = ecInsertLine
ShortCut = 16462
end
item
Command = ecDeleteWord
ShortCut = 16468
end
item
Command = ecBlockUnindent
ShortCut = 24661
end
item
Command = ecPaste
ShortCut = 16470
end
item
Command = ecCut
ShortCut = 16472
end
item
Command = ecDeleteLine
ShortCut = 16473
end
item
Command = ecDeleteEOL
ShortCut = 24665
end
item
Command = ecUndo
ShortCut = 16474
end
item
Command = ecRedo
ShortCut = 24666
end
item
Command = ecGotoMarker0
ShortCut = 16432
end
item
Command = ecGotoMarker1
ShortCut = 16433
end
item
Command = ecGotoMarker2
ShortCut = 16434
end
item
Command = ecGotoMarker3
ShortCut = 16435
end
item
Command = ecGotoMarker4
ShortCut = 16436
end
item
Command = ecGotoMarker5
ShortCut = 16437
end
item
Command = ecGotoMarker6
ShortCut = 16438
end
item
Command = ecGotoMarker7
ShortCut = 16439
end
item
Command = ecGotoMarker8
ShortCut = 16440
end
item
Command = ecGotoMarker9
ShortCut = 16441
end
item
Command = ecSetMarker0
ShortCut = 24624
end
item
Command = ecSetMarker1
ShortCut = 24625
end
item
Command = ecSetMarker2
ShortCut = 24626
end
item
Command = ecSetMarker3
ShortCut = 24627
end
item
Command = ecSetMarker4
ShortCut = 24628
end
item
Command = ecSetMarker5
ShortCut = 24629
end
item
Command = ecSetMarker6
ShortCut = 24630
end
item
Command = ecSetMarker7
ShortCut = 24631
end
item
Command = ecSetMarker8
ShortCut = 24632
end
item
Command = ecSetMarker9
ShortCut = 24633
end
item
Command = EcFoldLevel1
ShortCut = 41009
end
item
Command = EcFoldLevel2
ShortCut = 41010
end
item
Command = EcFoldLevel3
ShortCut = 41011
end
item
Command = EcFoldLevel4
ShortCut = 41012
end
item
Command = EcFoldLevel5
ShortCut = 41013
end
item
Command = EcFoldLevel6
ShortCut = 41014
end
item
Command = EcFoldLevel7
ShortCut = 41015
end
item
Command = EcFoldLevel8
ShortCut = 41016
end
item
Command = EcFoldLevel9
ShortCut = 41017
end
item
Command = EcFoldLevel0
ShortCut = 41008
end
item
Command = EcFoldCurrent
ShortCut = 41005
end
item
Command = EcUnFoldCurrent
ShortCut = 41003
end
item
Command = EcToggleMarkupWord
ShortCut = 32845
end
item
Command = ecNormalSelect
ShortCut = 24654
end
item
Command = ecColumnSelect
ShortCut = 24643
end
item
Command = ecLineSelect
ShortCut = 24652
end
item
Command = ecTab
ShortCut = 9
end
item
Command = ecShiftTab
ShortCut = 8201
end
item
Command = ecMatchBracket
ShortCut = 24642
end
item
Command = ecColSelUp
ShortCut = 40998
end
item
Command = ecColSelDown
ShortCut = 41000
end
item
Command = ecColSelLeft
ShortCut = 40997
end
item
Command = ecColSelRight
ShortCut = 40999
end
item
Command = ecColSelPageDown
ShortCut = 40994
end
item
Command = ecColSelPageBottom
ShortCut = 57378
end
item
Command = ecColSelPageUp
ShortCut = 40993
end
item
Command = ecColSelPageTop
ShortCut = 57377
end
item
Command = ecColSelLineStart
ShortCut = 40996
end
item
Command = ecColSelLineEnd
ShortCut = 40995
end
item
Command = ecColSelEditorTop
ShortCut = 57380
end
item
Command = ecColSelEditorBottom
ShortCut = 57379
end>
MouseActions = <>
MouseTextActions = <>
MouseSelActions = <>
Lines.Strings = (
''
)
Options = [eoAutoIndent, eoBracketHighlight, eoEnhanceHomeKey, eoGroupUndo, eoHalfPageScroll, eoHideRightMargin, eoSmartTabs, eoTabsToSpaces, eoTrimTrailingSpaces, eoAltSetsColumnMode]
Options2 = [eoEnhanceEndKey, eoFoldedCopyPaste, eoOverwriteBlock, eoColorSelectionTillEol]
MouseOptions = [emAltSetsColumnMode, emCtrlWheelZoom]
VisibleSpecialChars = [vscSpace, vscTabAtLast]
ReadOnly = True
RightEdge = 0
ScrollBars = ssAutoBoth
SelectedColor.BackPriority = 50
SelectedColor.ForePriority = 50
SelectedColor.FramePriority = 50
......@@ -196,69 +1062,502 @@ object PreviewClassCode: TPreviewClassCode
inline SynLeftGutterPartList1: TSynGutterPartList
object SynGutterMarks1: TSynGutterMarks
Width = 24
Visible = False
MouseActions = <>
end
object SynGutterLineNumber1: TSynGutterLineNumber
Width = 17
MouseActions = <>
MarkupInfo.Background = clBtnFace
MarkupInfo.Foreground = clNone
DigitCount = 2
ShowOnlyLineNumbersMultiplesOf = 1
ZeroStart = False
LeadingZeros = False
end
object SynGutterChanges1: TSynGutterChanges
Width = 4
MouseActions = <>
ModifiedColor = 59900
SavedColor = clGreen
end
object SynGutterSeparator1: TSynGutterSeparator
Width = 2
MouseActions = <>
MarkupInfo.Background = clWhite
MarkupInfo.Foreground = clGray
end
object SynGutterCodeFolding1: TSynGutterCodeFolding
Visible = False
MouseActions = <>
MarkupInfo.Background = clNone
MarkupInfo.Foreground = clGray
MouseActionsExpanded = <>
MouseActionsCollapsed = <>
end
end
end
end
object TabSheet5: TTabSheet
Caption = 'C#'
ClientHeight = 506
ClientWidth = 781
ImageIndex = 2
inline mem_ClassCSharp: TSynEdit
Left = 0
Height = 506
Top = 0
Width = 781
Align = alClient
Color = clWindow
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Courier New'
Font.Pitch = fpFixed
Font.Quality = fqNonAntialiased
ParentColor = False
ParentFont = False
TabOrder = 0
BorderStyle = bsNone
Gutter.Width = 23
Gutter.MouseActions = <>
RightGutter.Width = 0
RightGutter.MouseActions = <>
Highlighter = SynFreePascalSyn1
Keystrokes = <
item
Command = ecUp
ShortCut = 38
end
item
Command = ecSelUp
ShortCut = 8230
end
item
Command = ecScrollUp
ShortCut = 16422
end
item
Command = ecDown
ShortCut = 40
end
item
Command = ecSelDown
ShortCut = 8232
end
item
Command = ecScrollDown
ShortCut = 16424
end
item
Command = ecLeft
ShortCut = 37
end
item
Command = ecSelLeft
ShortCut = 8229
end
item
Command = ecWordLeft
ShortCut = 16421
end
item
Command = ecSelWordLeft
ShortCut = 24613
end
item
Command = ecRight
ShortCut = 39
end
item
Command = ecSelRight
ShortCut = 8231
end
item
Command = ecWordRight
ShortCut = 16423
end
item
Command = ecSelWordRight
ShortCut = 24615
end
item
Command = ecPageDown
ShortCut = 34
end
item
Command = ecSelPageDown
ShortCut = 8226
end
item
Command = ecPageBottom
ShortCut = 16418
end
item
Command = ecSelPageBottom
ShortCut = 24610
end
item
Command = ecPageUp
ShortCut = 33
end
item
Command = ecSelPageUp
ShortCut = 8225
end
item
Command = ecPageTop
ShortCut = 16417
end
item
Command = ecSelPageTop
ShortCut = 24609
end
item
Command = ecLineStart
ShortCut = 36
end
item
Command = ecSelLineStart
ShortCut = 8228
end
item
Command = ecEditorTop
ShortCut = 16420
end
item
Command = ecSelEditorTop
ShortCut = 24612
end
item
Command = ecLineEnd
ShortCut = 35
end
item
Command = ecSelLineEnd
ShortCut = 8227
end
item
Command = ecEditorBottom
ShortCut = 16419
end
item
Command = ecSelEditorBottom
ShortCut = 24611
end
item
Command = ecToggleMode
ShortCut = 45
end
item
Command = ecCopy
ShortCut = 16429
end
item
Command = ecPaste
ShortCut = 8237
end
item
Command = ecDeleteChar
ShortCut = 46
end
item
Command = ecCut
ShortCut = 8238
end
item
Command = ecDeleteLastChar
ShortCut = 8
end
item
Command = ecDeleteLastChar
ShortCut = 8200
end
item
Command = ecDeleteLastWord
ShortCut = 16392
end
item
Command = ecUndo
ShortCut = 32776
end
item
Command = ecRedo
ShortCut = 40968
end
item
Command = ecLineBreak
ShortCut = 13
end
item
Command = ecSelectAll
ShortCut = 16449
end
item
Command = ecCopy
ShortCut = 16451
end
item
Command = ecBlockIndent
ShortCut = 24649
end
item
Command = ecLineBreak
ShortCut = 16461
end
item
Command = ecInsertLine
ShortCut = 16462
end
item
Command = ecDeleteWord
ShortCut = 16468
end
item
Command = ecBlockUnindent
ShortCut = 24661
end
item
Command = ecPaste
ShortCut = 16470
end
item
Command = ecCut
ShortCut = 16472
end
item
Command = ecDeleteLine
ShortCut = 16473
end
item
Command = ecDeleteEOL
ShortCut = 24665
end
item
Command = ecUndo
ShortCut = 16474
end
item
Command = ecRedo
ShortCut = 24666
end
item
Command = ecGotoMarker0
ShortCut = 16432
end
item
Command = ecGotoMarker1
ShortCut = 16433
end
item
Command = ecGotoMarker2
ShortCut = 16434
end
item
Command = ecGotoMarker3
ShortCut = 16435
end
item
Command = ecGotoMarker4
ShortCut = 16436
end
item
Command = ecGotoMarker5
ShortCut = 16437
end
item
Command = ecGotoMarker6
ShortCut = 16438
end
item
Command = ecGotoMarker7
ShortCut = 16439
end
item
Command = ecGotoMarker8
ShortCut = 16440
end
item
Command = ecGotoMarker9
ShortCut = 16441
end
item
Command = ecSetMarker0
ShortCut = 24624
end
item
Command = ecSetMarker1
ShortCut = 24625
end
item
Command = ecSetMarker2
ShortCut = 24626
end
item
Command = ecSetMarker3
ShortCut = 24627
end
item
Command = ecSetMarker4
ShortCut = 24628
end
item
Command = ecSetMarker5
ShortCut = 24629
end
item
Command = ecSetMarker6
ShortCut = 24630
end
item
Command = ecSetMarker7
ShortCut = 24631
end
item
Command = ecSetMarker8
ShortCut = 24632
end
item
Command = ecSetMarker9
ShortCut = 24633
end
item
Command = EcFoldLevel1
ShortCut = 41009
end
item
Command = EcFoldLevel2
ShortCut = 41010
end
item
Command = EcFoldLevel3
ShortCut = 41011
end
item
Command = EcFoldLevel4
ShortCut = 41012
end
item
Command = EcFoldLevel5
ShortCut = 41013
end
item
Command = EcFoldLevel6
ShortCut = 41014
end
item
Command = EcFoldLevel7
ShortCut = 41015
end
item
Command = EcFoldLevel8
ShortCut = 41016
end
item
Command = EcFoldLevel9
ShortCut = 41017
end
item
Command = EcFoldLevel0
ShortCut = 41008
end
item
Command = EcFoldCurrent
ShortCut = 41005
end
item
Command = EcUnFoldCurrent
ShortCut = 41003
end
item
Command = EcToggleMarkupWord
ShortCut = 32845
end
item
Command = ecNormalSelect
ShortCut = 24654
end
item
Command = ecColumnSelect
ShortCut = 24643
end
item
Command = ecLineSelect
ShortCut = 24652
end
item
Command = ecTab
ShortCut = 9
end
item
Command = ecShiftTab
ShortCut = 8201
end
item
Command = ecMatchBracket
ShortCut = 24642
end
item
Command = ecColSelUp
ShortCut = 40998
end
item
Command = ecColSelDown
ShortCut = 41000
end
object SynGutterLineNumber1: TSynGutterLineNumber
Width = 17
MouseActions = <>
MarkupInfo.Background = clBtnFace
MarkupInfo.Foreground = clNone
DigitCount = 2
ShowOnlyLineNumbersMultiplesOf = 1
ZeroStart = False
LeadingZeros = False
item
Command = ecColSelLeft
ShortCut = 40997
end
object SynGutterChanges1: TSynGutterChanges
Width = 4
MouseActions = <>
ModifiedColor = 59900
SavedColor = clGreen
item
Command = ecColSelRight
ShortCut = 40999
end
object SynGutterSeparator1: TSynGutterSeparator
Width = 2
MouseActions = <>
MarkupInfo.Background = clWhite
MarkupInfo.Foreground = clGray
item
Command = ecColSelPageDown
ShortCut = 40994
end
object SynGutterCodeFolding1: TSynGutterCodeFolding
MouseActions = <>
MarkupInfo.Background = clNone
MarkupInfo.Foreground = clGray
MouseActionsExpanded = <>
MouseActionsCollapsed = <>
item
Command = ecColSelPageBottom
ShortCut = 57378
end
item
Command = ecColSelPageUp
ShortCut = 40993
end
item
Command = ecColSelPageTop
ShortCut = 57377
end
item
Command = ecColSelLineStart
ShortCut = 40996
end
object TabSheet5: TTabSheet
Caption = 'C#'
ClientHeight = 453
ClientWidth = 785
ImageIndex = 2
inline mem_ClassCSharp: TSynEdit
Left = 0
Height = 453
Top = 0
Width = 785
Align = alClient
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Courier New'
Font.Pitch = fpFixed
Font.Quality = fqNonAntialiased
ParentColor = False
ParentFont = False
TabOrder = 0
Gutter.Width = 57
Gutter.MouseActions = <>
RightGutter.Width = 0
RightGutter.MouseActions = <>
Keystrokes = <>
item
Command = ecColSelLineEnd
ShortCut = 40995
end
item
Command = ecColSelEditorTop
ShortCut = 57380
end
item
Command = ecColSelEditorBottom
ShortCut = 57379
end>
MouseActions = <>
MouseTextActions = <>
MouseSelActions = <>
Lines.Strings = (
''
)
Options = [eoAutoIndent, eoBracketHighlight, eoEnhanceHomeKey, eoGroupUndo, eoHalfPageScroll, eoHideRightMargin, eoSmartTabs, eoTabsToSpaces, eoTrimTrailingSpaces, eoAltSetsColumnMode]
Options2 = [eoEnhanceEndKey, eoFoldedCopyPaste, eoOverwriteBlock, eoColorSelectionTillEol]
MouseOptions = [emAltSetsColumnMode, emCtrlWheelZoom]
VisibleSpecialChars = [vscSpace, vscTabAtLast]
ReadOnly = True
RightEdge = 0
ScrollBars = ssAutoBoth
SelectedColor.BackPriority = 50
SelectedColor.ForePriority = 50
SelectedColor.FramePriority = 50
......@@ -280,6 +1579,7 @@ object PreviewClassCode: TPreviewClassCode
inline SynLeftGutterPartList1: TSynGutterPartList
object SynGutterMarks1: TSynGutterMarks
Width = 24
Visible = False
MouseActions = <>
end
object SynGutterLineNumber1: TSynGutterLineNumber
......@@ -305,6 +1605,7 @@ object PreviewClassCode: TPreviewClassCode
MarkupInfo.Foreground = clGray
end
object SynGutterCodeFolding1: TSynGutterCodeFolding
Visible = False
MouseActions = <>
MarkupInfo.Background = clNone
MarkupInfo.Foreground = clGray
......@@ -316,28 +1617,29 @@ object PreviewClassCode: TPreviewClassCode
end
object TabSheet6: TTabSheet
Caption = 'SQL'
ClientHeight = 453
ClientWidth = 785
ClientHeight = 506
ClientWidth = 781
ImageIndex = 3
object PageControl1: TPageControl
Left = 0
Height = 453
Height = 506
Top = 0
Width = 785
Width = 781
ActivePage = TabSheet10
Align = alClient
TabIndex = 0
TabOrder = 0
object TabSheet10: TTabSheet
Caption = 'SQL Server'
ClientHeight = 414
ClientWidth = 779
ClientHeight = 478
ClientWidth = 771
inline mem_ClassSQL: TSynEdit
Left = 0
Height = 414
Height = 478
Top = 0
Width = 779
Width = 771
Align = alClient
Color = clWindow
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Courier New'
......@@ -346,16 +1648,446 @@ object PreviewClassCode: TPreviewClassCode
ParentColor = False
ParentFont = False
TabOrder = 0
Gutter.Width = 57
BorderStyle = bsNone
Gutter.Width = 23
Gutter.MouseActions = <>
RightGutter.Width = 0
RightGutter.MouseActions = <>
Keystrokes = <>
Highlighter = SynSQLSyn1
Keystrokes = <
item
Command = ecUp
ShortCut = 38
end
item
Command = ecSelUp
ShortCut = 8230
end
item
Command = ecScrollUp
ShortCut = 16422
end
item
Command = ecDown
ShortCut = 40
end
item
Command = ecSelDown
ShortCut = 8232
end
item
Command = ecScrollDown
ShortCut = 16424
end
item
Command = ecLeft
ShortCut = 37
end
item
Command = ecSelLeft
ShortCut = 8229
end
item
Command = ecWordLeft
ShortCut = 16421
end
item
Command = ecSelWordLeft
ShortCut = 24613
end
item
Command = ecRight
ShortCut = 39
end
item
Command = ecSelRight
ShortCut = 8231
end
item
Command = ecWordRight
ShortCut = 16423
end
item
Command = ecSelWordRight
ShortCut = 24615
end
item
Command = ecPageDown
ShortCut = 34
end
item
Command = ecSelPageDown
ShortCut = 8226
end
item
Command = ecPageBottom
ShortCut = 16418
end
item
Command = ecSelPageBottom
ShortCut = 24610
end
item
Command = ecPageUp
ShortCut = 33
end
item
Command = ecSelPageUp
ShortCut = 8225
end
item
Command = ecPageTop
ShortCut = 16417
end
item
Command = ecSelPageTop
ShortCut = 24609
end
item
Command = ecLineStart
ShortCut = 36
end
item
Command = ecSelLineStart
ShortCut = 8228
end
item
Command = ecEditorTop
ShortCut = 16420
end
item
Command = ecSelEditorTop
ShortCut = 24612
end
item
Command = ecLineEnd
ShortCut = 35
end
item
Command = ecSelLineEnd
ShortCut = 8227
end
item
Command = ecEditorBottom
ShortCut = 16419
end
item
Command = ecSelEditorBottom
ShortCut = 24611
end
item
Command = ecToggleMode
ShortCut = 45
end
item
Command = ecCopy
ShortCut = 16429
end
item
Command = ecPaste
ShortCut = 8237
end
item
Command = ecDeleteChar
ShortCut = 46
end
item
Command = ecCut
ShortCut = 8238
end
item
Command = ecDeleteLastChar
ShortCut = 8
end
item
Command = ecDeleteLastChar
ShortCut = 8200
end
item
Command = ecDeleteLastWord
ShortCut = 16392
end
item
Command = ecUndo
ShortCut = 32776
end
item
Command = ecRedo
ShortCut = 40968
end
item
Command = ecLineBreak
ShortCut = 13
end
item
Command = ecSelectAll
ShortCut = 16449
end
item
Command = ecCopy
ShortCut = 16451
end
item
Command = ecBlockIndent
ShortCut = 24649
end
item
Command = ecLineBreak
ShortCut = 16461
end
item
Command = ecInsertLine
ShortCut = 16462
end
item
Command = ecDeleteWord
ShortCut = 16468
end
item
Command = ecBlockUnindent
ShortCut = 24661
end
item
Command = ecPaste
ShortCut = 16470
end
item
Command = ecCut
ShortCut = 16472
end
item
Command = ecDeleteLine
ShortCut = 16473
end
item
Command = ecDeleteEOL
ShortCut = 24665
end
item
Command = ecUndo
ShortCut = 16474
end
item
Command = ecRedo
ShortCut = 24666
end
item
Command = ecGotoMarker0
ShortCut = 16432
end
item
Command = ecGotoMarker1
ShortCut = 16433
end
item
Command = ecGotoMarker2
ShortCut = 16434
end
item
Command = ecGotoMarker3
ShortCut = 16435
end
item
Command = ecGotoMarker4
ShortCut = 16436
end
item
Command = ecGotoMarker5
ShortCut = 16437
end
item
Command = ecGotoMarker6
ShortCut = 16438
end
item
Command = ecGotoMarker7
ShortCut = 16439
end
item
Command = ecGotoMarker8
ShortCut = 16440
end
item
Command = ecGotoMarker9
ShortCut = 16441
end
item
Command = ecSetMarker0
ShortCut = 24624
end
item
Command = ecSetMarker1
ShortCut = 24625
end
item
Command = ecSetMarker2
ShortCut = 24626
end
item
Command = ecSetMarker3
ShortCut = 24627
end
item
Command = ecSetMarker4
ShortCut = 24628
end
item
Command = ecSetMarker5
ShortCut = 24629
end
item
Command = ecSetMarker6
ShortCut = 24630
end
item
Command = ecSetMarker7
ShortCut = 24631
end
item
Command = ecSetMarker8
ShortCut = 24632
end
item
Command = ecSetMarker9
ShortCut = 24633
end
item
Command = EcFoldLevel1
ShortCut = 41009
end
item
Command = EcFoldLevel2
ShortCut = 41010
end
item
Command = EcFoldLevel3
ShortCut = 41011
end
item
Command = EcFoldLevel4
ShortCut = 41012
end
item
Command = EcFoldLevel5
ShortCut = 41013
end
item
Command = EcFoldLevel6
ShortCut = 41014
end
item
Command = EcFoldLevel7
ShortCut = 41015
end
item
Command = EcFoldLevel8
ShortCut = 41016
end
item
Command = EcFoldLevel9
ShortCut = 41017
end
item
Command = EcFoldLevel0
ShortCut = 41008
end
item
Command = EcFoldCurrent
ShortCut = 41005
end
item
Command = EcUnFoldCurrent
ShortCut = 41003
end
item
Command = EcToggleMarkupWord
ShortCut = 32845
end
item
Command = ecNormalSelect
ShortCut = 24654
end
item
Command = ecColumnSelect
ShortCut = 24643
end
item
Command = ecLineSelect
ShortCut = 24652
end
item
Command = ecTab
ShortCut = 9
end
item
Command = ecShiftTab
ShortCut = 8201
end
item
Command = ecMatchBracket
ShortCut = 24642
end
item
Command = ecColSelUp
ShortCut = 40998
end
item
Command = ecColSelDown
ShortCut = 41000
end
item
Command = ecColSelLeft
ShortCut = 40997
end
item
Command = ecColSelRight
ShortCut = 40999
end
item
Command = ecColSelPageDown
ShortCut = 40994
end
item
Command = ecColSelPageBottom
ShortCut = 57378
end
item
Command = ecColSelPageUp
ShortCut = 40993
end
item
Command = ecColSelPageTop
ShortCut = 57377
end
item
Command = ecColSelLineStart
ShortCut = 40996
end
item
Command = ecColSelLineEnd
ShortCut = 40995
end
item
Command = ecColSelEditorTop
ShortCut = 57380
end
item
Command = ecColSelEditorBottom
ShortCut = 57379
end>
MouseActions = <>
MouseTextActions = <>
MouseSelActions = <>
Lines.Strings = (
''
)
Options = [eoAutoIndent, eoBracketHighlight, eoEnhanceHomeKey, eoGroupUndo, eoHalfPageScroll, eoHideRightMargin, eoSmartTabs, eoTabsToSpaces, eoTrimTrailingSpaces, eoAltSetsColumnMode]
Options2 = [eoEnhanceEndKey, eoFoldedCopyPaste, eoOverwriteBlock, eoColorSelectionTillEol]
MouseOptions = [emAltSetsColumnMode, emCtrlWheelZoom]
VisibleSpecialChars = [vscSpace, vscTabAtLast]
ReadOnly = True
RightEdge = 0
ScrollBars = ssAutoBoth
SelectedColor.BackPriority = 50
SelectedColor.ForePriority = 50
SelectedColor.FramePriority = 50
......@@ -377,6 +2109,7 @@ object PreviewClassCode: TPreviewClassCode
inline SynLeftGutterPartList1: TSynGutterPartList
object SynGutterMarks1: TSynGutterMarks
Width = 24
Visible = False
MouseActions = <>
end
object SynGutterLineNumber1: TSynGutterLineNumber
......@@ -402,6 +2135,7 @@ object PreviewClassCode: TPreviewClassCode
MarkupInfo.Foreground = clGray
end
object SynGutterCodeFolding1: TSynGutterCodeFolding
Visible = False
MouseActions = <>
MarkupInfo.Background = clNone
MarkupInfo.Foreground = clGray
......@@ -413,15 +2147,16 @@ object PreviewClassCode: TPreviewClassCode
end
object TabSheet14: TTabSheet
Caption = 'Oracle'
ClientHeight = 0
ClientWidth = 0
ClientHeight = 478
ClientWidth = 771
ImageIndex = 1
inline mem_ClassOracle: TSynEdit
Left = 0
Height = 441
Height = 478
Top = 0
Width = 773
Width = 771
Align = alClient
Color = clWindow
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Courier New'
......@@ -430,16 +2165,446 @@ object PreviewClassCode: TPreviewClassCode
ParentColor = False
ParentFont = False
TabOrder = 0
Gutter.Width = 57
BorderStyle = bsNone
Gutter.Width = 23
Gutter.MouseActions = <>
RightGutter.Width = 0
RightGutter.MouseActions = <>
Keystrokes = <>
Highlighter = SynSQLSyn1
Keystrokes = <
item
Command = ecUp
ShortCut = 38
end
item
Command = ecSelUp
ShortCut = 8230
end
item
Command = ecScrollUp
ShortCut = 16422
end
item
Command = ecDown
ShortCut = 40
end
item
Command = ecSelDown
ShortCut = 8232
end
item
Command = ecScrollDown
ShortCut = 16424
end
item
Command = ecLeft
ShortCut = 37
end
item
Command = ecSelLeft
ShortCut = 8229
end
item
Command = ecWordLeft
ShortCut = 16421
end
item
Command = ecSelWordLeft
ShortCut = 24613
end
item
Command = ecRight
ShortCut = 39
end
item
Command = ecSelRight
ShortCut = 8231
end
item
Command = ecWordRight
ShortCut = 16423
end
item
Command = ecSelWordRight
ShortCut = 24615
end
item
Command = ecPageDown
ShortCut = 34
end
item
Command = ecSelPageDown
ShortCut = 8226
end
item
Command = ecPageBottom
ShortCut = 16418
end
item
Command = ecSelPageBottom
ShortCut = 24610
end
item
Command = ecPageUp
ShortCut = 33
end
item
Command = ecSelPageUp
ShortCut = 8225
end
item
Command = ecPageTop
ShortCut = 16417
end
item
Command = ecSelPageTop
ShortCut = 24609
end
item
Command = ecLineStart
ShortCut = 36
end
item
Command = ecSelLineStart
ShortCut = 8228
end
item
Command = ecEditorTop
ShortCut = 16420
end
item
Command = ecSelEditorTop
ShortCut = 24612
end
item
Command = ecLineEnd
ShortCut = 35
end
item
Command = ecSelLineEnd
ShortCut = 8227
end
item
Command = ecEditorBottom
ShortCut = 16419
end
item
Command = ecSelEditorBottom
ShortCut = 24611
end
item
Command = ecToggleMode
ShortCut = 45
end
item
Command = ecCopy
ShortCut = 16429
end
item
Command = ecPaste
ShortCut = 8237
end
item
Command = ecDeleteChar
ShortCut = 46
end
item
Command = ecCut
ShortCut = 8238
end
item
Command = ecDeleteLastChar
ShortCut = 8
end
item
Command = ecDeleteLastChar
ShortCut = 8200
end
item
Command = ecDeleteLastWord
ShortCut = 16392
end
item
Command = ecUndo
ShortCut = 32776
end
item
Command = ecRedo
ShortCut = 40968
end
item
Command = ecLineBreak
ShortCut = 13
end
item
Command = ecSelectAll
ShortCut = 16449
end
item
Command = ecCopy
ShortCut = 16451
end
item
Command = ecBlockIndent
ShortCut = 24649
end
item
Command = ecLineBreak
ShortCut = 16461
end
item
Command = ecInsertLine
ShortCut = 16462
end
item
Command = ecDeleteWord
ShortCut = 16468
end
item
Command = ecBlockUnindent
ShortCut = 24661
end
item
Command = ecPaste
ShortCut = 16470
end
item
Command = ecCut
ShortCut = 16472
end
item
Command = ecDeleteLine
ShortCut = 16473
end
item
Command = ecDeleteEOL
ShortCut = 24665
end
item
Command = ecUndo
ShortCut = 16474
end
item
Command = ecRedo
ShortCut = 24666
end
item
Command = ecGotoMarker0
ShortCut = 16432
end
item
Command = ecGotoMarker1
ShortCut = 16433
end
item
Command = ecGotoMarker2
ShortCut = 16434
end
item
Command = ecGotoMarker3
ShortCut = 16435
end
item
Command = ecGotoMarker4
ShortCut = 16436
end
item
Command = ecGotoMarker5
ShortCut = 16437
end
item
Command = ecGotoMarker6
ShortCut = 16438
end
item
Command = ecGotoMarker7
ShortCut = 16439
end
item
Command = ecGotoMarker8
ShortCut = 16440
end
item
Command = ecGotoMarker9
ShortCut = 16441
end
item
Command = ecSetMarker0
ShortCut = 24624
end
item
Command = ecSetMarker1
ShortCut = 24625
end
item
Command = ecSetMarker2
ShortCut = 24626
end
item
Command = ecSetMarker3
ShortCut = 24627
end
item
Command = ecSetMarker4
ShortCut = 24628
end
item
Command = ecSetMarker5
ShortCut = 24629
end
item
Command = ecSetMarker6
ShortCut = 24630
end
item
Command = ecSetMarker7
ShortCut = 24631
end
item
Command = ecSetMarker8
ShortCut = 24632
end
item
Command = ecSetMarker9
ShortCut = 24633
end
item
Command = EcFoldLevel1
ShortCut = 41009
end
item
Command = EcFoldLevel2
ShortCut = 41010
end
item
Command = EcFoldLevel3
ShortCut = 41011
end
item
Command = EcFoldLevel4
ShortCut = 41012
end
item
Command = EcFoldLevel5
ShortCut = 41013
end
item
Command = EcFoldLevel6
ShortCut = 41014
end
item
Command = EcFoldLevel7
ShortCut = 41015
end
item
Command = EcFoldLevel8
ShortCut = 41016
end
item
Command = EcFoldLevel9
ShortCut = 41017
end
item
Command = EcFoldLevel0
ShortCut = 41008
end
item
Command = EcFoldCurrent
ShortCut = 41005
end
item
Command = EcUnFoldCurrent
ShortCut = 41003
end
item
Command = EcToggleMarkupWord
ShortCut = 32845
end
item
Command = ecNormalSelect
ShortCut = 24654
end
item
Command = ecColumnSelect
ShortCut = 24643
end
item
Command = ecLineSelect
ShortCut = 24652
end
item
Command = ecTab
ShortCut = 9
end
item
Command = ecShiftTab
ShortCut = 8201
end
item
Command = ecMatchBracket
ShortCut = 24642
end
item
Command = ecColSelUp
ShortCut = 40998
end
item
Command = ecColSelDown
ShortCut = 41000
end
item
Command = ecColSelLeft
ShortCut = 40997
end
item
Command = ecColSelRight
ShortCut = 40999
end
item
Command = ecColSelPageDown
ShortCut = 40994
end
item
Command = ecColSelPageBottom
ShortCut = 57378
end
item
Command = ecColSelPageUp
ShortCut = 40993
end
item
Command = ecColSelPageTop
ShortCut = 57377
end
item
Command = ecColSelLineStart
ShortCut = 40996
end
item
Command = ecColSelLineEnd
ShortCut = 40995
end
item
Command = ecColSelEditorTop
ShortCut = 57380
end
item
Command = ecColSelEditorBottom
ShortCut = 57379
end>
MouseActions = <>
MouseTextActions = <>
MouseSelActions = <>
Lines.Strings = (
''
)
Options = [eoAutoIndent, eoBracketHighlight, eoEnhanceHomeKey, eoGroupUndo, eoHalfPageScroll, eoHideRightMargin, eoSmartTabs, eoTabsToSpaces, eoTrimTrailingSpaces, eoAltSetsColumnMode]
Options2 = [eoEnhanceEndKey, eoFoldedCopyPaste, eoOverwriteBlock, eoColorSelectionTillEol]
MouseOptions = [emAltSetsColumnMode, emCtrlWheelZoom]
VisibleSpecialChars = [vscSpace, vscTabAtLast]
ReadOnly = True
RightEdge = 0
ScrollBars = ssAutoBoth
SelectedColor.BackPriority = 50
SelectedColor.ForePriority = 50
SelectedColor.FramePriority = 50
......@@ -461,6 +2626,7 @@ object PreviewClassCode: TPreviewClassCode
inline SynLeftGutterPartList1: TSynGutterPartList
object SynGutterMarks1: TSynGutterMarks
Width = 24
Visible = False
MouseActions = <>
end
object SynGutterLineNumber1: TSynGutterLineNumber
......@@ -486,6 +2652,7 @@ object PreviewClassCode: TPreviewClassCode
MarkupInfo.Foreground = clGray
end
object SynGutterCodeFolding1: TSynGutterCodeFolding
Visible = False
MouseActions = <>
MarkupInfo.Background = clNone
MarkupInfo.Foreground = clGray
......@@ -501,4 +2668,24 @@ object PreviewClassCode: TPreviewClassCode
end
end
end
object SynFreePascalSyn1: TSynFreePascalSyn
Enabled = False
CompilerMode = pcmObjFPC
NestedComments = True
left = 383
top = 19
end
object SynJavaSyn1: TSynJavaSyn
DefaultFilter = 'Java Files (*.java)|*.java'
Enabled = False
left = 503
top = 19
end
object SynSQLSyn1: TSynSQLSyn
DefaultFilter = 'SQL Files (*.sql)|*.sql'
Enabled = False
SQLDialect = sqlSybase
left = 589
top = 19
end
end
......@@ -3,29 +3,36 @@ unit formMemo;
interface
uses
Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls, SynEdit;
Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, ComCtrls, SynEdit, SynHighlighterPas, SynHighlighterJava,
SynHighlighterSQL;
type
{ TPreviewClassCode }
TPreviewClassCode = class(TForm)
Panel2: TPanel;
Panel1: TPanel;
Button1: TButton;
pgc_Main: TPageControl;
mem_ClassJava: TSynEdit;
mem_ClassPascal: TSynEdit;
mem_ClassCSharp: TSynEdit;
mem_ClassSQL: TSynEdit;
mem_ClassOracle: TSynEdit;
SynFreePascalSyn1: TSynFreePascalSyn;
SynJavaSyn1: TSynJavaSyn;
SynSQLSyn1: TSynSQLSyn;
TabSheet1: TTabSheet;
pgc_ClassCode: TPageControl;
TabSheet3: TTabSheet;
mem_ClassPascal: TSynEdit;
TabSheet4: TTabSheet;
mem_ClassJava: TSynEdit;
TabSheet5: TTabSheet;
mem_ClassCSharp: TSynEdit;
TabSheet6: TTabSheet;
PageControl1: TPageControl;
TabSheet10: TTabSheet;
TabSheet14: TTabSheet;
mem_ClassSQL: TSynEdit;
mem_ClassOracle: TSynEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
......
object DataBaseLogin: TDataBaseLogin
Left = 2241
Height = 543
Top = 255
Left = 1480
Height = 537
Top = 299
Width = 440
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
Caption = 'Connect to Database Server'
ClientHeight = 543
ClientHeight = 537
ClientWidth = 440
Color = clBtnFace
OnClose = FormClose
OnShow = FormShow
ParentFont = True
Position = poOwnerFormCenter
LCLVersion = '2.0.0.4'
object GroupBox2: TGroupBox
Left = 8
Height = 208
Top = 288
Width = 424
TabOrder = 11
end
object GroupBox1: TGroupBox
Left = 8
Height = 272
Top = 8
Width = 424
TabOrder = 10
end
object cbODBCD_DSN: TComboBox
Left = 32
Height = 15
Top = 48
Width = 389
ItemHeight = 0
OnChange = cbODBCD_DSNChange
Style = csDropDownList
ClientHeight = 206
ClientWidth = 422
TabOrder = 1
end
object edtUsuario: TLabeledEdit
Left = 21
Height = 22
Top = 398
Left = 15
Height = 43
Top = 95
Width = 400
EditLabel.Height = 16
EditLabel.Height = 19
EditLabel.Width = 400
EditLabel.Caption = 'Usuário'
EditLabel.ParentColor = False
TabOrder = 7
TabOrder = 1
end
object edtPassword: TLabeledEdit
Left = 21
Height = 22
Top = 454
Left = 15
Height = 43
Top = 160
Width = 400
EchoMode = emPassword
EditLabel.Height = 16
EditLabel.Height = 19
EditLabel.Width = 400
EditLabel.Caption = 'Senha'
EditLabel.ParentColor = False
PasswordChar = '*'
TabOrder = 8
TabOrder = 2
end
object cbDialect: TComboBox
Left = 21
Height = 15
Top = 339
Left = 15
Height = 39
Top = 25
Width = 400
ItemHeight = 0
OnChange = cbODBCD_DSNChange
Style = csDropDownList
TabOrder = 6
TabOrder = 0
end
object Label2: TLabel
Left = 21
Height = 16
Top = 320
Width = 45
Left = 15
Height = 19
Top = 5
Width = 48
Caption = 'Dialeto'
ParentColor = False
end
end
object GroupBox1: TGroupBox
Left = 8
Height = 272
Top = 8
Width = 424
ClientHeight = 270
ClientWidth = 422
TabOrder = 0
object cbODBCD_DSN: TComboBox
Left = 26
Height = 39
Top = 48
Width = 389
ItemHeight = 0
OnChange = cbODBCD_DSNChange
Style = csDropDownList
TabOrder = 1
end
object rbDSN: TRadioButton
Left = 16
Height = 18
Left = 10
Height = 24
Top = 16
Width = 115
Width = 130
Caption = 'Selecionar DSN'
Checked = True
OnClick = rbDSNClick
......@@ -91,19 +95,19 @@ object DataBaseLogin: TDataBaseLogin
TabStop = True
end
object rbPersonalizado: TRadioButton
Left = 16
Height = 18
Left = 10
Height = 24
Top = 88
Width = 108
Width = 119
Caption = 'Personalizado'
OnClick = rbPersonalizadoClick
TabOrder = 2
end
object cbODBCD_DRIVERS: TComboBox
Left = 35
Height = 15
Top = 120
Width = 386
Left = 26
Height = 39
Top = 115
Width = 389
Enabled = False
ItemHeight = 0
OnChange = cbODBCD_DSNChange
......@@ -111,56 +115,59 @@ object DataBaseLogin: TDataBaseLogin
TabOrder = 3
end
object edtDatabaseName: TLabeledEdit
Left = 32
Height = 22
Left = 26
Height = 43
Top = 232
Width = 389
EditLabel.Height = 16
EditLabel.Height = 19
EditLabel.Width = 389
EditLabel.Caption = 'Nome do Banco de Dados'
EditLabel.ParentColor = False
Enabled = False
TabOrder = 5
TabOrder = 4
end
object edtServerName: TLabeledEdit
Left = 32
Height = 22
Left = 26
Height = 43
Top = 176
Width = 389
EditLabel.Height = 16
EditLabel.Height = 19
EditLabel.Width = 389
EditLabel.Caption = 'Servidor'
EditLabel.ParentColor = False
Enabled = False
TabOrder = 4
TabOrder = 5
end
end
object Panel2: TPanel
Left = 0
Height = 40
Top = 503
Top = 497
Width = 440
Align = alBottom
ClientHeight = 40
ClientWidth = 440
TabOrder = 9
TabOrder = 2
object BitBtn1: TBitBtn
Left = 268
Height = 25
Top = 7
Width = 75
Left = 238
Height = 27
Top = 5
Width = 93
Anchors = [akTop, akRight]
Caption = 'Ok'
Default = True
Kind = bkOK
ModalResult = 1
OnClick = Button1Click
TabOrder = 0
end
object BitBtn2: TBitBtn
Left = 349
Height = 25
Top = 7
Width = 75
Left = 337
Height = 27
Top = 5
Width = 93
Anchors = [akTop, akRight]
Cancel = True
Caption = 'Cancel'
Kind = bkCancel
ModalResult = 2
......
object ExplorerV2: TExplorerV2
Left = 2406
Height = 695
Top = 177
Width = 1228
Left = 577
Height = 696
Top = 103
Width = 1232
Caption = 'Model OQL Query'
ClientHeight = 695
ClientWidth = 1228
ClientHeight = 696
ClientWidth = 1232
Color = clWindow
Icon.Data = {
96A5050000000100060000000000010020002820040066000000101000000100
......@@ -11574,6 +11574,7 @@ object ExplorerV2: TExplorerV2
001FF80000000000001FF80000000000001FFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
}
KeyPreview = True
OnClose = FormClose
OnCreate = FormCreate
OnDestroy = FormDestroy
......@@ -11581,9 +11582,10 @@ object ExplorerV2: TExplorerV2
ParentFont = True
Position = poMainFormCenter
ShowInTaskBar = stAlways
LCLVersion = '2.0.0.4'
object splVertical: TSplitter
Left = 360
Height = 695
Height = 696
Top = 0
Width = 5
MinSize = 5
......@@ -11591,56 +11593,56 @@ object ExplorerV2: TExplorerV2
end
object pnlEditor: TPanel
Left = 365
Height = 695
Height = 696
Top = 0
Width = 863
Width = 867
Align = alClient
BevelOuter = bvNone
ClientHeight = 695
ClientWidth = 863
ClientHeight = 696
ClientWidth = 867
TabOrder = 0
object pnlResult: TPanel
Left = 0
Height = 185
Top = 495
Width = 863
Top = 490
Width = 867
Align = alBottom
BevelOuter = bvNone
ClientHeight = 185
ClientWidth = 863
ClientWidth = 867
TabOrder = 0
object pcResults: TPageControl
Left = 0
Height = 185
Top = 0
Width = 863
Width = 867
ActivePage = tsError
Align = alClient
ShowTabs = False
TabIndex = 1
TabOrder = 0
object tsQueryResult: TTabSheet
Caption = 'tsQueryResult'
ClientHeight = 158
ClientWidth = 882
TabVisible = False
ClientHeight = 181
ClientWidth = 857
object pcXMLResults: TPageControl
Left = 0
Height = 158
Height = 181
Top = 0
Width = 882
Width = 853
ActivePage = tsList
Align = alClient
TabIndex = 0
TabOrder = 0
object tsList: TTabSheet
Caption = 'Result List'
ClientHeight = 119
ClientWidth = 876
ClientHeight = 177
ClientWidth = 849
object lvXMLListResult: TListView
Left = 0
Height = 131
Height = 148
Top = 0
Width = 874
Width = 843
Align = alClient
BorderStyle = bsNone
Columns = <>
......@@ -11648,25 +11650,26 @@ object ExplorerV2: TExplorerV2
ParentColor = True
ReadOnly = True
RowSelect = True
ScrollBars = ssAutoBoth
TabOrder = 0
ViewStyle = vsReport
end
end
object tsXML: TTabSheet
Caption = 'XML Result'
ClientHeight = 131
ClientWidth = 874
ClientHeight = 177
ClientWidth = 849
ImageIndex = 1
object memXMLTextResult: TMemo
Left = 0
Height = 131
Height = 148
Top = 0
Width = 874
Width = 843
Align = alClient
BorderStyle = bsNone
ParentColor = True
ReadOnly = True
ScrollBars = ssBoth
ScrollBars = ssAutoBoth
TabOrder = 0
end
end
......@@ -11674,20 +11677,19 @@ object ExplorerV2: TExplorerV2
end
object tsError: TTabSheet
Caption = 'tsError'
ClientHeight = 146
ClientHeight = 181
ClientWidth = 857
ImageIndex = 1
TabVisible = False
object memErrorText: TMemo
Left = 0
Height = 146
Height = 181
Top = 0
Width = 857
Align = alClient
BorderStyle = bsNone
ParentColor = True
ReadOnly = True
ScrollBars = ssBoth
ScrollBars = ssAutoBoth
TabOrder = 0
end
end
......@@ -11695,28 +11697,31 @@ object ExplorerV2: TExplorerV2
end
object pcEditor: TPageControl
Left = 0
Height = 442
Height = 437
Top = 48
Width = 498
Width = 502
ActivePage = tsOQL
Align = alClient
MultiLine = True
ParentFont = False
TabIndex = 0
TabOrder = 1
OnChange = pcEditorChange
Options = [nboMultiLine]
object tsOQL: TTabSheet
Caption = 'OQL - Object Query Language'
ClientHeight = 403
ClientHeight = 404
ClientWidth = 492
inline SynEditOQL: TSynEdit
Left = 0
Height = 403
Height = 404
Top = 0
Width = 492
Align = alClient
Font.Height = -13
Font.Name = 'Courier New'
Color = clWindow
Font.Color = clWindowText
Font.Height = 13
Font.Name = 'DejaVu Sans Mono'
Font.Pitch = fpFixed
Font.Quality = fqNonAntialiased
ParentColor = False
......@@ -11725,7 +11730,7 @@ object ExplorerV2: TExplorerV2
OnDragDrop = memOQLQuery2DragDrop
OnDragOver = memOQLQuery2DragOver
BorderStyle = bsNone
Gutter.Width = 33
Gutter.Width = 23
Gutter.MouseActions = <>
RightGutter.Width = 0
RightGutter.MouseActions = <>
......@@ -12222,14 +12227,16 @@ object ExplorerV2: TExplorerV2
end
object tsSQL: TTabSheet
Caption = 'SQL Translation'
ClientHeight = 403
ClientHeight = 404
ClientWidth = 492
inline SynEditSQL: TSynEdit
Left = 0
Height = 403
Height = 404
Top = 0
Width = 492
Align = alClient
Color = clWindow
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Courier New'
Font.Pitch = fpFixed
......@@ -12238,7 +12245,7 @@ object ExplorerV2: TExplorerV2
ParentFont = False
TabOrder = 0
BorderStyle = bsNone
Gutter.Width = 33
Gutter.Width = 23
Gutter.MouseActions = <>
RightGutter.Width = 0
RightGutter.MouseActions = <>
......@@ -12739,18 +12746,18 @@ object ExplorerV2: TExplorerV2
Left = 0
Height = 48
Top = 0
Width = 863
Width = 867
Align = alTop
AutoSize = True
BevelOuter = bvNone
ClientHeight = 48
ClientWidth = 863
ClientWidth = 867
TabOrder = 2
object ToolBar1: TToolBar
Left = 0
Height = 48
Top = 0
Width = 863
Width = 867
ButtonHeight = 40
ButtonWidth = 50
Caption = 'ToolBar1'
......@@ -12802,7 +12809,7 @@ object ExplorerV2: TExplorerV2
Style = tbsCheck
end
object ToolButton8: TToolButton
Left = 351
Left = 355
Top = 2
Action = XMLQuery
Grouped = True
......@@ -12823,8 +12830,8 @@ object ExplorerV2: TExplorerV2
end
end
object spResultObject: TSplitter
Left = 498
Height = 442
Left = 502
Height = 437
Top = 48
Width = 5
Align = alRight
......@@ -12832,41 +12839,40 @@ object ExplorerV2: TExplorerV2
ResizeStyle = rsPattern
end
inline OQLObjects: TObjectExplorer
Left = 503
Height = 442
Left = 507
Height = 437
Top = 48
Width = 360
Align = alRight
ClientHeight = 442
ClientHeight = 437
ClientWidth = 360
TabOrder = 4
Visible = False
inherited tvExplorer: TTreeView
Height = 442
Height = 437
Width = 360
Images = ilModel
ParentColor = True
PopupMenu = pmCopiar
ReadOnly = False
RightClickSelect = True
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoRightClickSelect, tvoShowButtons, tvoShowRoot, tvoToolTips, tvoThemedDraw]
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoRightClickSelect, tvoShowButtons, tvoShowRoot, tvoToolTips, tvoThemedDraw]
end
end
object spResultXML: TSplitter
Cursor = crVSplit
Left = 0
Height = 5
Top = 490
Width = 863
Top = 485
Width = 867
Align = alBottom
ResizeAnchor = akBottom
ResizeStyle = rsPattern
end
object sbStatusBar: TStatusBar
Left = 0
Height = 15
Top = 680
Width = 863
Height = 21
Top = 675
Width = 867
Panels = <
item
Width = 400
......@@ -12886,17 +12892,17 @@ object ExplorerV2: TExplorerV2
end
object pnlModel: TPanel
Left = 0
Height = 695
Height = 696
Top = 0
Width = 360
Align = alLeft
BevelOuter = bvNone
ClientHeight = 695
ClientHeight = 696
ClientWidth = 360
TabOrder = 1
object tvModelExplorer: TTreeView
Left = 0
Height = 695
Height = 696
Top = 0
Width = 360
Align = alClient
......
......@@ -117,6 +117,8 @@ type
{ Public declarations }
property MetaModel: acMetaModel read fMetaModel write SetMetaModel;
property Util: TUtil read fUtil;
property SQLDialect: acAbstractSQLDialect read fSQLDialect;
property Schema: String read fSchema;
end;
var
......@@ -370,6 +372,7 @@ begin
end
else
begin
pcResults.ActivePageIndex := 0;
spResultObject.Visible := False;
pnlResult.Visible := True;
spResultXML.Visible := True;
......
object OQLExplorerV2: TOQLExplorerV2
Left = 375
Height = 558
Top = 363
Left = 2177
Height = 552
Top = 281
Width = 1090
Caption = 'OQLExplorerV2'
ClientHeight = 558
Caption = 'Curio OQL Explorer'
ClientHeight = 552
ClientWidth = 1090
Color = clBtnFace
Font.Color = clWindowText
......@@ -11582,90 +11582,73 @@ object OQLExplorerV2: TOQLExplorerV2
OnCreate = FormCreate
OnResize = FormResize
OnShow = FormShow
LCLVersion = '2.0.2.0'
object pnlActionBar: TPanel
Left = 0
Height = 35
Top = 0
Width = 1090
Align = alTop
BevelOuter = bvNone
TabOrder = 0
end
LCLVersion = '2.0.0.4'
object pcCXOQL: TPageControl
Left = 0
Height = 523
Height = 517
Top = 35
Width = 1090
ActivePage = tsCXOQL
Align = alClient
TabIndex = 0
TabOrder = 1
TabOrder = 0
object tsCXOQL: TTabSheet
Caption = 'CXOQL'
ClientHeight = 497
ClientWidth = 1082
ClientHeight = 489
ClientWidth = 1080
object pnlCXOQL: TPanel
Left = 0
Height = 497
Height = 489
Top = 0
Width = 1082
Width = 1080
Align = alClient
BevelOuter = bvNone
ClientHeight = 497
ClientWidth = 1082
ClientHeight = 489
ClientWidth = 1080
ParentBackground = False
TabOrder = 0
object splVertical: TSplitter
Left = 219
Height = 497
Left = 274
Height = 489
Top = 0
Width = 8
Width = 4
Color = clBtnFace
OnCanResize = splVerticalCanResize
ParentColor = False
end
object pnlOQLList: TPanel
Left = 0
Height = 497
Height = 489
Top = 0
Width = 219
Width = 274
Align = alLeft
BevelOuter = bvNone
ClientHeight = 497
ClientWidth = 219
TabOrder = 0
object pnlOQLButtons: TPanel
Left = 0
Height = 35
Top = 0
Width = 219
Align = alTop
BevelOuter = bvNone
ClientHeight = 489
ClientWidth = 274
TabOrder = 0
end
object pnlList: TPanel
Left = 0
Height = 462
Top = 35
Width = 219
Height = 463
Top = 26
Width = 274
Align = alClient
BevelOuter = bvNone
ClientHeight = 462
ClientWidth = 219
TabOrder = 1
ClientHeight = 463
ClientWidth = 274
TabOrder = 0
object lvOQLList: TListView
Left = 0
Height = 374
Height = 375
Top = 0
Width = 219
Width = 274
Align = alClient
Columns = <
item
AutoSize = True
Caption = 'OQL Name'
Width = 74
Width = 272
end>
ScrollBars = ssAutoBoth
SmallImages = ilOQLState
TabOrder = 0
ViewStyle = vsReport
......@@ -11674,30 +11657,51 @@ object OQLExplorerV2: TOQLExplorerV2
object memError: TMemo
Left = 0
Height = 88
Top = 374
Width = 219
Top = 375
Width = 274
Align = alBottom
Color = clBtnFace
ReadOnly = True
TabOrder = 1
end
end
object ToolBar2: TToolBar
Left = 0
Height = 26
Top = 0
Width = 274
Caption = 'ToolBar2'
Images = ilCXOQL
List = True
ShowCaptions = True
TabOrder = 1
object ToolButton5: TToolButton
Left = 1
Top = 2
Action = aNewOQL
end
object ToolButton6: TToolButton
Left = 80
Top = 2
Action = aDeleteOQL
end
end
end
object pnlRight: TPanel
Left = 227
Height = 497
Left = 278
Height = 489
Top = 0
Width = 855
Width = 802
Align = alClient
BevelOuter = bvNone
ClientHeight = 497
ClientWidth = 855
ClientHeight = 489
ClientWidth = 802
TabOrder = 1
object pnlOQLExplorer: TPanel
Left = 0
Height = 424
Height = 416
Top = 73
Width = 855
Width = 802
Align = alClient
BevelOuter = bvNone
ParentBackground = False
......@@ -11707,16 +11711,16 @@ object OQLExplorerV2: TOQLExplorerV2
Left = 0
Height = 73
Top = 0
Width = 855
Width = 802
Align = alTop
BevelOuter = bvNone
ClientHeight = 73
ClientWidth = 855
ClientWidth = 802
ParentBackground = False
TabOrder = 0
object labelName: TLabel
Left = 58
Height = 13
Height = 14
Top = 13
Width = 31
Caption = 'Name:'
......@@ -11724,7 +11728,7 @@ object OQLExplorerV2: TOQLExplorerV2
end
object labelDescription: TLabel
Left = 32
Height = 13
Height = 14
Top = 43
Width = 57
Caption = 'Description:'
......@@ -11732,14 +11736,14 @@ object OQLExplorerV2: TOQLExplorerV2
end
object edtName: TEdit
Left = 97
Height = 21
Height = 31
Top = 10
Width = 384
TabOrder = 0
end
object edtDescription: TEdit
Left = 97
Height = 21
Height = 31
Top = 40
Width = 384
TabOrder = 1
......@@ -11750,8 +11754,8 @@ object OQLExplorerV2: TOQLExplorerV2
end
object tsPASunit: TTabSheet
Caption = 'Unit'
ClientHeight = 497
ClientWidth = 1082
ClientHeight = 489
ClientWidth = 1080
ImageIndex = 1
object pnlPASUnit: TPanel
Left = 0
......@@ -11776,6 +11780,39 @@ object OQLExplorerV2: TOQLExplorerV2
end
end
end
object ToolBar1: TToolBar
Left = 0
Height = 35
Top = 0
Width = 1090
ButtonHeight = 24
ButtonWidth = 24
Caption = 'ToolBar1'
Images = ilCXOQL
List = True
ShowCaptions = True
TabOrder = 1
object ToolButton1: TToolButton
Left = 1
Top = 2
Action = aNewFile
end
object ToolButton2: TToolButton
Left = 56
Top = 2
Action = aLoadFile
end
object ToolButton3: TToolButton
Left = 116
Top = 2
Action = aSaveFile
end
object ToolButton4: TToolButton
Left = 174
Top = 2
Action = aExportPas
end
end
object abExportPAS: TAction
Caption = 'abExportPAS'
Visible = False
......@@ -12588,8 +12625,8 @@ object OQLExplorerV2: TOQLExplorerV2
}
end
object ilOQLState: TImageList
left = 16
top = 472
left = 861
top = 5
Bitmap = {
4C6903000000100000001000000000000000000000000071ADFF0071ADFF0071
ADFF0071ADFF0071ADFF0071ADFF000000000000000000000000000000000000
......@@ -12702,4 +12739,38 @@ object OQLExplorerV2: TOQLExplorerV2
Filter = 'pas|*.pas'
left = 616
end
object ActionList1: TActionList
left = 926
top = 6
object aNewOQL: TAction
Caption = '&New OQL'
ImageIndex = 5
OnExecute = aNewOQLExecute
end
object aDeleteOQL: TAction
Caption = '&Delete OQL'
ImageIndex = 9
OnExecute = aDeleteOQLExecute
end
object aNewFile: TAction
Caption = 'Ne&w'
ImageIndex = 10
OnExecute = aNewFileExecute
end
object aLoadFile: TAction
Caption = '&Open'
ImageIndex = 3
OnExecute = aLoadFileExecute
end
object aSaveFile: TAction
Caption = '&Save'
ImageIndex = 7
OnExecute = aSaveFileExecute
end
object aExportPas: TAction
Caption = '&Export'
ImageIndex = 8
OnExecute = aExportPASExecute
end
end
end
......@@ -21,16 +21,23 @@ type
{ TOQLExplorerV2 }
TOQLExplorerV2 = class(TForm)
ilCXOQL: TImageList;
pnlActionBar: TPanel;
abExportPAS: TAction;
abCXOQL: TAction;
aNewOQL: TAction;
aDeleteOQL: TAction;
aExportPas: TAction;
aSaveFile: TAction;
aLoadFile: TAction;
aExportPAS: TAction;
aNewFile: TAction;
aDeleteOQL: TAction;
aNewOQL: TAction;
ActionList1: TActionList;
ilCXOQL: TImageList;
pcCXOQL: TPageControl;
ToolBar1: TToolBar;
ToolBar2: TToolBar;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
ToolButton4: TToolButton;
ToolButton5: TToolButton;
ToolButton6: TToolButton;
tsCXOQL: TTabSheet;
tsPASunit: TTabSheet;
ilOQLState: TImageList;
......@@ -51,10 +58,7 @@ type
SaveDialog1: TSaveDialog;
SaveUnit: TSaveDialog;
memUnit: TMemo;
pnlOQLButtons: TPanel;
pnlList: TPanel;
acttbOQL: TAction;
aNewFile: TAction;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure aNewOQLExecute(Sender: TObject);
procedure FormCreate(Sender: TObject);
......@@ -66,7 +70,6 @@ type
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure FormResize(Sender: TObject);
procedure lvOQLListChange(Sender: TObject; Item: TListItem;Change: TItemChange);
procedure lvOQLListChanging(Sender: TObject; Item: TListItem;Change: TItemChange; var AllowChange: Boolean);
procedure aNewFileExecute(Sender: TObject);
procedure splVerticalCanResize(Sender: TObject; var NewSize: Integer; var Accept: Boolean);
......@@ -78,6 +81,8 @@ type
fFlagFormClosing : Boolean; // Impede que as OQLs sejam inutilmente verificados ao fechar o form
fExplorer: TExplorerV2;
fOQLList: utOQLFile;
fLastItem: TListItem;
function GerarUnitOQL(piXMLFileName: String): string;
procedure InterfaceToSelectedOQL;
function GetQueryType ( piExplorer : TExplorerV2 ) : Integer;
function ValidaQuery(piQuery: string; piOQLType: integer): string;
......@@ -98,7 +103,7 @@ var
implementation
uses acuObject, acuOQL, IntegracaoDelphiSUML;
uses acuObject, acuOQL, acuOQLtoSQLTranslator, IntegracaoDelphiSUML, utuMessage;
{$R *.dfm}
......@@ -113,6 +118,7 @@ begin
lvOQLList.Selected.Delete;
lOQL.Delete;
fLastItem := Nil;
if lvOQLList.Items.Count > 0 then
if li - 1 >= 0 then
lvOQLList.Selected := lvOQLList.Items[li-1]
......@@ -126,14 +132,14 @@ procedure TOQLExplorerV2.aExportPASExecute(Sender: TObject);
var lFileName: string;
begin
if fOQLList.FileName = '' then
ShowMessage('Need to save file before generation.')
ShowMessage('You need to save before exporting.')
else
begin
InterfaceToSelectedOQL;
fOQLList.Save;
Screen.Cursor := crHourGlass;
try
memUnit.Lines.Text := fExplorer.Util.GerarUnitOQL(fOQLList.FileName);
memUnit.Lines.Text := GerarUnitOQL(fOQLList.FileName);
finally
Screen.Cursor := crDefault;
end;
......@@ -148,19 +154,298 @@ begin
end;
end;
function TOQLExplorerV2.GerarUnitOQL(piXMLFileName: String): string;
procedure AddText(piStringStream: TStringStream; piIndent: integer = 0; piText: string = '');
begin
piText := StringOfChar(' ', piIndent) + piText;
piStringStream.WriteString(concat(piText,#13#10));
end;
var
lUnit: TStringStream;
lFieldOQLFile, lFieldOQL: utField;
lAux: TStringList;
lOQLName, lOQLQuery: string;
lEnum, lEnumParams: acEnumerator;
lOQLParam: acOQLParam;
lOQLtoSQLTranslator: acOQLtoSQLTranslator;
lQueryParams: acQueryParams;
lFileName: string;
lOQLType: integer;
lSQL: string;
begin
if not FileExists(piXMLFileName) then
raise Exception.Create('File "' + piXMLFileName + '" does not exist');
lUnit := TStringStream.Create('');
try
lFieldOQLFile := utField.Create;
try
lAux := TStringList.Create;
try
lAux.LoadFromFile(piXMLFileName);
lFieldOQLFile.LoadFieldFromXMLString(lAux.Text);
finally
lAux.free;
end;
lFileName := ExtractFileName(piXMLFileName);
lFileName := LeftStr(lFileName, pos('.', lFileName) - 1);
AddText(lUnit, 0, 'unit utu' + lFileName + ';');
AddText(lUnit);
AddText(lUnit, 0, 'interface');
AddText(lUnit);
AddText(lUnit, 0, 'uses acuOQL, acuFramework;');
AddText(lUnit);
AddText(lUnit, 0, 'type');
AddText(lUnit);
lEnum := lFieldOQLFile.GetFieldsEnumerator;
try
//OQL Interfaces
while not lEnum.EOL do
begin
lFieldOQL := utField(lEnum.Current);
if not lFieldOQL.HasAttribute('name') then raise Exception.Create('Attribute "name" not found for OQL. Not a valid XML OQL file.');
lOQLName := lFieldOQL.AttributeByName('name').AsString;
if not lFieldOQL.HasField('query') then raise Exception.Create('Field "query" not found for OQL. Not a valid XML OQL file.');
lOQLQuery := lFieldOQL.FieldByName('query').AsString;
//Default cOQLQuery
lOQLType := cOQLQuery;
if lFieldOQL.HasAttribute('oqltype') then
lOQLType := lFieldOQL.AttributeByName('oqltype').AsInteger;
case lOQLType of
cDataSetOQLDataSet: AddText(lUnit, 2, 'I' + lOQLName + ' = interface(IDataSetOQLQuery)');
else AddText(lUnit, 2, 'I' + lOQLName + ' = interface(IOQLQuery)');
end;
lQueryParams := acQueryParams.Create;
try
lOQLtoSQLTranslator := acOQLtoSQLTranslator.Create(fExplorer.Util.MetaModelPersistenceMap);
try
case lOQLType of
cDataSetOQLDataSet:
begin
lSQL := lOQLtoSQLTranslator.TranslateOQLtoSQL(lOQLQuery, fExplorer.SQLDialect, fExplorer.Schema, acQueryResultKind.qrkDataSet, lQueryParams);
end;
else
begin
lSQL := lOQLtoSQLTranslator.TranslateOQLtoSQL(lOQLQuery, fExplorer.SQLDialect, fExplorer.Schema, acQueryResultKind.qrkObject, lQueryParams);
end;
end;
finally
lOQLtoSQLTranslator.Free;
end;
lEnumParams := lQueryParams.GetEnumerator;
try
while not lEnumParams.EOL do
begin
lOQLParam := acOQLParam(lEnumParams.Current);
AddText(lUnit, 4, 'function Param_' + lOQLParam.Name + ': ' + lOQLParam.ClassName + ';');
lEnumParams.MoveNext;
end;
finally
lEnumParams.free;
end;
AddText(lUnit, 2, 'end;');
AddText(lUnit);
finally
lQueryParams.Free;
end;
lEnum.MoveNext;
end;
//Factory Class Interface
AddText(lUnit, 2, 'ut' + lFileName + ' = class');
lEnum.MoveFirst;
while not lEnum.EOL do
begin
lFieldOQL := utField(lEnum.Current);
lOQLName := lFieldOQL.AttributeByName('name').AsString;
AddText(lUnit, 4, 'class function ' + lOQLName + '(piSessao: acPersistenceSession): ' + 'I' + lOQLName + ';');
lEnum.MoveNext;
end;
AddText(lUnit, 2, 'end;');
AddText(lUnit);
AddText(lUnit, 0, 'implementation');
AddText(lUnit);
AddText(lUnit, 0, 'type');
AddText(lUnit);
//OQL Types
lEnum.MoveFirst;
while not lEnum.EOL do
begin
lFieldOQL := utField(lEnum.Current);
lOQLName := lFieldOQL.AttributeByName('name').AsString;
lOQLQuery := lFieldOQL.FieldByName('query').AsString;
//Default cOQLQuery
lOQLType := cOQLQuery;
if lFieldOQL.HasAttribute('oqltype') then
lOQLType := lFieldOQL.AttributeByName('oqltype').AsInteger;
case lOQLType of
cDataSetOQLDataSet: AddText(lUnit, 2, 'T' + lOQLName + ' = class(acDataSetOQLQuery, ' + 'I' + lOQLName + ')');
else AddText(lUnit, 2, 'T' + lOQLName + ' = class(acOQLQuery, ' + 'I' + lOQLName + ')');
end;
lQueryParams := acQueryParams.Create;
try
lOQLtoSQLTranslator := acOQLtoSQLTranslator.Create(fExplorer.Util.MetaModelPersistenceMap);
try
case lOQLType of
cDataSetOQLDataSet:
begin
lSQL := lOQLtoSQLTranslator.TranslateOQLtoSQL(lOQLQuery, fExplorer.SQLDialect, fExplorer.Schema, acQueryResultKind.qrkDataSet, lQueryParams);
end;
else
begin
lSQL := lOQLtoSQLTranslator.TranslateOQLtoSQL(lOQLQuery, fExplorer.SQLDialect, fExplorer.Schema, acQueryResultKind.qrkObject, lQueryParams);
end;
end;
finally
lOQLtoSQLTranslator.Free;
end;
lEnumParams := lQueryParams.GetEnumerator;
try
while not lEnumParams.EOL do
begin
lOQLParam := acOQLParam(lEnumParams.Current);
AddText(lUnit, 4, 'function Param_' + lOQLParam.Name + ': ' + lOQLParam.ClassName + ';');
lEnumParams.MoveNext;
end;
finally
lEnumParams.free;
end;
AddText(lUnit, 2, 'end;');
AddText(lUnit);
finally
lQueryParams.Free;
end;
lEnum.MoveNext;
end;
//OQL Types Implementation
lEnum.MoveFirst;
while not lEnum.EOL do
begin
lFieldOQL := utField(lEnum.Current);
lOQLName := lFieldOQL.AttributeByName('name').AsString;
lOQLQuery := lFieldOQL.FieldByName('query').AsString;
//Default cOQLQuery
lOQLType := cOQLQuery;
if lFieldOQL.HasAttribute('oqltype') then
lOQLType := lFieldOQL.AttributeByName('oqltype').AsInteger;
AddText(lUnit, 0, '{ T' + lOQLName + ' }');
AddText(lUnit);
lQueryParams := acQueryParams.Create;
try
lOQLtoSQLTranslator := acOQLtoSQLTranslator.Create(fExplorer.Util.MetaModelPersistenceMap);
try
case lOQLType of
cDataSetOQLDataSet:
begin
lSQL := lOQLtoSQLTranslator.TranslateOQLtoSQL(lOQLQuery, fExplorer.SQLDialect, fExplorer.Schema, acQueryResultKind.qrkDataSet, lQueryParams);
end;
else
begin
lSQL := lOQLtoSQLTranslator.TranslateOQLtoSQL(lOQLQuery, fExplorer.SQLDialect, fExplorer.Schema, acQueryResultKind.qrkObject, lQueryParams);
end;
end;
finally
lOQLtoSQLTranslator.Free;
end;
lEnumParams := lQueryParams.GetEnumerator;
try
while not lEnumParams.EOL do
begin
lOQLParam := acOQLParam(lEnumParams.Current);
AddText(lUnit, 0, 'function T' + lOQLName + '.Param_' + lOQLParam.Name + ': ' + lOQLParam.ClassName + ';');
AddText(lUnit, 0,'begin');
AddText(lUnit, 2,'result := ' + lOQLParam.ClassName + '(Self.ParamByName(' + QuotedStr(lOQLParam.Name) + '));');
AddText(lUnit, 0,'end;');
AddText(lUnit);
lEnumParams.MoveNext;
end;
finally
lEnumParams.free;
end;
finally
lQueryParams.Free;
end;
lEnum.MoveNext;
end;
//Factory Class Implementation
AddText(lUnit, 0, '{ utOQLs }');
AddText(lUnit);
lEnum.MoveFirst;
while not lEnum.EOL do
begin
lFieldOQL := utField(lEnum.Current);
lOQLName := lFieldOQL.AttributeByName('name').AsString;
lOQLQuery := lFieldOQL.FieldByName('query').AsString;
AddText(lUnit, 0, 'class function ut' + lFileName + '.' + lOQLName + '(piSessao: acPersistenceSession): I' + lOQLName + ';');
AddText(lUnit, 0, 'begin');
AddText(lUnit, 2, 'result := T' + lOQLName + '.Create(pisessao,');
lOQLQuery := StringReplace(lOQLQuery, '''', '''''', [rfReplaceAll]);
lOQLQuery := StringReplace(lOQLQuery, #13#10, ''' + #13#10 +' + #13#10 + '''', [rfReplaceAll]);
AddText(lUnit, 0, '''' + lOQLQuery + ''');');
AddText(lUnit, 0, 'end;');
AddText(lUnit);
lEnum.MoveNext;
end;
finally
lEnum.free;
end;
AddText(lUnit, 0, 'end.');
result := lUnit.DataString;
finally
lFieldOQLFile.free;
end;
finally
lUnit.free;
end;
end;
procedure TOQLExplorerV2.aLoadFileExecute(Sender: TObject);
var
lM: integer;
lCancel: Boolean;
begin
lCancel := False;
if (lvOQLList.Items.Count > 1) or (edtName.Caption <> '_NEW_OQL_1') then
begin
lM := application.MessageBox('Save before open another file?', 'Attention', MB_ICONQUESTION + MB_YESNO);
case lM of
IDYES: aSaveFileExecute(Sender);
IDCANCEL: lCancel := True;
end;
end;
if not (lCancel) then
begin
......@@ -182,7 +467,7 @@ begin
end;
end;
finally
Caption := fOQLList.FileName;
Caption := 'Curió OQL Studio - ' + fOQLList.FileName;
UpdateOQLList;
end;
end;
......@@ -256,7 +541,7 @@ begin
lvOQLList.SortType := stText;
lvOQLList.SortType := stNone;
fOQLList.Save(lFileName);
Caption := lFileName;
Caption := 'Curió OQL Studio - ' + lFileName;
Application.MessageBox('File saved.', '', MB_ICONINFORMATION);
except
on E: Exception do
......@@ -296,11 +581,14 @@ end;
procedure TOQLExplorerV2.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
var lM: integer;
begin
if (lvOQLList.Items.Count > 1) or (edtName.Caption <> '_NEW_OQL_1') then
begin
lM := application.MessageBox('Save before close?', 'Attention', MB_ICONQUESTION + MB_YESNO);
case lM of
IDYES: aSaveFileExecute(sender);
IDCANCEL: CanClose := false;
end;
end;
end;
procedure TOQLExplorerV2.FormCreate(Sender: TObject);
......@@ -309,7 +597,7 @@ begin
lFileName := '';
fOQLList := utOQLFile.create(lFileName);
UpdateOQLList;
Caption := 'New...';
Caption := 'Curió OQL Studio';
end;
procedure TOQLExplorerV2.FormResize(Sender: TObject);
......@@ -337,9 +625,9 @@ procedure TOQLExplorerV2.InterfaceToSelectedOQL;
var lOQL: utOQL;
lErro: string;
begin
if Assigned(lvOQLList.Selected) and Assigned(fExplorer.SynEditOQL) then
if Assigned(fLastItem) and Assigned(fExplorer.SynEditOQL) then
begin
lOQL := utOQL(lvOQLList.Selected.Data);
lOQL := utOQL(fLastItem.Data);
lOQL.ID := edtName.Text;
lOQL.Description := edtDescription.Text;
lOQL.Query := fExplorer.SynEditOQL.Text;
......@@ -352,42 +640,40 @@ begin
if lErro = '' then
begin
if lOQL.OQLType = 1
then lvOQLList.Selected.ImageIndex := 1
else lvOQLList.Selected.ImageIndex := 0;
then fLastItem.ImageIndex := 1
else fLastItem.ImageIndex := 0;
end
else
lvOQLList.Selected.ImageIndex := 2;
lvOQLList.Selected.Caption := edtName.Text;
lvOQLList.Selected.SubItems[0] := lErro;
fLastItem.ImageIndex := 2;
fLastItem.Caption := edtName.Text;
fLastItem.SubItems[0] := lErro;
end;
end;
procedure TOQLExplorerV2.lvOQLListChange(Sender: TObject; Item: TListItem; Change: TItemChange);
begin
if assigned(fLastItem) and (fLastItem <> Item) then InterfaceToSelectedOQL;
SelectedOQLToInterface;
end;
procedure TOQLExplorerV2.lvOQLListChanging(Sender: TObject;Item: TListItem; Change: TItemChange; var AllowChange: Boolean);
begin
InterfaceToSelectedOQL;
end;
procedure TOQLExplorerV2.SelectedOQLToInterface;
var lOQL: utOQL;
begin
edtName.Text := '';
edtDescription.Text := '';
fExplorer.SynEditOQL.Text := '';
if Assigned(lvOQLList.Selected) and Assigned( fExplorer.SynEditOQL) then
begin
fExplorer.SynEditOQL.Text := '';
fLastItem := lvOQLList.Selected;
lOQL := utOQL(lvOQLList.Selected.Data);
edtName.Text := lOQL.ID;
edtDescription.Text := lOQL.Description;
fExplorer.SynEditOQL.Text := lOQL.Query;
memError.Text := lvOQLList.Selected.SubItems[0];
SetQueryType(lOQL.OQLType);
end;
lvOQLList.Column[0].Caption := 'OQL Name (' + IntToStr(fOQLList.Count) + ')';
end
else fLastItem := Nil;
lvOQLList.Column[0].Caption := 'OQL''s (' + IntToStr(fOQLList.Count) + ')';
end;
procedure TOQLExplorerV2.SetQueryType(piType: integer);
......@@ -446,7 +732,7 @@ begin
end;
function TOQLExplorerV2.ValidaQuery(piQuery: string; piOQLType: integer): string;
var lQuery: acAbstractOQLQuery;
var lOQLtoSQLTranslator: acOQLtoSQLTranslator;
begin
result := '';
if not fFlagFormClosing then
......@@ -454,21 +740,27 @@ begin
try
if Assigned(fExplorer) then
begin
// if Assigned(fExplorer.Session) then
// begin
// if piOQLType = 1 then
// lQuery := acDataSetOQLQuery.Create(fExplorer.Session, piQuery)
// else
// lQuery := acOQLQuery.Create(fExplorer.Session, piQuery);
// lQuery.Free;
// end;
lOQLtoSQLTranslator := acOQLtoSQLTranslator.Create(fExplorer.Util.MetaModelPersistenceMap);
try
case piOQLType of
cDataSetOQLDataSet:
begin
lOQLtoSQLTranslator.TranslateOQLtoSQL(piQuery, fExplorer.SQLDialect, fExplorer.Schema, acQueryResultKind.qrkDataSet);
end;
else
begin
lOQLtoSQLTranslator.TranslateOQLtoSQL(piQuery, fExplorer.SQLDialect, fExplorer.Schema, acQueryResultKind.qrkObject);
end;
end;
finally
lOQLtoSQLTranslator.Free;
end;
end;
except
on e:exception do
begin
Result := e.Message;
end;
end;
end;
end;
......
object itServiceParameters: TitServiceParameters
Left = 0
Height = 276
Top = 0
Width = 306
Left = 778
Height = 289
Top = 453
Width = 314
BorderStyle = bsDialog
Caption = 'Propriedades do Serviço'
ClientHeight = 276
ClientWidth = 306
Color = clBtnFace
ClientHeight = 289
ClientWidth = 314
ParentFont = True
Position = poDesktopCenter
Position = poScreenCenter
LCLVersion = '2.0.0.4'
object Panel2: TPanel
Left = 0
Height = 237
Height = 240
Top = 0
Width = 306
Width = 314
Align = alClient
ClientHeight = 237
ClientWidth = 306
ClientHeight = 240
ClientWidth = 314
TabOrder = 1
object GroupBox1: TGroupBox
Left = 6
Height = 77
Top = 3
Width = 296
ClientHeight = 70
ClientWidth = 288
ClientHeight = 75
ClientWidth = 294
TabOrder = 0
object Label2: TLabel
Left = 5
Height = 16
Height = 19
Top = 14
Width = 117
Width = 122
Caption = 'Nome do Servidor:'
ParentColor = False
end
object Label1: TLabel
Left = 11
Height = 16
Height = 19
Top = 42
Width = 111
Width = 116
Caption = 'Número da Porta:'
ParentColor = False
end
object edtServerName: TEdit
Left = 133
Height = 22
Height = 29
Top = 8
Width = 155
TabOrder = 0
end
object edtPortNumber: TEdit
Left = 133
Height = 22
Height = 29
Top = 36
Width = 155
TabOrder = 1
......@@ -63,20 +63,20 @@ object itServiceParameters: TitServiceParameters
Height = 48
Top = 88
Width = 296
ClientHeight = 41
ClientWidth = 288
ClientHeight = 46
ClientWidth = 294
TabOrder = 1
object Label3: TLabel
Left = 0
Height = 16
Height = 19
Top = 12
Width = 122
Width = 126
Caption = 'Código do Sistema:'
ParentColor = False
end
object edtSystemCode: TEdit
Left = 133
Height = 22
Height = 29
Top = 8
Width = 155
TabOrder = 0
......@@ -87,35 +87,35 @@ object itServiceParameters: TitServiceParameters
Height = 80
Top = 144
Width = 296
ClientHeight = 73
ClientWidth = 288
ClientHeight = 78
ClientWidth = 294
TabOrder = 2
object Label5: TLabel
Left = 9
Height = 16
Height = 19
Top = 12
Width = 113
Width = 117
Caption = 'Nome do Usuário:'
ParentColor = False
end
object Label4: TLabel
Left = 80
Height = 16
Height = 19
Top = 46
Width = 42
Width = 45
Caption = 'Senha:'
ParentColor = False
end
object edtUserName: TEdit
Left = 133
Height = 22
Height = 29
Top = 6
Width = 155
TabOrder = 0
end
object edtPassword: TEdit
Left = 133
Height = 22
Height = 29
Top = 40
Width = 155
EchoMode = emPassword
......@@ -126,18 +126,18 @@ object itServiceParameters: TitServiceParameters
end
object Panel1: TPanel
Left = 0
Height = 39
Top = 237
Width = 306
Height = 49
Top = 240
Width = 314
Align = alBottom
ClientHeight = 39
ClientWidth = 306
ClientHeight = 49
ClientWidth = 314
TabOrder = 0
object BitBtn1: TBitBtn
Left = 141
Height = 25
Left = 96
Height = 35
Top = 6
Width = 75
Width = 99
Anchors = [akTop, akLeft, akBottom]
Caption = 'Ok'
Kind = bkOK
......@@ -146,10 +146,10 @@ object itServiceParameters: TitServiceParameters
TabOrder = 0
end
object BitBtn2: TBitBtn
Left = 229
Height = 25
Left = 203
Height = 35
Top = 6
Width = 75
Width = 97
Anchors = [akTop, akLeft, akBottom]
Caption = 'Cancel'
Kind = bkCancel
......
......@@ -4,7 +4,7 @@ interface
uses
LCLType, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls;
Dialogs, StdCtrls, Buttons, ExtCtrls, cxuSession;
type
TitServiceParameters = class(TForm)
......@@ -27,6 +27,7 @@ type
Label4: TLabel;
procedure BitBtn1Click(Sender: TObject);
private
fSession: cxSession;
function GetPassword: string;
function GetPortNumber: integer;
function GetServerName: string;
......@@ -40,6 +41,7 @@ type
{ Private declarations }
public
{ Public declarations }
property Session: cxSession read fSession write fSession;
property ServerName: string read GetServerName write SetServerName;
property PortNumber: integer read GetPortNumber write SetPortNumber;
property SystemCode: integer read GetSystemCode write SetSystemCode;
......@@ -55,6 +57,7 @@ implementation
{ TServiceParameters }
procedure TitServiceParameters.BitBtn1Click(Sender: TObject);
var lConnectioString: String;
begin
if edtServerName.Text = '' then
begin
......@@ -79,7 +82,7 @@ begin
end;
try
strtoint(edtPortNumber.Text);
StrToInt(edtPortNumber.Text);
except
Application.MessageBox('Porta informada invlida.','Ateno', MB_ICONEXCLAMATION);
edtPortNumber.SetFocus;
......@@ -88,13 +91,29 @@ begin
end;
try
strtoint(edtSystemCode.Text);
StrToInt(edtSystemCode.Text);
except
Application.MessageBox('Cdigo do sistema informado invlido.','Ateno', MB_ICONEXCLAMATION);
edtSystemCode.SetFocus;
edtSystemCode.SelectAll;
modalresult := mrnone;
end;
try
lConnectioString := format('ServerName=%s;PortNumber=%d;SystemCode=%d;UserName=%s;Password=%s;',
[edtServerName.Caption, StrToInt(edtPortNumber.Caption),
StrToInt(edtSystemCode.Caption), edtUserName.Caption,
edtPassword.Caption]);
fSession := cxSession.Create(lConnectioString);
except
on e:Exception do
begin
Application.MessageBox(PCHAR(e.Message), 'Ateno', MB_ICONEXCLAMATION);
modalresult := mrnone;
end;
end;
end;
function TitServiceParameters.GetPassword: string;
......
object CadastroCasoDeUso: TCadastroCasoDeUso
Left = 0
Height = 395
Top = 0
Width = 781
Left = 902
Height = 456
Top = 226
Width = 782
BorderStyle = bsDialog
Caption = 'Cadastro de caso de uso'
ClientHeight = 395
ClientWidth = 781
Color = clBtnFace
ParentFont = True
Position = poDesktopCenter
Caption = 'Cadastro de Caso de Uso'
ClientHeight = 456
ClientWidth = 782
Position = poScreenCenter
LCLVersion = '2.0.0.4'
object pnPrincipal: TPanel
Left = 8
Height = 263
Top = 9
Width = 768
Left = 0
Height = 316
Top = 0
Width = 782
Align = alTop
BevelOuter = bvLowered
ClientHeight = 263
ClientWidth = 768
Color = 15658734
ClientHeight = 316
ClientWidth = 782
ParentColor = False
TabOrder = 0
object lblNome: TLabel
Left = 8
Height = 13
Height = 14
Top = 88
Width = 32
Width = 31
Caption = 'Nome'
Font.Color = clWindowText
Font.Height = -11
......@@ -36,9 +35,9 @@ object CadastroCasoDeUso: TCadastroCasoDeUso
end
object lblCodigo: TLabel
Left = 8
Height = 13
Height = 14
Top = 6
Width = 38
Width = 39
Caption = 'Código'
Font.Color = clWindowText
Font.Height = -11
......@@ -49,9 +48,9 @@ object CadastroCasoDeUso: TCadastroCasoDeUso
end
object lblDescricao: TLabel
Left = 8
Height = 13
Top = 131
Width = 54
Height = 14
Top = 140
Width = 55
Caption = 'Descrição'
Font.Color = clWindowText
Font.Height = -11
......@@ -62,9 +61,9 @@ object CadastroCasoDeUso: TCadastroCasoDeUso
end
object lblEntidade: TLabel
Left = 8
Height = 13
Top = 222
Width = 49
Height = 14
Top = 251
Width = 50
Caption = 'Entidade'
Font.Color = clWindowText
Font.Height = -11
......@@ -75,9 +74,9 @@ object CadastroCasoDeUso: TCadastroCasoDeUso
end
object lblCategoria: TLabel
Left = 8
Height = 13
Top = 176
Width = 53
Height = 14
Top = 193
Width = 56
Caption = 'Categoria'
Font.Color = clWindowText
Font.Height = -11
......@@ -88,18 +87,18 @@ object CadastroCasoDeUso: TCadastroCasoDeUso
end
object lblValorCodigo: TLabel
Left = 8
Height = 16
Height = 19
Top = 24
Width = 63
Width = 61
Caption = '<código>'
Layout = tlCenter
ParentColor = False
end
object Label1: TLabel
Left = 304
Height = 15
Height = 14
Top = 6
Width = 56
Width = 65
Caption = 'Operações'
Font.Color = clWindowText
Font.Height = -11
......@@ -109,10 +108,10 @@ object CadastroCasoDeUso: TCadastroCasoDeUso
ParentFont = False
end
object Label2: TLabel
Left = 437
Height = 15
Left = 538
Height = 14
Top = 6
Width = 48
Width = 56
Caption = 'Sistemas'
Font.Color = clWindowText
Font.Height = -11
......@@ -123,15 +122,15 @@ object CadastroCasoDeUso: TCadastroCasoDeUso
end
object edtNome: TEdit
Left = 8
Height = 22
Height = 31
Top = 103
Width = 289
TabOrder = 0
end
object cbxEntidade: TComboBox
Left = 8
Height = 20
Top = 237
Height = 37
Top = 270
Width = 289
AutoDropDown = True
ItemHeight = 0
......@@ -141,8 +140,8 @@ object CadastroCasoDeUso: TCadastroCasoDeUso
end
object cbxCategoria: TComboBox
Left = 8
Height = 20
Top = 193
Height = 37
Top = 212
Width = 289
AutoDropDown = True
ItemHeight = 0
......@@ -152,7 +151,7 @@ object CadastroCasoDeUso: TCadastroCasoDeUso
end
object ltvSistema: TListView
Left = 536
Height = 233
Height = 280
Top = 24
Width = 232
AutoWidthLastColumn = True
......@@ -160,14 +159,15 @@ object CadastroCasoDeUso: TCadastroCasoDeUso
Columns = <
item
Caption = 'Sistemas'
Width = 226
Width = 230
end>
ScrollBars = ssAutoBoth
SortType = stText
TabOrder = 5
end
object ltvOperacao: TListView
Left = 304
Height = 233
Height = 280
Top = 24
Width = 224
AutoWidthLastColumn = True
......@@ -175,31 +175,32 @@ object CadastroCasoDeUso: TCadastroCasoDeUso
Columns = <
item
Caption = 'Operações'
Width = 218
Width = 222
end>
ScrollBars = ssAutoBoth
SortType = stText
TabOrder = 4
end
object edtDescricao: TEdit
Left = 8
Height = 22
Top = 146
Height = 31
Top = 155
Width = 289
TabOrder = 1
end
object GroupBox1: TGroupBox
Left = 209
Left = 226
Height = 90
Top = 6
Width = 88
Width = 71
Caption = 'Ícone'
ClientHeight = 68
ClientWidth = 80
ClientHeight = 70
ClientWidth = 69
TabOrder = 6
object Label5: TLabel
Left = 20
Left = 17
Height = 28
Top = 24
Top = 22
Width = 37
Alignment = taCenter
AutoSize = False
......@@ -216,28 +217,29 @@ object CadastroCasoDeUso: TCadastroCasoDeUso
end
object imgIcone: TImage
Cursor = crHandPoint
Left = 8
Height = 55
Top = 8
Width = 63
Left = 5
Height = 60
Top = 5
Width = 60
Center = True
OnClick = imgIconeClick
end
end
end
object Panel1: TPanel
Left = 220
Height = 56
Top = 288
Width = 556
ClientHeight = 56
ClientWidth = 556
TabOrder = 2
Left = 0
Height = 74
Top = 316
Width = 782
Align = alTop
ClientHeight = 74
ClientWidth = 782
TabOrder = 1
object Label3: TLabel
Left = 8
Height = 13
Top = 7
Width = 198
Left = 225
Height = 14
Top = 13
Width = 202
Caption = 'Destino para criação do caso de uso'
Font.Color = clWindowText
Font.Height = -11
......@@ -247,10 +249,10 @@ object CadastroCasoDeUso: TCadastroCasoDeUso
ParentFont = False
end
object btnSelecionarDestino: TSpeedButton
Left = 411
Height = 25
Top = 20
Width = 145
Left = 620
Height = 36
Top = 29
Width = 148
Caption = 'Selecionar destino'
Glyph.Data = {
36050000424D3605000000000000360400002800000010000000100000000100
......@@ -299,28 +301,26 @@ object CadastroCasoDeUso: TCadastroCasoDeUso
OnClick = btnSelecionarDestinoClick
end
object edtPackage: TEdit
Left = 8
Height = 22
Top = 23
Left = 225
Height = 29
Top = 29
Width = 393
Color = 15461355
ReadOnly = True
TabOrder = 0
end
end
object Panel2: TPanel
object edtUseCaseName: TEdit
Left = 8
Height = 56
Top = 288
Width = 206
ClientHeight = 56
ClientWidth = 206
Height = 29
Top = 29
Width = 198
TabOrder = 1
end
object Label4: TLabel
Left = 8
Height = 13
Top = 7
Width = 190
Height = 14
Top = 13
Width = 191
Caption = 'Nome no StarUML (case sensitive)'
Font.Color = clWindowText
Font.Height = -11
......@@ -329,42 +329,36 @@ object CadastroCasoDeUso: TCadastroCasoDeUso
ParentColor = False
ParentFont = False
end
object edtUseCaseName: TEdit
Left = 8
Height = 22
Top = 23
Width = 198
TabOrder = 0
end
end
object Panel3: TPanel
Left = 0
Height = 39
Top = 356
Width = 781
Height = 55
Top = 401
Width = 782
Align = alBottom
ClientHeight = 39
ClientWidth = 781
TabOrder = 3
ClientHeight = 55
ClientWidth = 782
TabOrder = 2
object BitBtn1: TBitBtn
Left = 613
Height = 25
Left = 649
Height = 40
Top = 6
Width = 75
Width = 120
Anchors = [akTop, akLeft, akBottom]
Caption = 'Ok'
Default = True
DefaultCaption = True
Kind = bkOK
ModalResult = 1
OnClick = btnSalvarClick
TabOrder = 0
end
object BitBtn2: TBitBtn
Left = 701
Height = 25
Left = 522
Height = 40
Top = 6
Width = 75
Width = 120
Anchors = [akTop, akLeft, akBottom]
Caption = 'Cancel'
Cancel = True
DefaultCaption = True
Kind = bkCancel
ModalResult = 2
TabOrder = 1
......
......@@ -19,6 +19,8 @@ type
TCadastroCasoDeUso = class(TForm)
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
edtUseCaseName: TEdit;
Label4: TLabel;
Panel3: TPanel;
pnPrincipal: TPanel;
lblNome: TLabel;
......@@ -41,9 +43,6 @@ type
edtPackage: TEdit;
Label3: TLabel;
btnSelecionarDestino: TSpeedButton;
Panel2: TPanel;
edtUseCaseName: TEdit;
Label4: TLabel;
Label5: TLabel;
procedure imgIconeClick(Sender: TObject);
procedure btnSelecionarDestinoClick(Sender: TObject);
......@@ -51,6 +50,7 @@ type
procedure SpeedButton1Click(Sender: TObject);
private
FOID: integer;
FContextField: utField;
fUMLUseCase: IUMLUseCase;
fFormIcones: TCadastroCasoDeUsoIcones;
fcxCadastroCasoDeUso: cxCadatroCasoDeUso;
......@@ -63,7 +63,8 @@ type
{ Private declarations }
public
{ Public declarations }
Constructor Create(Sender: TComponent; piConnectionString: string; piUseCase: IUMLUseCase); reintroduce;
Constructor Create(Sender: TComponent; piCadatroCasoDeUso: cxCadatroCasoDeUso; piUseCase: IUMLUseCase); reintroduce;
Destructor Destroy; override;
property UseCasePackage: IUMLPackage read fUseCasePackage write fUseCasePackage;
property UseCase: IUMLUseCase read fUMLUseCase;
......@@ -81,15 +82,21 @@ uses IntegracaoDelphiSUML;
type
CP1252String = type AnsiString(1252);
constructor TCadastroCasoDeUso.Create(Sender: TComponent; piConnectionString: string; piUseCase: IUMLUseCase);
constructor TCadastroCasoDeUso.Create(Sender: TComponent; piCadatroCasoDeUso: cxCadatroCasoDeUso; piUseCase: IUMLUseCase);
begin
inherited Create(sender);
fUMLUseCase := piUseCase;
fFormIcones := TCadastroCasoDeUsoIcones.Create(self);
fcxCadastroCasoDeUso := cxCadatroCasoDeUso.Create(piConnectionString);
fcxCadastroCasoDeUso := piCadatroCasoDeUso;
self.Initialize;
end;
destructor TCadastroCasoDeUso.Destroy;
begin
FreeAndNil(FContextField);
inherited Destroy;
end;
procedure TCadastroCasoDeUso.imgIconeClick(Sender: TObject);
begin
if fFormIcones.ShowModal = mrOk then
......@@ -101,27 +108,25 @@ begin
end;
procedure TCadastroCasoDeUso.Initialize;
var lField, lResponseField: utField;
lUseCaseCode: string;
var lUseCaseCode: string;
lRequestField, lResponseField: utField;
begin
//Retorna do caso de uso os atributos da classe
lResponseField := utField.Create;
try
lField := utField.Create;
fcxCadastroCasoDeUso.rmObtemContexto(lField, lResponseField);
SendToInterface(lResponseField);
finally
// lResponseField.free;
end;
FreeAndNil(FContextField);
FContextField := utField.Create;
lRequestField := utField.Create;
fcxCadastroCasoDeUso.rmObtemContexto(lRequestField, FContextField);
SendToInterface(FContextField);
if assigned(fUMLUseCase) then
begin
lField := utField.Create;
lRequestField := utField.Create;
lUseCaseCode := fUMLUseCase.GetTaggedValueAsString('DBMappings', 'DBUseCaseMap', 'Code');
lField.AddField('CODIGO').AsString := lUseCaseCode;
lRequestField.AddField('CODIGO').AsString := lUseCaseCode;
lResponseField := utField.Create;
try
fcxCadastroCasoDeUso.rmEditaObjeto(lField, lResponseField);
fcxCadastroCasoDeUso.rmEditaObjeto(lRequestField, lResponseField);
SendToInterface(lResponseField);
finally
lResponseField.free;
......@@ -135,8 +140,8 @@ begin
begin
lResponseField := utField.Create;
try
lField := utField.Create;
fcxCadastroCasoDeUso.rmIncluiObjeto(lField, lResponseField);
lRequestField := utField.Create;
fcxCadastroCasoDeUso.rmIncluiObjeto(lRequestField, lResponseField);
SendToInterface(lResponseField);
finally
lResponseField.free;
......@@ -162,19 +167,19 @@ begin
// lFieldCasoDeUso.AddAttribute('OID').AsInteger := FOID;
lFieldCasoDeUso.AddAttribute('nome').AsString := edtNome.Text;
lFieldCasoDeUso.AddAttribute('descricao').AsString := edtDescricao.Text;
if cbxEntidade.ItemIndex <> -1 then lFieldCasoDeUso.AddAttribute('idoentidade').AsInteger := integer(cbxEntidade.Items.Objects[cbxEntidade.ItemIndex]);
if cbxCategoria.ItemIndex <> -1 then lFieldCasoDeUso.AddAttribute('idocategoria').AsInteger := integer(cbxCategoria.Items.Objects[cbxCategoria.ItemIndex]);
if assigned(fFormIcones.ltvIcones.Selected) then lFieldCasoDeUso.AddAttribute('idoicone').AsInteger := integer(fFormIcones.ltvIcones.Selected.Data);
if cbxEntidade.ItemIndex <> -1 then lFieldCasoDeUso.AddAttribute('idoentidade').AsInteger := utAttribute(cbxEntidade.Items.Objects[cbxEntidade.ItemIndex]).AsInteger;
if cbxCategoria.ItemIndex <> -1 then lFieldCasoDeUso.AddAttribute('idocategoria').AsInteger := utAttribute(cbxCategoria.Items.Objects[cbxCategoria.ItemIndex]).AsInteger;
if assigned(fFormIcones.ltvIcones.Selected) then lFieldCasoDeUso.AddAttribute('idoicone').AsInteger := utAttribute(fFormIcones.ltvIcones.Selected.Data).AsInteger;
lFieldSistemas := lFieldCasoDeUso.AddField('sistemas');
for I := 0 to ltvSistema.Items.Count - 1 do
if ltvSistema.Items[i].Checked then
lFieldSistemas.AddField('ido').AsInteger := integer(ltvSistema.Items[i].Data);
lFieldSistemas.AddField('ido').AsInteger := utAttribute(ltvSistema.Items[i].Data).AsInteger;
lFieldOperacoes := lFieldCasoDeUso.AddField('operacoes');
for I := 0 to ltvOperacao.Items.Count - 1 do
if ltvOperacao.Items[i].Checked then
lFieldOperacoes.AddField('ido').AsInteger := integer(ltvOperacao.Items[i].Data);
lFieldOperacoes.AddField('ido').AsInteger := utAttribute(ltvOperacao.Items[i].Data).AsInteger;
end;
procedure TCadastroCasoDeUso.SendToInterface(piField: utField);
......@@ -392,7 +397,10 @@ begin
lElementSelector.ClearSelectableModels();
lElementSelector.AddSelectableModel('UMLPackage');
if lElementSelector.Execute('Selecione o local para criar o caso de uso') then
begin
UseCasePackage := lElementSelector.GetSelectedModel as IUMLPackage;
edtPackage.Text := UseCasePackage.PathName;
end;
end;
procedure TCadastroCasoDeUso.btnSalvarClick(Sender: TObject);
......@@ -414,12 +422,6 @@ begin
try
if assigned(fUMLUseCase) then
begin
// if (assigned(fUseCasePackage.FindByName(edtUseCaseName.Text))) and (edtUseCaseName.Text <> fUMLUseCase.Name) then
// begin
// application.MessageBox('Caso de uso j existente no pacote selecionado.','StarUML', MB_ICONEXCLAMATION + MB_OK);
// exit;
// end;
SalvaObjeto;
fUMLUseCase.Name := edtUseCaseName.Text;
end
......
object CadastroCasoDeUsoIcones: TCadastroCasoDeUsoIcones
Left = 0
Height = 405
Top = 0
Width = 497
Left = 726
Height = 412
Top = 329
Width = 501
Caption = 'Ícones'
ClientHeight = 405
ClientWidth = 497
Color = clBtnFace
ClientHeight = 412
ClientWidth = 501
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Position = poDesktopCenter
Position = poScreenCenter
LCLVersion = '2.0.0.4'
object Panel2: TPanel
Left = 0
Height = 366
Height = 357
Top = 0
Width = 497
Width = 501
Align = alClient
ClientHeight = 366
ClientWidth = 497
ClientHeight = 357
ClientWidth = 501
TabOrder = 0
object ltvIcones: TListView
Left = 1
Height = 364
Height = 355
Top = 1
Width = 495
Width = 499
Align = alClient
Columns = <
item
......@@ -32,7 +32,9 @@ object CadastroCasoDeUsoIcones: TCadastroCasoDeUsoIcones
Width = 10
end>
HideSelection = False
LargeImages = imgListaIcone
ReadOnly = True
ScrollBars = ssAutoBoth
SortType = stText
TabOrder = 0
ViewStyle = vsIcon
......@@ -41,31 +43,33 @@ object CadastroCasoDeUsoIcones: TCadastroCasoDeUsoIcones
end
object Panel1: TPanel
Left = 0
Height = 39
Top = 366
Width = 497
Height = 55
Top = 357
Width = 501
Align = alBottom
ClientHeight = 39
ClientWidth = 497
ClientHeight = 55
ClientWidth = 501
TabOrder = 1
object BitBtn1: TBitBtn
Left = 328
Height = 25
Top = 8
Width = 75
Left = 371
Height = 40
Top = 6
Width = 120
Anchors = [akTop, akLeft, akBottom]
Caption = 'Ok'
Default = True
DefaultCaption = True
Kind = bkOK
ModalResult = 1
TabOrder = 0
end
object BitBtn2: TBitBtn
Left = 416
Height = 25
Top = 8
Width = 75
Left = 244
Height = 40
Top = 6
Width = 120
Anchors = [akTop, akLeft, akBottom]
Caption = 'Cancel'
Cancel = True
DefaultCaption = True
Kind = bkCancel
ModalResult = 2
TabOrder = 1
......@@ -73,7 +77,7 @@ object CadastroCasoDeUsoIcones: TCadastroCasoDeUsoIcones
end
object imgListaIcone: TImageList
Height = 32
ShareImages = True
Scaled = True
Width = 32
left = 440
top = 56
......
object CadastroClasse: TCadastroClasse
Left = 0
Height = 313
Top = 0
Width = 503
Left = 308
Height = 345
Top = 249
Width = 504
BorderStyle = bsDialog
Caption = 'Cadastro de Classe'
ClientHeight = 313
ClientWidth = 503
Color = clBtnFace
ParentFont = True
Position = poDesktopCenter
ClientHeight = 345
ClientWidth = 504
Position = poScreenCenter
LCLVersion = '2.0.0.4'
object Panel1: TPanel
Left = 0
Height = 313
Height = 345
Top = 0
Width = 503
Width = 504
Align = alClient
ClientHeight = 313
ClientWidth = 503
ClientHeight = 345
ClientWidth = 504
TabOrder = 0
object Panel3: TPanel
Left = 6
Height = 123
Top = 141
Width = 490
ClientHeight = 123
ClientWidth = 490
Left = 1
Height = 130
Top = 140
Width = 502
Align = alTop
ClientHeight = 130
ClientWidth = 502
TabOrder = 2
object Panel5: TPanel
Left = 0
Height = 48
Height = 103
Top = 16
Width = 200
ClientHeight = 48
ClientHeight = 103
ClientWidth = 200
TabOrder = 0
object Label4: TLabel
Left = 8
Height = 13
Height = 14
Top = 5
Width = 153
Caption = 'Nome da classe no StarUML'
......@@ -50,7 +50,7 @@ object CadastroClasse: TCadastroClasse
end
object edtNomeStarUML: TEdit
Left = 8
Height = 22
Height = 29
Top = 21
Width = 184
TabOrder = 0
......@@ -58,39 +58,39 @@ object CadastroClasse: TCadastroClasse
end
object GroupBox1: TGroupBox
Left = 216
Height = 96
Height = 103
Top = 16
Width = 270
Caption = 'DB Mappings'
ClientHeight = 74
ClientWidth = 262
ClientHeight = 83
ClientWidth = 268
TabOrder = 1
object Label1: TLabel
Left = 6
Height = 16
Height = 19
Top = 14
Width = 39
Width = 41
Caption = 'Table:'
ParentColor = False
end
object Label2: TLabel
Left = 0
Height = 16
Height = 19
Top = 47
Width = 45
Width = 51
Caption = 'DBIDO:'
ParentColor = False
end
object edtDBTableName: TEdit
Left = 46
Height = 22
Height = 29
Top = 8
Width = 210
TabOrder = 0
end
object edtDBIDO: TEdit
Left = 46
Height = 22
Height = 29
Top = 41
Width = 210
TabOrder = 1
......@@ -98,18 +98,19 @@ object CadastroClasse: TCadastroClasse
end
end
object Panel2: TPanel
Left = 6
Height = 56
Top = 79
Width = 490
ClientHeight = 56
ClientWidth = 490
Left = 1
Height = 65
Top = 75
Width = 502
Align = alTop
ClientHeight = 65
ClientWidth = 502
TabOrder = 1
object Label3: TLabel
Left = 7
Height = 13
Height = 14
Top = 8
Width = 167
Width = 171
Caption = 'Destino para criação da classe'
Font.Color = clWindowText
Font.Height = -11
......@@ -120,8 +121,8 @@ object CadastroClasse: TCadastroClasse
end
object btnSelecionarDestino: TSpeedButton
Left = 333
Height = 25
Top = 20
Height = 34
Top = 24
Width = 151
Caption = 'Selecionar destino'
Glyph.Data = {
......@@ -172,7 +173,7 @@ object CadastroClasse: TCadastroClasse
end
object edtPackage: TEdit
Left = 7
Height = 22
Height = 29
Top = 23
Width = 321
Color = 15461355
......@@ -181,18 +182,19 @@ object CadastroClasse: TCadastroClasse
end
end
object Panel4: TPanel
Left = 6
Height = 66
Top = 8
Width = 490
ClientHeight = 66
ClientWidth = 490
Left = 1
Height = 74
Top = 1
Width = 502
Align = alTop
ClientHeight = 74
ClientWidth = 502
TabOrder = 0
object lblNome: TLabel
Left = 97
Height = 13
Height = 14
Top = 13
Width = 122
Width = 124
Caption = 'Nome (case sensitive)'
Font.Color = clWindowText
Font.Height = -11
......@@ -203,17 +205,17 @@ object CadastroClasse: TCadastroClasse
end
object lblValorCodigo: TLabel
Left = 9
Height = 16
Height = 19
Top = 32
Width = 93
Width = 97
Caption = 'lblValorCodigo'
ParentColor = False
end
object lblCodigo: TLabel
Left = 9
Height = 13
Height = 14
Top = 13
Width = 38
Width = 39
Caption = 'Código'
Font.Color = clWindowText
Font.Height = -11
......@@ -224,7 +226,7 @@ object CadastroClasse: TCadastroClasse
end
object edtNome: TEdit
Left = 96
Height = 22
Height = 29
Top = 32
Width = 390
OnChange = edtNomeChange
......@@ -233,32 +235,33 @@ object CadastroClasse: TCadastroClasse
end
object Panel7: TPanel
Left = 1
Height = 39
Top = 273
Width = 501
Height = 55
Top = 289
Width = 502
Align = alBottom
ClientHeight = 39
ClientWidth = 501
ClientHeight = 55
ClientWidth = 502
TabOrder = 3
object BitBtn1: TBitBtn
Left = 328
Height = 25
Left = 369
Height = 40
Top = 8
Width = 75
Width = 120
Anchors = [akTop, akLeft, akBottom]
Caption = 'Ok'
Default = True
DefaultCaption = True
Kind = bkOK
ModalResult = 1
OnClick = btnSalvarClick
TabOrder = 0
end
object BitBtn2: TBitBtn
Left = 416
Height = 25
Left = 242
Height = 40
Top = 8
Width = 75
Width = 120
Anchors = [akTop, akLeft, akBottom]
Caption = 'Cancel'
Cancel = True
DefaultCaption = True
Kind = bkCancel
ModalResult = 2
TabOrder = 1
......
......@@ -56,7 +56,7 @@ type
procedure Initialize;
public
{ Public declarations }
Constructor Create(Sender: TComponent; piConnectionString: string; piUMLClass: IUMLCLass); reintroduce;
Constructor Create(Sender: TComponent; piCadastroClasse: cxCadastroClasse; piUMLClass: IUMLCLass); reintroduce;
property ClassPackage: IUMLPackage read fClassPackage write fClassPackage;
property UMLClass: IUMLClass read fUMLClass write fUMLClass;
......@@ -73,7 +73,7 @@ uses IntegracaoDelphiSUML;
{ TCadastroClasse }
constructor TCadastroClasse.Create(Sender: TComponent; piConnectionString: string; piUMLClass: IUMLCLass);
constructor TCadastroClasse.Create(Sender: TComponent; piCadastroClasse: cxCadastroClasse; piUMLClass: IUMLCLass);
begin
inherited Create(sender);
......@@ -83,7 +83,7 @@ begin
edtDBIDO.Text := fUMLClass.GetTaggedValueAsString('DBMappings', 'DBClassMap', 'DBIDO');
edtDBTableName.Text := fUMLClass.GetTaggedValueAsString('DBMappings', 'DBClassMap', 'Table');
end;
fcxCadastroClasse := cxCadastroClasse.Create(piConnectionString);
fcxCadastroClasse := piCadastroClasse;
self.Initialize;
end;
......@@ -94,17 +94,17 @@ var lUMLFactory: IUMLFactory;
begin
if edtNomeStarUML.Text = '' then
begin
application.MessageBox(' necessrio informar o nome da classe no StarUML.','StarUML', MB_ICONEXCLAMATION + MB_OK);
application.MessageBox('É necessário informar o nome da classe no StarUML.','StarUML', MB_ICONEXCLAMATION + MB_OK);
exit;
end else
if edtPackage.Text = '' then
begin
application.MessageBox(' necessrio informar o package onde ser criado o caso de uso.','StarUML', MB_ICONEXCLAMATION + MB_OK);
application.MessageBox('É necessário informar o package onde será criado o caso de uso.','StarUML', MB_ICONEXCLAMATION + MB_OK);
exit;
end;
try
//Se em modo de edio (classe j criada)
//Se em modo de edição (classe já criada)
if assigned(fUMLClass) then
begin
SalvaObjeto;
......@@ -114,10 +114,10 @@ begin
end
else
begin
//Seno cria o objeto no StarUML e salva no caso de uso
//Senão cria o objeto no StarUML e salva no caso de uso
if assigned(fClassPackage.FindByName(edtNomeStarUML.Text)) then
begin
application.MessageBox('Classe j existente no pacote selecionado.','StarUML', MB_ICONEXCLAMATION + MB_OK);
application.MessageBox('Classe já existente no pacote selecionado.','StarUML', MB_ICONEXCLAMATION + MB_OK);
exit;
end;
......@@ -158,8 +158,11 @@ begin
lElementSelector.ClearSelectableModels();
lElementSelector.AddSelectableModel('UMLPackage');
lElementSelector.AddSelectableModel('UMLModel');
if lElementSelector.Execute('Selecione o local para criar o caso de uso') then
if lElementSelector.Execute('Selecione o local para criar a classe') then
begin
ClassPackage := lElementSelector.GetSelectedModel as IUMLPackage;
edtPackage.caption := ClassPackage.PathName;
end;
end;
procedure TCadastroClasse.edtNomeChange(Sender: TObject);
......@@ -182,8 +185,8 @@ var lField, lResponseField: utField;
lClassCode: string;
begin
FOID := -1;
//Se for edio, seta o contexto no caso de uso (cadastro de classe )para a classe corrente
// atraves do cdigo
//Se for edição, seta o contexto no caso de uso (cadastro de classe )para a classe corrente
// atraves do código
if assigned(fUMLClass) then
begin
lField := utField.Create;
......
object fDBAttributeParameters: TfDBAttributeParameters
Left = 0
Height = 359
Top = 0
Height = 353
Top = 27
Width = 348
BorderStyle = bsDialog
Caption = 'fDBAttributeParameters'
ClientHeight = 359
ClientHeight = 353
ClientWidth = 348
Color = clBtnFace
Font.Color = clWindowText
......@@ -44,7 +44,7 @@ object fDBAttributeParameters: TfDBAttributeParameters
object Panel2: TPanel
Left = 0
Height = 44
Top = 315
Top = 309
Width = 348
Align = alBottom
ClientHeight = 44
......@@ -52,7 +52,7 @@ object fDBAttributeParameters: TfDBAttributeParameters
TabOrder = 1
object ckbCheckLength: TCheckBox
Left = 9
Height = 33
Height = 23
Top = 6
Width = 88
Caption = 'Check length'
......@@ -98,11 +98,11 @@ object fDBAttributeParameters: TfDBAttributeParameters
end
object Panel3: TPanel
Left = 0
Height = 288
Height = 282
Top = 27
Width = 348
Align = alClient
ClientHeight = 288
ClientHeight = 282
ClientWidth = 348
TabOrder = 0
object GroupBox1: TGroupBox
......@@ -111,14 +111,14 @@ object fDBAttributeParameters: TfDBAttributeParameters
Top = 6
Width = 323
Caption = 'Attribute (StarUML)'
ClientHeight = 85
ClientWidth = 323
ClientHeight = 70
ClientWidth = 321
TabOrder = 0
object Label5: TLabel
Left = 12
Height = 16
Top = 54
Width = 33
Width = 32
Caption = 'Type:'
Font.Color = clWindowText
Font.Height = -13
......@@ -140,13 +140,13 @@ object fDBAttributeParameters: TfDBAttributeParameters
end
object cbbStarUMLTypes: TComboBox
Left = 52
Height = 24
Height = 28
Top = 50
Width = 249
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Tahoma'
ItemHeight = 16
ItemHeight = 0
OnClick = cbbStarUMLTypesClick
ParentFont = False
Style = csDropDownList
......@@ -154,7 +154,7 @@ object fDBAttributeParameters: TfDBAttributeParameters
end
object edtAttributeName: TEdit
Left = 52
Height = 24
Height = 33
Top = 20
Width = 249
Font.Color = clWindowText
......@@ -171,8 +171,8 @@ object fDBAttributeParameters: TfDBAttributeParameters
Top = 97
Width = 323
Caption = 'DB Mappings'
ClientHeight = 184
ClientWidth = 323
ClientHeight = 169
ClientWidth = 321
TabOrder = 1
object Label1: TLabel
Left = 16
......@@ -190,7 +190,7 @@ object fDBAttributeParameters: TfDBAttributeParameters
Left = 21
Height = 16
Top = 62
Width = 33
Width = 32
Caption = 'Type:'
Font.Color = clWindowText
Font.Height = -13
......@@ -224,7 +224,7 @@ object fDBAttributeParameters: TfDBAttributeParameters
end
object lblAttLength: TLabel
Left = 290
Height = 13
Height = 14
Top = 35
Width = 58
Caption = 'lblAttLength'
......@@ -232,9 +232,9 @@ object fDBAttributeParameters: TfDBAttributeParameters
end
object ckbMand: TCheckBox
Left = 18
Height = 17
Height = 23
Top = 159
Width = 97
Width = 86
Caption = 'Mandatory'
Font.Color = clWindowText
Font.Height = -13
......@@ -244,7 +244,7 @@ object fDBAttributeParameters: TfDBAttributeParameters
end
object edtName: TEdit
Left = 67
Height = 24
Height = 33
Top = 29
Width = 214
Font.Color = clWindowText
......@@ -256,7 +256,7 @@ object fDBAttributeParameters: TfDBAttributeParameters
end
object edtFSize: TEdit
Left = 67
Height = 24
Height = 33
Top = 89
Width = 78
Font.Color = clWindowText
......@@ -267,7 +267,7 @@ object fDBAttributeParameters: TfDBAttributeParameters
end
object edtVSize: TEdit
Left = 67
Height = 24
Height = 33
Top = 119
Width = 78
Font.Color = clWindowText
......@@ -284,7 +284,7 @@ object fDBAttributeParameters: TfDBAttributeParameters
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Tahoma'
ItemHeight = 16
ItemHeight = 0
Items.Strings = (
'CHAR'
'DATETIME'
......@@ -302,9 +302,9 @@ object fDBAttributeParameters: TfDBAttributeParameters
end
object ckbIsAuditable: TCheckBox
Left = 154
Height = 17
Height = 23
Top = 159
Width = 97
Width = 80
Caption = 'IsAuditable'
TabOrder = 5
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment