You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2010/07/07 00:06:45 UTC
svn commit: r961030 -
/tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/ICURICompletor.java
Author: antelder
Date: Tue Jul 6 22:06:44 2010
New Revision: 961030
URL: http://svn.apache.org/viewvc?rev=961030&view=rev
Log:
Add a JLine COmpletor for installed contribution URIs
Added:
tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/ICURICompletor.java (with props)
Added: tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/ICURICompletor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/ICURICompletor.java?rev=961030&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/ICURICompletor.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/ICURICompletor.java Tue Jul 6 22:06:44 2010
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.shell;
+
+import java.util.List;
+
+import jline.SimpleCompletor;
+
+import org.apache.tuscany.sca.node2.Node;
+
+/**
+ * An Installed Contribution URI Completor
+ */
+public class ICURICompletor extends SimpleCompletor {
+
+ private Node node;
+
+ public ICURICompletor(Node node) {
+ super("");
+ this.node = node;
+ }
+
+ @Override
+ public int complete(final String buffer, final int cursor, final List clist) {
+ List<String> ics = node.getInstalledContributions();
+ setCandidateStrings(ics.toArray(new String[ics.size()]));
+ return super.complete(buffer, cursor, clist);
+ }
+
+}
Propchange: tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/ICURICompletor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/ICURICompletor.java
------------------------------------------------------------------------------
svn:keywords = Rev Date