Skip to content

Commit

Permalink
draft
Browse files Browse the repository at this point in the history
Issue #73
  • Loading branch information
rsoika committed Sep 22, 2022
1 parent 97bdf1e commit b395216
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import {
EditModeListener,
EditorContextService,
EnableDefaultToolsAction,
EnableToolsAction,
hasArguments,
EnableToolsAction,SModelElement,
hasArguments,MouseListener,
SetUIExtensionVisibilityAction,
SModelRoot,
TYPES
Expand All @@ -39,17 +39,13 @@ import { vanillaCells, vanillaRenderers } from '@jsonforms/vanilla-renderers';
import * as React from 'react';
import * as ReactDOM from 'react-dom';

// import RatingControl from './RatingControl';
// import ratingControlTester from './ratingControlTester';
// import {BPMNEventDefinitionRenderer} from './EventDefinitionRenderer';
//import {BPMNArrayRenderer} from './BPMNArrayRenderer';

@injectable()
export class EnableBPMNPropertyPanelAction implements Action {
static readonly KIND = 'enableBPMNPropertyPanel';
readonly kind = EnableBPMNPropertyPanelAction.KIND;
}


@injectable()
export class BPMNPropertyPanel extends AbstractUIExtension implements EditModeListener, SelectionListener {
static readonly ID = 'bpmn-property-panel';
Expand All @@ -71,6 +67,7 @@ export class BPMNPropertyPanel extends AbstractUIExtension implements EditModeLi

@postConstruct()
postConstruct(): void {
console.log('...running postConstruct');
this.editorContext.register(this);
this.selectionService.register(this);
}
Expand All @@ -82,14 +79,15 @@ export class BPMNPropertyPanel extends AbstractUIExtension implements EditModeLi
return BPMNPropertyPanel.ID;
}

override initialize(): boolean {
return super.initialize();
}
// override initialize(): boolean {
// return super.initialize();
// }

/*
* Initalize the elemnts of property panel
*/
protected initializeContents(_containerElement: HTMLElement): void {
protected override initializeContents(_containerElement: HTMLElement): void {
console.log('...running initializeContents');
this.createHeader();
this.createBody();
}
Expand Down Expand Up @@ -130,6 +128,7 @@ export class BPMNPropertyPanel extends AbstractUIExtension implements EditModeLi
* https://microsoft.github.io/vscode-codicons/dist/codicon.html
*/
private createHeaderTools(): HTMLElement {
console.log('...running createHeaderTools');
const headerTools = document.createElement('div');
headerTools.classList.add('header-tools');

Expand Down Expand Up @@ -300,3 +299,17 @@ export function createIcon(codiconId: string): HTMLElement {
icon.classList.add(...codiconCSSClasses(codiconId));
return icon;
}


@injectable()
export class BPMNPropertyMouseListener extends MouseListener {
@inject(BPMNPropertyPanel)
protected readonly proprtyPanel: BPMNPropertyPanel;

override doubleClick(target: SModelElement, event: MouseEvent): (Action | Promise<Action>)[] {
console.log("...we have a double click");
// TODO your implementation
// this can return an action or get other services injected and call them on double-click
return [];
}
}
3 changes: 2 additions & 1 deletion open-bpmn.glsp-client/open-bpmn-properties/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
********************************************************************************/
import { TYPES } from '@eclipse-glsp/client';
import { ContainerModule } from 'inversify';
import { BPMNPropertyPanel } from './bpmn-property-panel';
import { BPMNPropertyPanel,BPMNPropertyMouseListener } from './bpmn-property-panel';
// css styles
import '../css/bpmn-properties.css';
import '../css/jsonforms-theia.css';

export const bpmnPropertyModule = new ContainerModule((bind, unbind, isBound,rebind) => {
bind(BPMNPropertyPanel).toSelf().inSingletonScope();
bind(TYPES.IUIExtension).toService(BPMNPropertyPanel);
bind(TYPES.MouseListener).to(BPMNPropertyMouseListener);
});

0 comments on commit b395216

Please sign in to comment.