Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSopot Cela2013-07-31 06:26:22 -0400
committerTom Schindl2013-07-31 06:29:52 -0400
commitf52bf9d9616b4bfc951fb0030a54bfca3ebe4f3b (patch)
tree5f0f4917e981fe56e7d39910f787146039e8d06d
parentd4238d4e3cd89b15bc4a89ce6fc47328566693f1 (diff)
downloadorg.eclipse.efxclipse-f52bf9d9616b4bfc951fb0030a54bfca3ebe4f3b.tar.gz
org.eclipse.efxclipse-f52bf9d9616b4bfc951fb0030a54bfca3ebe4f3b.tar.xz
org.eclipse.efxclipse-f52bf9d9616b4bfc951fb0030a54bfca3ebe4f3b.zip
Bug 414114 - Enhance multiple lifecycle support
Signed-off-by: Sopot Cela <sopotcela@gmail.com>
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleServiceImpl.java11
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/.classpath8
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/.gitignore3
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/.project34
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/META-INF/MANIFEST.MF13
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/build.properties4
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/sample-src/sample/.gitignore1
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/sample-src/sample/Sample.fxgraph62
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/sample-src/sample/Sample.fxml47
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/FXGraphCompiler.java126
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/FXGraphJavaGenerator.xtend139
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/ReflectionHelper.xtend30
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/ant/CompilerTask.java113
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/ant/FXGraphCompilerTask.java20
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/ant/FXMLCompilerTask.java20
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/xtend-gen/.gitignore1
-rw-r--r--org.eclipse.fx.ide.fxml.compiler/xtend-gen/donotdelete0
20 files changed, 2 insertions, 641 deletions
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleServiceImpl.java b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleServiceImpl.java
index 54316919d..827c01089 100644
--- a/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleServiceImpl.java
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleServiceImpl.java
@@ -50,9 +50,9 @@ public class LifecycleServiceImpl implements ELifecycleService{
for (Object object : set) {
Object invokeResult = ContextInjectionFactory.invoke(object, clazz, parentContext, partContext,true);
if (invokeResult!=null){//supports void methods
- return (boolean)invokeResult;
+ boolean res = (boolean)invokeResult;
+ if (!res) return false;
}
- else return true;
}
}
return true;
@@ -61,13 +61,6 @@ public class LifecycleServiceImpl implements ELifecycleService{
return modelService.getContainingContext(element);
}
- private IEclipseContext getModelContext(MUIElement part) {
- if (part instanceof MContext) {
- return ((MContext) part).getContext();
- }
- return getContextForParent(part);
- }
-
@Override
public void unregisterLifecycleContribution(MUIElement element,
Object contribution) {
diff --git a/org.eclipse.fx.ide.fxml.compiler/.classpath b/org.eclipse.fx.ide.fxml.compiler/.classpath
deleted file mode 100644
index 248b4c5dc..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="xtend-gen"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.fx.ide.fxml.compiler/.gitignore b/org.eclipse.fx.ide.fxml.compiler/.gitignore
deleted file mode 100644
index 2a2f894bd..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/bin
-/build.xml
-/out-src
diff --git a/org.eclipse.fx.ide.fxml.compiler/.project b/org.eclipse.fx.ide.fxml.compiler/.project
deleted file mode 100644
index 46f4b99fd..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.fx.ide.fxml.compiler</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <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>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
- </natures>
-</projectDescription>
diff --git a/org.eclipse.fx.ide.fxml.compiler/.settings/org.eclipse.core.resources.prefs b/org.eclipse.fx.ide.fxml.compiler/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 99f26c020..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-encoding/<project>=UTF-8
diff --git a/org.eclipse.fx.ide.fxml.compiler/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.fx.ide.fxml.compiler/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index 5a0ad22d2..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/.settings/org.eclipse.core.runtime.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-line.separator=\n
diff --git a/org.eclipse.fx.ide.fxml.compiler/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.fx.ide.fxml.compiler/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index f42de363a..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.compliance=1.7
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.7
diff --git a/org.eclipse.fx.ide.fxml.compiler/META-INF/MANIFEST.MF b/org.eclipse.fx.ide.fxml.compiler/META-INF/MANIFEST.MF
deleted file mode 100644
index a32152a72..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,13 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Compiler
-Bundle-SymbolicName: org.eclipse.fx.ide.fxml.compiler
-Bundle-Version: 1.0.0.qualifier
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
-Require-Bundle: org.eclipse.xtend.lib,
- com.google.guava,
- org.eclipse.xtext.xbase.lib,
- org.eclipse.fx.ide.fxgraph;bundle-version="0.8.1",
- org.eclipse.xtext.common.types;bundle-version="2.4.2",
- org.apache.ant;bundle-version="1.8.4"
-
diff --git a/org.eclipse.fx.ide.fxml.compiler/build.properties b/org.eclipse.fx.ide.fxml.compiler/build.properties
deleted file mode 100644
index 34d2e4d2d..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .
diff --git a/org.eclipse.fx.ide.fxml.compiler/sample-src/sample/.gitignore b/org.eclipse.fx.ide.fxml.compiler/sample-src/sample/.gitignore
deleted file mode 100644
index e401ec7cb..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/sample-src/sample/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/Sample.java
diff --git a/org.eclipse.fx.ide.fxml.compiler/sample-src/sample/Sample.fxgraph b/org.eclipse.fx.ide.fxml.compiler/sample-src/sample/Sample.fxgraph
deleted file mode 100644
index e9ebba287..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/sample-src/sample/Sample.fxgraph
+++ /dev/null
@@ -1,62 +0,0 @@
-package a
-
-import javafx.scene.layout.BorderPane
-import javafx.scene.control.Button
-import javafx.scene.layout.HBox
-import javafx.scene.control.Label
-import javafx.scene.layout.VBox
-import javafx.geometry.Insets
-import javafx.scene.layout.GridPane
-
-component Sample {
- BorderPane {
- center : Button {
- text : "Hello World"
- },
- bottom : HBox {
- children : [
- Label {
- text : "Label 1",
- minWidth : 100,
- static hgrow : "ALWAYS"
- },
- Label {
- text : "Label 1",
- static margin : Insets {
- bottom : 5
- }
- },
- VBox {
- Label {
- text : "Def 1"
- },
- Label {
- text : "Def 2"
- }
- },
- VBox {
- children : [
- Label {
- text : "Label 1",
- static vgrow : "SOMETIMES"
- },
- GridPane {
- children : [
- Label {
- text : "In Grid 0/0",
- static columnIndex : 0,
- static rowIndex : 0
- },
- Label {
- text : "In Grid 0/1",
- static columnIndex : 0,
- static rowIndex : 1
- }
- ]
- }
- ]
- }
- ]
- }
- }
-}
diff --git a/org.eclipse.fx.ide.fxml.compiler/sample-src/sample/Sample.fxml b/org.eclipse.fx.ide.fxml.compiler/sample-src/sample/Sample.fxml
deleted file mode 100644
index 14b4f3842..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/sample-src/sample/Sample.fxml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Do not edit this file it is generated by e(fx)clipse from ../sample-src/sample/Sample.fxgraph
--->
-
-<?import java.lang.*?>
-<?import javafx.geometry.Insets?>
-<?import javafx.scene.control.Button?>
-<?import javafx.scene.control.Label?>
-<?import javafx.scene.layout.BorderPane?>
-<?import javafx.scene.layout.GridPane?>
-<?import javafx.scene.layout.HBox?>
-<?import javafx.scene.layout.VBox?>
-
-<BorderPane xmlns:fx="http://javafx.com/fxml">
-
- <center>
- <Button text="Hello World"/>
- </center>
- <bottom>
- <HBox>
- <children>
- <Label text="Label 1" minWidth="100" HBox.hgrow="ALWAYS"/>
- <Label text="Label 1">
- <HBox.margin>
- <Insets bottom="5"/>
- </HBox.margin>
- </Label>
- <VBox>
- <Label text="Def 1"/>
- <Label text="Def 2"/>
- </VBox>
- <VBox>
- <children>
- <Label text="Label 1" VBox.vgrow="SOMETIMES"/>
- <GridPane>
- <children>
- <Label text="In Grid 0/0" GridPane.columnIndex="0" GridPane.rowIndex="0"/>
- <Label text="In Grid 0/1" GridPane.columnIndex="0" GridPane.rowIndex="1"/>
- </children>
- </GridPane>
- </children>
- </VBox>
- </children>
- </HBox>
- </bottom>
-</BorderPane>
diff --git a/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/FXGraphCompiler.java b/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/FXGraphCompiler.java
deleted file mode 100644
index 4ddd32a92..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/FXGraphCompiler.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 BestSolution.at and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.fx.ide.fxml.compiler;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.UUID;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.fx.ide.fxgraph.converter.FXGraphConverter;
-import org.eclipse.fx.ide.fxgraph.converter.FXMLLoader;
-import org.eclipse.fx.ide.fxgraph.converter.IFXMLFile;
-import org.eclipse.fx.ide.fxgraph.fXGraph.Model;
-
-import com.google.inject.Inject;
-import com.google.inject.Injector;
-import com.google.inject.Provider;
-
-public class FXGraphCompiler {
-
- @Inject
- private Provider<ResourceSet> resourceSetProvider;
-
- public static void main(String[] args) {
- Injector injector = new org.eclipse.fx.ide.fxgraph.FXGraphStandaloneSetupGenerated().createInjectorAndDoEMFRegistration();
- FXGraphCompiler main = injector.getInstance(FXGraphCompiler.class);
- main.compile(args[0], args[1],null);
- }
-
- public void compile(final String string, final String sourcePrefix, String outputPrefix) {
- Model m;
- String fxgraph = string;
- if( string.endsWith("fxml") ) {
- FXMLLoader loader = new FXMLLoader();
- m = loader.loadModel(new IFXMLFile() {
-
- @Override
- public String getPackagename() {
- if( sourcePrefix == null) {
- return "dummy";
- } else {
- String filePath = new File(string).getParent();
- String packagename = filePath.substring(sourcePrefix.length()+1);
- return packagename.replace('/', '.');
- }
- }
-
- @Override
- public String getName() {
- return new File(string).getName();
- }
-
- @Override
- public InputStream getContent() {
- try {
- return new FileInputStream(string);
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
- });
-
- fxgraph = "/tmp/"+UUID.randomUUID().toString()+".fxgraph";
-
- File out = new File(fxgraph);
- System.err.println(out);
-// out.deleteOnExit();
- try {
- FileOutputStream outStream = new FileOutputStream(out);
- outStream.write(new FXGraphConverter().generate(m).toString().getBytes());
- outStream.close();
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- ResourceSet set = resourceSetProvider.get();
- Resource resource = set.getResource(URI.createURI(fxgraph), true);
-
- m = (Model)resource.getContents().get(0);
-
- FXGraphJavaGenerator c = new FXGraphJavaGenerator();
-
- try {
- String outFile = string.replaceAll("fxgraph$", "java").replaceAll("fxml$", "java");
-
- if( outputPrefix != null ) {
- String filePath = new File(outFile).getAbsolutePath();
- String packagename = filePath.substring(sourcePrefix.length()+1);
- File f = new File(outputPrefix,packagename);
- f.getParentFile().mkdirs();
- outFile = f.getAbsolutePath();
- }
-
- FileOutputStream out = new FileOutputStream(outFile);
- out.write(c.generate(m).toString().getBytes());
- out.close();
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-}
diff --git a/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/FXGraphJavaGenerator.xtend b/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/FXGraphJavaGenerator.xtend
deleted file mode 100644
index 25f1c6890..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/FXGraphJavaGenerator.xtend
+++ /dev/null
@@ -1,139 +0,0 @@
-package org.eclipse.fx.ide.fxml.compiler
-
-import org.eclipse.fx.ide.fxgraph.fXGraph.Model
-import org.eclipse.fx.ide.fxgraph.fXGraph.Element
-import org.eclipse.fx.ide.fxgraph.fXGraph.SimpleValueProperty import org.eclipse.fx.ide.fxgraph.fXGraph.ListValueProperty
-import org.eclipse.fx.ide.fxgraph.fXGraph.StaticValueProperty
-
-import static extension org.eclipse.fx.ide.fxml.compiler.ReflectionHelper.*
-import java.util.Set
-import java.util.HashSet
-
-class FXGraphJavaGenerator {
- int varIndex = 0;
- Set<String> extraImports = new HashSet;
-
- def getVarIndex() {
- varIndex = varIndex + 1;
- return varIndex;
- }
-
- def generate(Model model) '''
- package «model.package.name»;
-
- import org.eclipse.fx.core.fxml.FXMLDocument;
- import java.util.ResourceBundle;
-
- «var content = generateElementDef("root", model.componentDef.rootNode)»
-
- «FOR i : model.imports»
- import «i.importedNamespace»;
- «ENDFOR»
-
- «FOR i : extraImports»
- import «i»;
- «ENDFOR»
-
- public class «model.componentDef.name» extends FXMLDocument<«model.componentDef.rootNode.type.simpleName»> {
- public «model.componentDef.rootNode.type.simpleName» load(ResourceBundle bundle) {
- «content»
- return root;
- }
- }
- '''
-
- def CharSequence generateElementDef(String name, Element element) '''
- «IF element.type.needsBuilder»
- «element.type.simpleName» «name»;
- «element.type.simpleName»Builder «name»Builder = «element.type.simpleName»Builder.create();
- «val dummy = extraImports.add(element.type.qualifiedName+"Builder")»
- «FOR p : element.properties»
- «IF p.value instanceof SimpleValueProperty»
- «name»Builder.«p.name»(«(p.value as SimpleValueProperty).simpleAttributeValue»);
- «ENDIF»
- «ENDFOR»
- «name» = «name»Builder.build();
- «ELSE»
- «element.type.simpleName» «name» = new «element.type.simpleName»();
- «FOR p : element.properties»
- «IF p.value instanceof SimpleValueProperty»
- «name».set«p.name.toFirstUpper»(«(p.value as SimpleValueProperty).simpleAttributeValue»);
- «ELSEIF p.value instanceof Element»
- {
- «val varName = 'e_'+getVarIndex»
- «generateElementDef(varName,p.value as Element)»
- «name».set«p.name.toFirstUpper»(«varName»);
- «staticProperties(varName,p.value as Element)»
- }
- «ELSEIF p.value instanceof ListValueProperty»
- «FOR l : (p.value as ListValueProperty).value»
- {
- «val i = getVarIndex»
- «val varName = 'e_'+i»
- «IF l instanceof Element»
- «generateElementDef(varName,l as Element)»
- «name».get«p.name.toFirstUpper»().add(«varName»);
- «staticProperties(varName,l as Element)»
- «ENDIF»
- }
- «ENDFOR»
- «ENDIF»
- «ENDFOR»
- «FOR p : element.defaultChildren»
- {
- «val i = getVarIndex»
- «val varName = 'e_'+i»
- «generateElementDef(varName,p)»
- «name».get«element.type.defaultAttribute.toFirstUpper»().add(«varName»);
- }
- «ENDFOR»
- «ENDIF»
- '''
-
- def staticProperties(String name, Element element) '''
- «FOR prop : element.staticProperties»
- «val type = prop.type»
- «IF prop.value instanceof SimpleValueProperty»
- «IF (prop.value as SimpleValueProperty).stringValue != null»
- «val enumType = ReflectionHelper.getEnumType(type, prop.name, true)»
- «IF enumType != null»
- «type.simpleName».set«prop.name.toFirstUpper»(«name»,«enumType».«(prop.value as SimpleValueProperty).stringValue»);
- «ELSE»
- «type.simpleName».set«prop.name.toFirstUpper»(«name»,«(prop.value as SimpleValueProperty).simpleAttributeValue»);
- «ENDIF»
- «ELSE»
- «type.simpleName».set«prop.name.toFirstUpper»(«name»,«(prop.value as SimpleValueProperty).simpleAttributeValue»);
- «ENDIF»
- «ELSEIF prop.value instanceof Element»
- «val varname = 'e_'+getVarIndex»
- «generateElementDef(varname,prop.value as Element)»
- «type.simpleName».set«prop.name.toFirstUpper»(«name»,«varname»);
- «ENDIF»
- «ENDFOR»
- '''
-
- def simpleAttributeValue(SimpleValueProperty value) {
- if( value.stringValue != null ) {
- return '"' + value.stringValue + '"';
- } else if( value.booleanValue != null ) {
- return value.booleanValue;
- } else if( value.number != null ) {
- if( value.negative ) {
- return "-" + value.number;
- } else {
- return value.number;
- }
- }
- }
-
- def type(StaticValueProperty prop) {
- var el = prop.eContainer
- while( el.eContainer != null ) {
- if( el.eContainer instanceof Element ) {
- val e = el.eContainer as Element
- return e.type;
- }
- el = el.eContainer;
- }
- }
-} \ No newline at end of file
diff --git a/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/ReflectionHelper.xtend b/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/ReflectionHelper.xtend
deleted file mode 100644
index a8d403f66..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/ReflectionHelper.xtend
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.eclipse.fx.ide.fxml.compiler
-
-import org.eclipse.xtext.common.types.JvmTypeReference
-import javafx.beans.DefaultProperty
-
-class ReflectionHelper {
- def static getEnumType(JvmTypeReference type, String attributeName, boolean layoutConstraint) {
- val c = Class::forName(type.qualifiedName, false, typeof(ReflectionHelper).getClassLoader())
- val methodName = "set"+attributeName.toFirstUpper
- val m = c.methods.findFirst[name == methodName && (parameterCount == 1 || (layoutConstraint && parameterCount == 2) )]
-
- return m?.parameterTypes.get(if (layoutConstraint) 1 else 0)?.name
- }
-
- def static needsBuilder(JvmTypeReference type) {
- val c = Class::forName(type.qualifiedName, false, typeof(ReflectionHelper).getClassLoader())
- return c.constructors.findFirst[parameterCount==0] == null
- }
-
- def static defaultAttribute(JvmTypeReference type) {
- var c = Class::forName(type.qualifiedName, false, typeof(ReflectionHelper).getClassLoader())
- var DefaultProperty p
- do {
- p = c.getAnnotation(typeof(DefaultProperty))
- c = c.superclass;
- } while( p == null && c != typeof(Object) )
-
- return p.value;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/ant/CompilerTask.java b/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/ant/CompilerTask.java
deleted file mode 100644
index b4be8ac0e..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/ant/CompilerTask.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 BestSolution.at and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.fx.ide.fxml.compiler.ant;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.FileVisitResult;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.SimpleFileVisitor;
-import java.nio.file.attribute.BasicFileAttributes;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.eclipse.fx.ide.fxml.compiler.FXGraphCompiler;
-
-import com.google.inject.Injector;
-
-public abstract class CompilerTask extends Task {
- private String srcDir;
- private String destDir;
- private final boolean fxgraph;
-
- public CompilerTask(boolean fxgraph) {
- this.fxgraph = fxgraph;
- }
-
- public void setSourceDir(String srcDir) {
- this.srcDir = srcDir;
- }
-
- public String getSrcDir() {
- return srcDir;
- }
-
- public void setDestDir(String destDir) {
- this.destDir = destDir;
- }
-
- public String getDestDir() {
- return destDir;
- }
-
- @Override
- public void execute() throws BuildException {
- File f = new File(getLocation().getFileName());
- File sourceDirectory = new File(f.getParentFile(), srcDir);
- File outDirectory = new File(f.getParentFile(), destDir);
-
- final String sourcePrefix = sourceDirectory.getAbsolutePath();
- final String outPrefix = outDirectory.getAbsolutePath();
- Injector injector = new org.eclipse.fx.ide.fxgraph.FXGraphStandaloneSetupGenerated().createInjectorAndDoEMFRegistration();
- final FXGraphCompiler compiler = injector.getInstance(FXGraphCompiler.class);
-
- try {
- Files.walkFileTree(Paths.get(sourceDirectory.getAbsolutePath()), new FileFinder(new Callable() {
-
- @Override
- public void call(String file) {
- System.out.println("Compiling " + file);
- compiler.compile(file, sourcePrefix, outPrefix);
- }
- }));
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- class FileFinder extends SimpleFileVisitor<Path> {
- private final Callable runnable;
-
- public FileFinder(Callable runnable) {
- this.runnable = runnable;
- }
-
- @Override
- public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
- if ((file.toFile().getAbsolutePath().endsWith(".fxml") && !fxgraph) || (file.toFile().getAbsolutePath().endsWith(".fxgraph") && fxgraph)) {
- runnable.call(file.toFile().getAbsolutePath());
- }
- return FileVisitResult.CONTINUE;
- }
-
- @Override
- public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
- return FileVisitResult.CONTINUE;
- }
-
- @Override
- public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
- return FileVisitResult.CONTINUE;
- }
-
- @Override
- public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
- return FileVisitResult.CONTINUE;
- }
- }
-
- public interface Callable {
- public void call(String file);
- }
-} \ No newline at end of file
diff --git a/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/ant/FXGraphCompilerTask.java b/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/ant/FXGraphCompilerTask.java
deleted file mode 100644
index 68c8bd1b4..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/ant/FXGraphCompilerTask.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 BestSolution.at and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.fx.ide.fxml.compiler.ant;
-
-
-public class FXGraphCompilerTask extends CompilerTask {
-
- public FXGraphCompilerTask() {
- super(true);
- }
-
-} \ No newline at end of file
diff --git a/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/ant/FXMLCompilerTask.java b/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/ant/FXMLCompilerTask.java
deleted file mode 100644
index ea1de0cd6..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/src/org/eclipse/fx/ide/fxml/compiler/ant/FXMLCompilerTask.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 BestSolution.at and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.fx.ide.fxml.compiler.ant;
-
-
-public class FXMLCompilerTask extends CompilerTask {
-
- public FXMLCompilerTask() {
- super(false);
- }
-
-} \ No newline at end of file
diff --git a/org.eclipse.fx.ide.fxml.compiler/xtend-gen/.gitignore b/org.eclipse.fx.ide.fxml.compiler/xtend-gen/.gitignore
deleted file mode 100644
index 571ee510a..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/xtend-gen/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/org
diff --git a/org.eclipse.fx.ide.fxml.compiler/xtend-gen/donotdelete b/org.eclipse.fx.ide.fxml.compiler/xtend-gen/donotdelete
deleted file mode 100644
index e69de29bb..000000000
--- a/org.eclipse.fx.ide.fxml.compiler/xtend-gen/donotdelete
+++ /dev/null

Back to the top