Skip to content

Commit

Permalink
Added ui-hints for JavaResource
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Feb 22, 2013
1 parent 06ca610 commit 5471014
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
7 changes: 7 additions & 0 deletions parser-java/addon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
<classifier>forge-addon</classifier>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.forge</groupId>
<artifactId>ui-hints</artifactId>
<version>2.0.0-SNAPSHOT</version>
<classifier>forge-addon</classifier>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
7 changes: 7 additions & 0 deletions parser-java/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
<version>2.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.forge</groupId>
<artifactId>ui-hints</artifactId>
<version>2.0.0-SNAPSHOT</version>
<classifier>forge-addon</classifier>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.eclipse.tycho</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package org.jboss.forge.parser.java.hints;

import javax.enterprise.event.Observes;
import javax.inject.Inject;

import org.jboss.forge.container.event.Startup;
import org.jboss.forge.environment.Environment;
import org.jboss.forge.parser.java.resources.JavaResource;
import org.jboss.forge.ui.hints.HintsLookup;
import org.jboss.forge.ui.hints.InputTypes;

/**
* Only active when ui-hints addon is installed.
*
* @author <a href="mailto:ggastald@redhat.com">George Gastaldi</a>
*
*/
public class InputTypeHintsRegistrant
{
private Environment environment;

@Inject
public InputTypeHintsRegistrant(Environment environment)
{
this.environment = environment;
}

public void initialize(@Observes Startup event)
{
HintsLookup hints = new HintsLookup(environment);
hints.setInputType(JavaResource.class, InputTypes.JAVA_CLASS_PICKER);
}
}

0 comments on commit 5471014

Please sign in to comment.