public code v1
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>flintstones.group</groupId>
|
||||
<artifactId>flintstones.bundles</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>flintstones.helper.faq.ui</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
<name>[bundle] Ui</name>
|
||||
</project>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>flintstones.helper.faq.ui</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1779484362611</id>
|
||||
<name></name>
|
||||
<type>30</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
@@ -0,0 +1,7 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
@@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
@@ -0,0 +1,14 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Ui
|
||||
Bundle-SymbolicName: flintstones.helper.faq.ui
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Automatic-Module-Name: flintstones.helper.faq.ui
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Require-Bundle: flintstones.helper.ui,
|
||||
javax.inject,
|
||||
org.eclipse.e4.ui.services,
|
||||
flintstones.helper.html,
|
||||
flintstones.model.ui.service
|
||||
Export-Package: flintstones.helper.faq.ui.dialog
|
||||
Import-Package: org.osgi.framework
|
||||
@@ -0,0 +1,4 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package flintstones.helper.faq.ui.dialog;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.eclipse.e4.ui.services.IServiceConstants;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.osgi.framework.Bundle;
|
||||
|
||||
import flintstones.helper.html.HtmlMarkdown;
|
||||
import flintstones.model.ui.service.UiService;
|
||||
|
||||
public class MarkdownFAQDialog extends Dialog {
|
||||
|
||||
|
||||
private Bundle bundle;
|
||||
|
||||
private String markdownFile;
|
||||
/**
|
||||
* Create the dialog.
|
||||
* @param parentShell
|
||||
*/
|
||||
@Inject
|
||||
public MarkdownFAQDialog(@Named(IServiceConstants.ACTIVE_SHELL) Shell parentShell) {
|
||||
super(parentShell);
|
||||
}
|
||||
|
||||
public void setMarkdown(String md) {
|
||||
this.markdownFile = md;
|
||||
}
|
||||
|
||||
public void setBundle(Bundle bundle) {
|
||||
this.bundle = bundle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create contents of the dialog.
|
||||
* @param parent
|
||||
*/
|
||||
@Override
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
Composite container = (Composite) super.createDialogArea(parent);
|
||||
UiService.setGridLayout(container, 1, true);
|
||||
UiService.setGridData(container, 9, 9, true, true);
|
||||
|
||||
Composite mdBase = new Composite(container,0);
|
||||
UiService.setGridLayout(mdBase, 1, true);
|
||||
UiService.setGridData(mdBase, 9, 9, true, true);
|
||||
UiService.setMargin(mdBase, 40);
|
||||
|
||||
HtmlMarkdown markdownViewer = new HtmlMarkdown(mdBase);
|
||||
markdownViewer.setFile(markdownFile,bundle);
|
||||
markdownViewer.render();
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create contents of the button bar.
|
||||
* @param parent
|
||||
*/
|
||||
@Override
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
// createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
|
||||
createButton(parent, IDialogConstants.CANCEL_ID, "Cerrar", false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the initial size of the dialog.
|
||||
*/
|
||||
@Override
|
||||
protected Point getInitialSize() {
|
||||
return new Point(700, 700);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package flintstones.helper.faq.ui.dialog;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.eclipse.e4.ui.services.IServiceConstants;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import flintstones.model.ui.service.UiService;
|
||||
|
||||
public class TextFAQDialog extends Dialog {
|
||||
|
||||
|
||||
private String text;
|
||||
|
||||
/**
|
||||
* Create the dialog.
|
||||
* @param parentShell
|
||||
*/
|
||||
@Inject
|
||||
public TextFAQDialog(@Named(IServiceConstants.ACTIVE_SHELL) Shell parentShell) {
|
||||
super(parentShell);
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create contents of the dialog.
|
||||
* @param parent
|
||||
*/
|
||||
@Override
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
Composite container = (Composite) super.createDialogArea(parent);
|
||||
|
||||
UiService.setGridLayout(container, 1, true);
|
||||
UiService.setGridData(container, 9, 9, true, true);
|
||||
|
||||
Label l = new Label(container, SWT.WRAP);
|
||||
l.setLayoutData(new GridData(SWT.HORIZONTAL, SWT.TOP, true, false, 1, 1));
|
||||
l.setText(text);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create contents of the button bar.
|
||||
* @param parent
|
||||
*/
|
||||
@Override
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
|
||||
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the initial size of the dialog.
|
||||
*/
|
||||
@Override
|
||||
protected Point getInitialSize() {
|
||||
return new Point(450, 300);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user