[seam-commits] Seam SVN: r13395 - in sandbox/encore: shell/src/main/java/org/jboss/encore/shell/cli/builtin and 1 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Jul 14 18:39:49 EDT 2010


Author: lincolnthree
Date: 2010-07-14 18:39:48 -0400 (Wed, 14 Jul 2010)
New Revision: 13395

Added:
   sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/ClearPlugin.java
   sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/PwdPlugin.java
   sandbox/encore/shell/src/main/java/org/jboss/encore/shell/plugins/Help.java
Modified:
   sandbox/encore/model/
Log:
* A few more plugins
* SVN ignores


Property changes on: sandbox/encore/model
___________________________________________________________________
Name: svn:ignore
   - target

   + target
.settings
.classpath
.project


Added: sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/ClearPlugin.java
===================================================================
--- sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/ClearPlugin.java	                        (rev 0)
+++ sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/ClearPlugin.java	2010-07-14 22:39:48 UTC (rev 13395)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.encore.shell.cli.builtin;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.jboss.encore.shell.Shell;
+import org.jboss.encore.shell.plugins.Command;
+import org.jboss.encore.shell.plugins.Default;
+import org.jboss.encore.shell.plugins.Help;
+import org.jboss.encore.shell.plugins.Plugin;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ */
+ at Named("clear")
+ at Help("Clears the console output.")
+public class ClearPlugin implements Plugin
+{
+   @Inject
+   Shell shell;
+
+   @Default
+   @Command
+   public void run()
+   {
+      shell.clear();
+   }
+}

Added: sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/PwdPlugin.java
===================================================================
--- sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/PwdPlugin.java	                        (rev 0)
+++ sandbox/encore/shell/src/main/java/org/jboss/encore/shell/cli/builtin/PwdPlugin.java	2010-07-14 22:39:48 UTC (rev 13395)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.encore.shell.cli.builtin;
+
+import java.io.File;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.jboss.encore.shell.Shell;
+import org.jboss.encore.shell.plugins.Command;
+import org.jboss.encore.shell.plugins.Default;
+import org.jboss.encore.shell.plugins.Help;
+import org.jboss.encore.shell.plugins.Plugin;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ */
+ at Named("pwd")
+ at Help("Prints the current directory.")
+public class PwdPlugin implements Plugin
+{
+   @Inject
+   Shell shell;
+
+   @Default
+   @Command
+   public void run()
+   {
+      String currentDir = new File(".").getAbsolutePath();
+      shell.write(currentDir);
+   }
+}

Added: sandbox/encore/shell/src/main/java/org/jboss/encore/shell/plugins/Help.java
===================================================================
--- sandbox/encore/shell/src/main/java/org/jboss/encore/shell/plugins/Help.java	                        (rev 0)
+++ sandbox/encore/shell/src/main/java/org/jboss/encore/shell/plugins/Help.java	2010-07-14 22:39:48 UTC (rev 13395)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.encore.shell.plugins;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Describes help text for a plug-in.
+ * 
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ * 
+ */
+ at Target({ TYPE })
+ at Retention(RUNTIME)
+ at Documented
+public @interface Help
+{
+   /**
+    * The help text.
+    */
+   String value();
+}



More information about the seam-commits mailing list