From: Mathieu Baudier Date: Sun, 28 Oct 2018 17:52:21 +0000 (+0100) Subject: Move Nebula Editor tests to RAP specific X-Git-Tag: argeo-commons-2.1.76~34 X-Git-Url: https://git.argeo.org/?p=lgpl%2Fargeo-commons.git;a=commitdiff_plain;h=9b98c6de943ac2e5b6c258566252d9fd15483a0a Move Nebula Editor tests to RAP specific --- diff --git a/org.argeo.cms.e4.rap/bnd.bnd b/org.argeo.cms.e4.rap/bnd.bnd index 61e39b09f..32ff6d1f1 100644 --- a/org.argeo.cms.e4.rap/bnd.bnd +++ b/org.argeo.cms.e4.rap/bnd.bnd @@ -10,4 +10,5 @@ org.eclipse.swt.graphics,\ org.eclipse.e4.ui.workbench,\ org.eclipse.rap.rwt.client,\ org.argeo.cms.script,\ +org.eclipse.nebula.widgets.richtext;resolution:=optional,\ * diff --git a/org.argeo.cms.e4.rap/e4xmi/cms-demo-rap.e4xmi b/org.argeo.cms.e4.rap/e4xmi/cms-demo-rap.e4xmi new file mode 100644 index 000000000..36064f041 --- /dev/null +++ b/org.argeo.cms.e4.rap/e4xmi/cms-demo-rap.e4xmi @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/CmsE4DemoApp.java b/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/CmsE4DemoApp.java index 358980b08..2987e4da3 100644 --- a/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/CmsE4DemoApp.java +++ b/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/CmsE4DemoApp.java @@ -3,7 +3,7 @@ package org.argeo.cms.e4.rap; public class CmsE4DemoApp extends AbstractRapE4App { public CmsE4DemoApp() { setPageTitle("CMS Demo"); - setE4Xmi("org.argeo.cms.e4/e4xmi/cms-demo.e4xmi"); + setE4Xmi("org.argeo.cms.e4.rap/e4xmi/cms-demo-rap.e4xmi"); setPath("/cms-e4"); } diff --git a/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/parts/CkEditor-removeButtons.js b/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/parts/CkEditor-removeButtons.js new file mode 100644 index 000000000..20e82e34a --- /dev/null +++ b/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/parts/CkEditor-removeButtons.js @@ -0,0 +1 @@ +'Source,Save,Templates,Strike,Subscript,Superscript,CopyFormatting,Outdent,Indent,CreateDiv,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,Language,Anchor,Flash,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,Format,Font,FontSize,BGColor,TextColor,ShowBlocks,About,Preview,Print,Redo,Replace,Find,Undo,SelectAll,Scayt,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,NewPage,PasteFromWord,Blockquote,BidiLtr,BidiRtl' \ No newline at end of file diff --git a/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/parts/CkEditor-toolbar.js b/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/parts/CkEditor-toolbar.js new file mode 100644 index 000000000..305865546 --- /dev/null +++ b/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/parts/CkEditor-toolbar.js @@ -0,0 +1,19 @@ +CKEDITOR.editorConfig = function( config ) { + config.toolbarGroups = [ + { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, + { name: 'styles', groups: [ 'styles' ] }, + { name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] }, + { name: 'forms', groups: [ 'forms' ] }, + { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, + { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] }, + { name: 'insert', groups: [ 'insert' ] }, + { name: 'links', groups: [ 'links' ] }, + { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, + { name: 'colors', groups: [ 'colors' ] }, + { name: 'tools', groups: [ 'tools' ] }, + { name: 'others', groups: [ 'others' ] }, + { name: 'about', groups: [ 'about' ] } + ]; + + config.removeButtons = 'Source,Save,Templates,Strike,Subscript,Superscript,CopyFormatting,Outdent,Indent,CreateDiv,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,BidiLtr,BidiRtl,Language,Anchor,Flash,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,Format,Font,FontSize,BGColor,TextColor,Maximize,ShowBlocks,About,Preview,Print,Redo,Replace,Find,Undo,SelectAll,Scayt,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,NewPage,PasteFromWord,Blockquote'; +}; \ No newline at end of file diff --git a/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/parts/CkEditor-toolbarGroups.json b/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/parts/CkEditor-toolbarGroups.json new file mode 100644 index 000000000..a886c2791 --- /dev/null +++ b/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/parts/CkEditor-toolbarGroups.json @@ -0,0 +1,92 @@ +[ + { + "name": "document", + "groups": [ + "mode", + "document", + "doctools" + ] + }, + { + "name": "styles", + "groups": [ + "styles" + ] + }, + { + "name": "editing", + "groups": [ + "find", + "selection", + "spellchecker", + "editing" + ] + }, + { + "name": "forms", + "groups": [ + "forms" + ] + }, + { + "name": "basicstyles", + "groups": [ + "basicstyles", + "cleanup" + ] + }, + { + "name": "paragraph", + "groups": [ + "list", + "indent", + "blocks", + "align", + "bidi", + "paragraph" + ] + }, + { + "name": "insert", + "groups": [ + "insert" + ] + }, + { + "name": "links", + "groups": [ + "links" + ] + }, + { + "name": "clipboard", + "groups": [ + "clipboard", + "undo" + ] + }, + { + "name": "colors", + "groups": [ + "colors" + ] + }, + { + "name": "tools", + "groups": [ + "tools" + ] + }, + { + "name": "others", + "groups": [ + "others" + ] + }, + { + "name": "about", + "groups": [ + "about" + ] + } +] \ No newline at end of file diff --git a/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/parts/HtmlEditor.java b/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/parts/HtmlEditor.java new file mode 100644 index 000000000..68963f9b5 --- /dev/null +++ b/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/parts/HtmlEditor.java @@ -0,0 +1,127 @@ +package org.argeo.cms.e4.rap.parts; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +import javax.annotation.PostConstruct; + +import org.apache.commons.io.IOUtils; +import org.argeo.cms.CmsException; +import org.argeo.cms.util.CmsUtils; +import org.eclipse.nebula.widgets.richtext.RichTextEditor; +import org.eclipse.nebula.widgets.richtext.RichTextEditorConfiguration; +import org.eclipse.swt.SWT; +import org.eclipse.swt.browser.Browser; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; + +public class HtmlEditor { + + @PostConstruct + public void createUI(Composite parent) { + String toolbarGroups; + String removeButtons; + try { + toolbarGroups = IOUtils.toString(HtmlEditor.class.getResourceAsStream("CkEditor-toolbarGroups.json"), + StandardCharsets.UTF_8); + removeButtons = IOUtils.toString(HtmlEditor.class.getResourceAsStream("CkEditor-removeButtons.js"), + StandardCharsets.UTF_8); + } catch (IOException e) { + throw new CmsException("Cannot configure toolbar", e); + } +// System.out.println(toolbarGroups); +// System.out.println(removeButtons); + RichTextEditorConfiguration richTextEditorConfig = new RichTextEditorConfiguration(); + richTextEditorConfig.setOption(RichTextEditorConfiguration.TOOLBAR_GROUPS, toolbarGroups); + richTextEditorConfig.setOption(RichTextEditorConfiguration.REMOVE_BUTTONS, removeButtons); +// richTextEditorConfig.setRemoveStyles(false); +// richTextEditorConfig.setRemovePasteFromWord(true); +// richTextEditorConfig.setRemovePasteText(false); + +// richTextEditorConfig.setToolbarCollapsible(true); +// richTextEditorConfig.setToolbarInitialExpanded(false); + + final Display display = parent.getDisplay(); + Composite composite = new Composite(parent, SWT.NONE); +// composite.setLayoutData(new Fill); + composite.setLayout(new GridLayout()); + final RichTextEditor richTextEditor = new RichTextEditor(composite, richTextEditorConfig, SWT.BORDER); + richTextEditor.setText("Google"); + GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true); + richTextEditor.setLayoutData(layoutData); + richTextEditor.setBackground(new Color(display, 247, 247, 247)); + Composite toolbar = new Composite(composite, SWT.NONE); + toolbar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); + toolbar.setLayout(new GridLayout(3, false)); + Button showContent = new Button(toolbar, SWT.PUSH); + showContent.setText("Show Content"); + showContent.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + showContent(parent, richTextEditor, false); + } + }); + Button showSource = new Button(toolbar, SWT.PUSH); + showSource.setText("Show Source"); + showSource.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + showContent(parent, richTextEditor, true); + } + }); + Button clearBtn = new Button(toolbar, SWT.NONE); + clearBtn.setText("Clear"); + clearBtn.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + richTextEditor.setText(""); + } + }); + + } + + private static void showContent(Composite parent, RichTextEditor editor, boolean source) { + int style = SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL; + final Shell content = new Shell(parent.getShell(), style); + content.setLayout(new GridLayout(1, true)); + String text = editor.getText(); + if (source) { + content.setText("Rich Text Source"); + Text viewer = new Text(content, SWT.MULTI | SWT.WRAP); + viewer.setLayoutData(new GridData(400, 400)); + viewer.setText(text); + viewer.setEditable(false); + } else { + content.setText("Rich Text"); + Browser viewer = new Browser(content, SWT.NONE); + viewer.setLayoutData(new GridData(400, 400)); + viewer.setText(text); + viewer.setEnabled(false); + } + Button ok = new Button(content, SWT.PUSH); + ok.setLayoutData(new GridData(SWT.RIGHT, SWT.BOTTOM, false, false)); + ok.setText("OK"); + ok.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + content.dispose(); + } + }); + content.setDefaultButton(ok); + content.pack(); + Display display = parent.getDisplay(); + int left = (display.getClientArea().width / 2) - (content.getBounds().width / 2); + content.setLocation(left, 40); + content.open(); + ok.setFocus(); + } + +} diff --git a/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/parts/test.json b/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/parts/test.json new file mode 100644 index 000000000..eed3f0e87 --- /dev/null +++ b/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/parts/test.json @@ -0,0 +1,28 @@ +{ + "firstName": "John", + "lastName": "Smith", + "isAlive": true, + "age": 27, + "address": { + "streetAddress": "21 2nd Street", + "city": "New York", + "state": "NY", + "postalCode": "10021-3100" + }, + "phoneNumbers": [ + { + "type": "home", + "number": "212 555-1234" + }, + { + "type": "office", + "number": "646 555-4567" + }, + { + "type": "mobile", + "number": "123 456-7890" + } + ], + "children": [], + "spouse": null +} diff --git a/org.argeo.cms.e4/bnd.bnd b/org.argeo.cms.e4/bnd.bnd index 700bdcb52..a851c7739 100644 --- a/org.argeo.cms.e4/bnd.bnd +++ b/org.argeo.cms.e4/bnd.bnd @@ -12,5 +12,4 @@ org.argeo.jcr.docbook,\ org.eclipse.core.commands.common,\ org.eclipse.jface.window,\ org.argeo.cms.widgets.auth,\ -org.eclipse.nebula.widgets.richtext;resolution:=optional,\ * diff --git a/org.argeo.cms.e4/e4xmi/cms-demo.e4xmi b/org.argeo.cms.e4/e4xmi/cms-demo.e4xmi deleted file mode 100644 index 673fc6db9..000000000 --- a/org.argeo.cms.e4/e4xmi/cms-demo.e4xmi +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/CkEditor-removeButtons.js b/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/CkEditor-removeButtons.js deleted file mode 100644 index 20e82e34a..000000000 --- a/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/CkEditor-removeButtons.js +++ /dev/null @@ -1 +0,0 @@ -'Source,Save,Templates,Strike,Subscript,Superscript,CopyFormatting,Outdent,Indent,CreateDiv,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,Language,Anchor,Flash,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,Format,Font,FontSize,BGColor,TextColor,ShowBlocks,About,Preview,Print,Redo,Replace,Find,Undo,SelectAll,Scayt,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,NewPage,PasteFromWord,Blockquote,BidiLtr,BidiRtl' \ No newline at end of file diff --git a/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/CkEditor-toolbar.js b/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/CkEditor-toolbar.js deleted file mode 100644 index 305865546..000000000 --- a/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/CkEditor-toolbar.js +++ /dev/null @@ -1,19 +0,0 @@ -CKEDITOR.editorConfig = function( config ) { - config.toolbarGroups = [ - { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, - { name: 'styles', groups: [ 'styles' ] }, - { name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] }, - { name: 'forms', groups: [ 'forms' ] }, - { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, - { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi', 'paragraph' ] }, - { name: 'insert', groups: [ 'insert' ] }, - { name: 'links', groups: [ 'links' ] }, - { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, - { name: 'colors', groups: [ 'colors' ] }, - { name: 'tools', groups: [ 'tools' ] }, - { name: 'others', groups: [ 'others' ] }, - { name: 'about', groups: [ 'about' ] } - ]; - - config.removeButtons = 'Source,Save,Templates,Strike,Subscript,Superscript,CopyFormatting,Outdent,Indent,CreateDiv,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,BidiLtr,BidiRtl,Language,Anchor,Flash,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,Format,Font,FontSize,BGColor,TextColor,Maximize,ShowBlocks,About,Preview,Print,Redo,Replace,Find,Undo,SelectAll,Scayt,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,NewPage,PasteFromWord,Blockquote'; -}; \ No newline at end of file diff --git a/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/CkEditor-toolbarGroups.json b/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/CkEditor-toolbarGroups.json deleted file mode 100644 index a886c2791..000000000 --- a/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/CkEditor-toolbarGroups.json +++ /dev/null @@ -1,92 +0,0 @@ -[ - { - "name": "document", - "groups": [ - "mode", - "document", - "doctools" - ] - }, - { - "name": "styles", - "groups": [ - "styles" - ] - }, - { - "name": "editing", - "groups": [ - "find", - "selection", - "spellchecker", - "editing" - ] - }, - { - "name": "forms", - "groups": [ - "forms" - ] - }, - { - "name": "basicstyles", - "groups": [ - "basicstyles", - "cleanup" - ] - }, - { - "name": "paragraph", - "groups": [ - "list", - "indent", - "blocks", - "align", - "bidi", - "paragraph" - ] - }, - { - "name": "insert", - "groups": [ - "insert" - ] - }, - { - "name": "links", - "groups": [ - "links" - ] - }, - { - "name": "clipboard", - "groups": [ - "clipboard", - "undo" - ] - }, - { - "name": "colors", - "groups": [ - "colors" - ] - }, - { - "name": "tools", - "groups": [ - "tools" - ] - }, - { - "name": "others", - "groups": [ - "others" - ] - }, - { - "name": "about", - "groups": [ - "about" - ] - } -] \ No newline at end of file diff --git a/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/HtmlEditor.java b/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/HtmlEditor.java deleted file mode 100644 index 9b8c2d0b6..000000000 --- a/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/HtmlEditor.java +++ /dev/null @@ -1,127 +0,0 @@ -package org.argeo.cms.e4.parts; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; - -import javax.annotation.PostConstruct; - -import org.apache.commons.io.IOUtils; -import org.argeo.cms.CmsException; -import org.argeo.cms.util.CmsUtils; -import org.eclipse.nebula.widgets.richtext.RichTextEditor; -import org.eclipse.nebula.widgets.richtext.RichTextEditorConfiguration; -import org.eclipse.swt.SWT; -import org.eclipse.swt.browser.Browser; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -public class HtmlEditor { - - @PostConstruct - public void createUI(Composite parent) { - String toolbarGroups; - String removeButtons; - try { - toolbarGroups = IOUtils.toString(HtmlEditor.class.getResourceAsStream("CkEditor-toolbarGroups.json"), - StandardCharsets.UTF_8); - removeButtons = IOUtils.toString(HtmlEditor.class.getResourceAsStream("CkEditor-removeButtons.js"), - StandardCharsets.UTF_8); - } catch (IOException e) { - throw new CmsException("Cannot configure toolbar", e); - } -// System.out.println(toolbarGroups); -// System.out.println(removeButtons); - RichTextEditorConfiguration richTextEditorConfig = new RichTextEditorConfiguration(); - richTextEditorConfig.setOption(RichTextEditorConfiguration.TOOLBAR_GROUPS, toolbarGroups); - richTextEditorConfig.setOption(RichTextEditorConfiguration.REMOVE_BUTTONS, removeButtons); -// richTextEditorConfig.setRemoveStyles(false); -// richTextEditorConfig.setRemovePasteFromWord(true); -// richTextEditorConfig.setRemovePasteText(false); - -// richTextEditorConfig.setToolbarCollapsible(true); -// richTextEditorConfig.setToolbarInitialExpanded(false); - - final Display display = parent.getDisplay(); - Composite composite = new Composite(parent, SWT.NONE); -// composite.setLayoutData(new Fill); - composite.setLayout(new GridLayout()); - final RichTextEditor richTextEditor = new RichTextEditor(composite, richTextEditorConfig, SWT.BORDER); - richTextEditor.setText("Google"); - GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true); - richTextEditor.setLayoutData(layoutData); - richTextEditor.setBackground(new Color(display, 247, 247, 247)); - Composite toolbar = new Composite(composite, SWT.NONE); - toolbar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - toolbar.setLayout(new GridLayout(3, false)); - Button showContent = new Button(toolbar, SWT.PUSH); - showContent.setText("Show Content"); - showContent.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - showContent(parent, richTextEditor, false); - } - }); - Button showSource = new Button(toolbar, SWT.PUSH); - showSource.setText("Show Source"); - showSource.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - showContent(parent, richTextEditor, true); - } - }); - Button clearBtn = new Button(toolbar, SWT.NONE); - clearBtn.setText("Clear"); - clearBtn.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - richTextEditor.setText(""); - } - }); - - } - - private static void showContent(Composite parent, RichTextEditor editor, boolean source) { - int style = SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL; - final Shell content = new Shell(parent.getShell(), style); - content.setLayout(new GridLayout(1, true)); - String text = editor.getText(); - if (source) { - content.setText("Rich Text Source"); - Text viewer = new Text(content, SWT.MULTI | SWT.WRAP); - viewer.setLayoutData(new GridData(400, 400)); - viewer.setText(text); - viewer.setEditable(false); - } else { - content.setText("Rich Text"); - Browser viewer = new Browser(content, SWT.NONE); - viewer.setLayoutData(new GridData(400, 400)); - viewer.setText(text); - viewer.setEnabled(false); - } - Button ok = new Button(content, SWT.PUSH); - ok.setLayoutData(new GridData(SWT.RIGHT, SWT.BOTTOM, false, false)); - ok.setText("OK"); - ok.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - content.dispose(); - } - }); - content.setDefaultButton(ok); - content.pack(); - Display display = parent.getDisplay(); - int left = (display.getClientArea().width / 2) - (content.getBounds().width / 2); - content.setLocation(left, 40); - content.open(); - ok.setFocus(); - } - -} diff --git a/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/test.json b/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/test.json deleted file mode 100644 index eed3f0e87..000000000 --- a/org.argeo.cms.e4/src/org/argeo/cms/e4/parts/test.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "firstName": "John", - "lastName": "Smith", - "isAlive": true, - "age": 27, - "address": { - "streetAddress": "21 2nd Street", - "city": "New York", - "state": "NY", - "postalCode": "10021-3100" - }, - "phoneNumbers": [ - { - "type": "home", - "number": "212 555-1234" - }, - { - "type": "office", - "number": "646 555-4567" - }, - { - "type": "mobile", - "number": "123 456-7890" - } - ], - "children": [], - "spouse": null -}