Skip to content

Commit

Permalink
#8 - BIG CHANGES! migrating from angular2 to vue.js ;> Rewriting all …
Browse files Browse the repository at this point in the history
…the js code generators, still in progress ...
  • Loading branch information
activey committed Oct 27, 2016
1 parent df32775 commit 4f6adb2
Show file tree
Hide file tree
Showing 98 changed files with 850 additions and 1,048 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.licket.core.common;
package org.licket.core.supplier;

import java.util.function.Supplier;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
package org.licket.demo.licket;

import org.licket.core.module.application.LicketComponentModelReloader;
import org.licket.core.resource.HeadParticipatingResource;
import org.licket.demo.view.ContactsAppRoot;
import org.licket.demo.view.ContactsPanel;
import org.licket.demo.view.semantic.JqueryLibraryResource;
import org.licket.demo.view.semantic.SemanticLibraryResource;
import org.licket.demo.view.semantic.SemanticStylesheetResource;
import org.licket.semantic.SemanticUIModuleConfiguration;
import org.licket.spring.annotation.LicketComponent;
import org.licket.spring.annotation.LicketRootContainer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.core.annotation.Order;

@Configuration
@Import(SemanticUIModuleConfiguration.class)
Expand All @@ -29,22 +23,4 @@ public ContactsAppRoot root(@Autowired LicketComponentModelReloader modelReloade
public ContactsPanel contactsPanel(LicketComponentModelReloader modelReloader) {
return new ContactsPanel("contacts-panel", modelReloader);
}

@Bean
@Order(10)
public HeadParticipatingResource jqueryResource() {
return new JqueryLibraryResource();
}

@Bean
@Order(11)
public HeadParticipatingResource semanticLibrary() {
return new SemanticLibraryResource();
}

@Bean
@Order(12)
public HeadParticipatingResource semanticStylesheet() {
return new SemanticStylesheetResource();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,56 @@
<title>Contacts Page</title>
</head>
<body>
<h1 class="ui center aligned header">Contacts list</h1>
<div>
<h1 class="ui center aligned header">Contacts list</h1>

<div class="ui container" lick:id="contacts-panel">
<div class="ui form" lick:id="add-contact-form">
<div class="two fields">
<div class="field">
<label>Name</label>
<input type="text" placeholder="Full Name" lick:id="name"/>
</div>
<div class="ui container" lick:id="contacts-panel">
<div class="ui form" lick:id="add-contact-form">
<div class="two fields">
<div class="field">
<label>Name</label>
<input type="text" placeholder="Full Name" lick:id="name"/>
</div>

<div class="field">
<label>Description</label>
<input type="text" placeholder="Some description" lick:id="description"/>
<div class="field">
<label>Description</label>
<input type="text" placeholder="Some description" lick:id="description"/>
</div>
</div>
</div>

<div class="ui submit button" lick:id="add">
Add one
<div class="ui submit button" lick:id="add">
Add one
</div>
</div>
</div>

<div class="ui relaxed divided items">
<div class="item" lick:id="contact">
<div class="ui small image">
<!--<img src="assets/images/wireframe/image.png"></img>-->
</div>
<div class="content">
<a class="header" lick:id="name">Content Header</a>
<div class="meta">
<a lick:id="email">
<span lick:id="email">
[email protected]
</span>
</a>
</div>
<div class="description" lick:id="description">
A description which may flow for several lines and give context to the content.
<div class="ui relaxed divided items">
<div class="item" lick:id="contact">
<div class="ui small image">
<!--<img src="assets/images/wireframe/image.png"></img>-->
</div>
<div class="extra">
<!--<img src="assets/images/wireframe/square-image.png" class="ui circular avatar image"/> Username-->
<div class="content">
<a class="header" lick:id="name">Content Header</a>
<div class="meta">
<a lick:id="email">
<span lick:id="email">
[email protected]
</span>
</a>
</div>
<div class="description" lick:id="description">
A description which may flow for several lines and give context to the content.
</div>
<div class="extra">
<!--<img src="assets/images/wireframe/square-image.png" class="ui circular avatar image"/> Username-->
</div>
</div>
</div>
</div>
</div>

<button class="ui primary button" lick:id="reload">
Reload list model
</button>
<button class="ui primary button" lick:id="reload">
Reload list model
</button>
</div>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public FunctionCallBuilder target(PropertyNameBuilder propertyNameBuilder) {
return this;
}

public FunctionCallBuilder target(NameBuilder nameBuilder) {
this.target = nameBuilder;
return this;
}

public FunctionCallBuilder argument(AbstractAstNodeBuilder<ObjectLiteral> objectLiteral) {
arguments.add(objectLiteral);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
import java.util.ArrayList;
import java.util.List;

import static org.licket.framework.hippo.BlockBuilder.block;

/**
* @author activey
*/
public class FunctionNodeBuilder extends AbstractAstNodeBuilder<FunctionNode> {

private List<NameBuilder> paramBuilders = new ArrayList();
private BlockBuilder blockBuilder;
private BlockBuilder blockBuilder = block();

private FunctionNodeBuilder() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,21 @@ public NewExpressionBuilder target(PropertyNameBuilder property) {
return this;
}

public NewExpressionBuilder target(NameBuilder name) {
this.target = name;
return this;
}

public NewExpressionBuilder argument(NameBuilder name) {
arguments.add(name);
return this;
}

public NewExpressionBuilder argument(ObjectLiteralBuilder objectLiteral) {
arguments.add(objectLiteral);
return this;
}

@Override
public NewExpression build() {
NewExpression newExpression = new NewExpression();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
public class ObjectPropertyBuilder extends AbstractAstNodeBuilder<ObjectProperty> {

private NameBuilder name;
private AbstractAstNodeBuilder name;

private AbstractAstNodeBuilder<?> value;

Expand All @@ -29,6 +29,11 @@ public ObjectPropertyBuilder name(String name) {
return this;
}

public ObjectPropertyBuilder name(StringLiteralBuilder stringLiteral) {
this.name = stringLiteral;
return this;
}

public ObjectPropertyBuilder arrayValue(AbstractAstNodeBuilder<ArrayLiteral> arrayLiteralBuilder) {
this.value = arrayLiteralBuilder;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import org.mozilla.javascript.ast.PropertyGet;

import static org.licket.framework.hippo.NameBuilder.name;

/**
* @author activey
*/
Expand All @@ -27,10 +29,18 @@ public static PropertyNameBuilder property(PropertyNameBuilder left, NameBuilder
return new PropertyNameBuilder(left, right);
}

public static PropertyNameBuilder property(PropertyNameBuilder left, String right) {
return new PropertyNameBuilder(left, name(right));
}

public static PropertyNameBuilder property(NameBuilder left, NameBuilder right) {
return new PropertyNameBuilder(left, right);
}

public static PropertyNameBuilder property(String left, String right) {
return new PropertyNameBuilder(name(left), name(right));
}

public PropertyGet build() {
PropertyGet propertyGet = new PropertyGet();
propertyGet.setTarget(left.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ public static ReturnStatementBuilder returnStatement() {
return new ReturnStatementBuilder();
}

public ReturnStatementBuilder returnValue(FunctionCallBuilder returnValue) {
this.returnValue = returnValue;
public ReturnStatementBuilder returnValue(ObjectLiteralBuilder objectLiteral) {
this.returnValue = objectLiteral;
return this;
}

public ReturnStatementBuilder returnValue(NameBuilder nameBuilder) {
this.returnValue = nameBuilder;
public ReturnStatementBuilder returnValue(FunctionCallBuilder functionCall) {
this.returnValue = functionCall;
return this;
}

public ReturnStatementBuilder returnValue(NameBuilder name) {
this.returnValue = name;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.licket.core.id.CompositeId;
import org.licket.core.view.LicketComponent;
import org.licket.core.view.container.LicketComponentContainer;
import org.licket.core.view.hippo.ngmodule.AngularModule;
import org.licket.core.view.hippo.angular.ngmodule.VuePlugin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

Expand All @@ -25,7 +25,7 @@ public class DefaultLicketApplication implements LicketApplication, Serializable
private LicketComponentContainer<?> rootContainer;

@Autowired
private List<AngularModule> modules = newArrayList();
private List<VuePlugin> modules = newArrayList();

public DefaultLicketApplication(String name) {
this.name = name;
Expand Down Expand Up @@ -59,12 +59,13 @@ public void traverseDown(Predicate<LicketComponent<?>> componentVisitor) {

@Override
public void traverseDownContainers(Predicate<LicketComponentContainer<?>> containerVisitor) {
containerVisitor.test(rootContainer);
rootContainer.traverseDownContainers(containerVisitor);
if (containerVisitor.test(rootContainer)) {
rootContainer.traverseDownContainers(containerVisitor);
}
}

@Override
public final Iterable<AngularModule> modules() {
public final Iterable<VuePlugin> modules() {
return modules;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.licket.core.id.CompositeId;
import org.licket.core.view.LicketComponent;
import org.licket.core.view.container.LicketComponentContainer;
import org.licket.core.view.hippo.ngmodule.AngularModule;
import org.licket.core.view.hippo.angular.ngmodule.VuePlugin;

import java.util.Optional;
import java.util.function.Predicate;
Expand All @@ -25,5 +25,5 @@ public interface LicketApplication {

void traverseDownContainers(Predicate<LicketComponentContainer<?>> containerVisitor);

Iterable<AngularModule> modules();
Iterable<VuePlugin> modules();
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.function.Supplier;

import static org.licket.core.common.Suppliers.of;
import static org.licket.core.supplier.Suppliers.of;

/**
* @author activey
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package org.licket.core.module;

import org.licket.core.module.application.ApplicationModuleConfiguration;
import org.licket.core.module.forms.FormsModuleConfiguration;
import org.licket.core.module.http.HttpModuleConfiguration;
import org.licket.core.module.platform.BrowserModuleConfiguration;
import org.licket.core.module.resource.ResourcePluginConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

Expand All @@ -12,9 +10,7 @@
*/
@Configuration
@Import({
BrowserModuleConfiguration.class,
FormsModuleConfiguration.class,
HttpModuleConfiguration.class,
ResourcePluginConfiguration.class,
ApplicationModuleConfiguration.class
})
public class AngularModulesConfiguration {}
Loading

0 comments on commit 4f6adb2

Please sign in to comment.