You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by jo...@apache.org on 2011/08/12 13:00:51 UTC
svn commit: r1157047 [14/27] - in
/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide: ./ .settings/
META-INF/ icons/ schema/ src/ src/main/ src/main/java/ src/main/java/org/
src/main/java/org/apache/ src/main/java/org/apache/uima/ src/main/java/org...
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterBlankLinesPage.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterBlankLinesPage.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterBlankLinesPage.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterBlankLinesPage.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,90 @@
+/*
+ * 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.uima.textmarker.ide.formatter.preferences;
+
+import java.net.URL;
+
+import org.apache.uima.textmarker.ide.formatter.TextMarkerFormatterConstants;
+import org.eclipse.dltk.ui.formatter.FormatterModifyTabPage;
+import org.eclipse.dltk.ui.formatter.IFormatterControlManager;
+import org.eclipse.dltk.ui.formatter.IFormatterModifyDialog;
+import org.eclipse.dltk.ui.util.SWTFactory;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+
+
+public class TextMarkerFormatterBlankLinesPage extends FormatterModifyTabPage {
+
+ /**
+ * @param dialog
+ */
+ public TextMarkerFormatterBlankLinesPage(IFormatterModifyDialog dialog) {
+ super(dialog);
+ }
+
+ @Override
+ protected void createOptions(IFormatterControlManager manager, Composite parent) {
+ Group emptyLinesGroup = SWTFactory.createGroup(parent,
+ Messages.TextMarkerFormatterBlankLinesPage_blankLinesBeforeDeclarations, 2, 1,
+ GridData.FILL_HORIZONTAL);
+ manager.createNumber(emptyLinesGroup,
+ TextMarkerFormatterConstants.LINES_BEFORE_LONG_DECLARATIONS,
+ Messages.TextMarkerFormatterBlankLinesPage_beforeDeclarations);
+ // manager.createNumber(emptyLinesGroup,
+ // TextMarkerFormatterConstants.LINES_FILE_BETWEEN_BLOCK,
+ // Messages.TextMarkerFormatterBlankLinesPage_betweenBlocks);
+ // manager.createNumber(emptyLinesGroup,
+ // TextMarkerFormatterConstants.LINES_FILE_BETWEEN_CLASS,
+ // Messages.TextMarkerFormatterBlankLinesPage_betweenClasses);
+ // manager.createNumber(emptyLinesGroup,
+ // TextMarkerFormatterConstants.LINES_FILE_BETWEEN_METHOD,
+ // Messages.TextMarkerFormatterBlankLinesPage_betweenMethods);
+ // //
+ // Group emptyLinesInternalGroup = SWTFactory.createGroup(parent,
+ // Messages.TextMarkerFormatterBlankLinesPage_blankLinesWithingClassModuleDeclarations, 2, 1,
+ // GridData.FILL_HORIZONTAL);
+ // manager.createNumber(emptyLinesInternalGroup,
+ // TextMarkerFormatterConstants.LINES_BEFORE_FIRST,
+ // Messages.TextMarkerFormatterBlankLinesPage_befireFirstDeclaration);
+ // manager.createNumber(emptyLinesInternalGroup,
+ // TextMarkerFormatterConstants.LINES_BEFORE_MODULE,
+ // Messages.TextMarkerFormatterBlankLinesPage_beforeNestedModuleDeclarations);
+ // manager.createNumber(emptyLinesInternalGroup,
+ // TextMarkerFormatterConstants.LINES_BEFORE_CLASS,
+ // Messages.TextMarkerFormatterBlankLinesPage_beforeNestedClassDeclarations);
+ // manager.createNumber(emptyLinesInternalGroup,
+ // TextMarkerFormatterConstants.LINES_BEFORE_METHOD,
+ // Messages.TextMarkerFormatterBlankLinesPage_beforeMethodDeclarations);
+ // //
+ // Group preserveGroup = SWTFactory.createGroup(parent,
+ // Messages.TextMarkerFormatterBlankLinesPage_existingBlankLines, 2, 1,
+ // GridData.FILL_HORIZONTAL);
+ // manager.createNumber(preserveGroup,
+ // TextMarkerFormatterConstants.LINES_PRESERVE,
+ // Messages.TextMarkerFormatterBlankLinesPage_numberOfEmptyLinesToPreserve);
+ }
+
+ @Override
+ protected URL getPreviewContent() {
+ return getClass().getResource("blank-lines-preview.tm"); //$NON-NLS-1$
+ }
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterBlankLinesPage.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterBlankLinesPage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterIndentationTabPage.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterIndentationTabPage.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterIndentationTabPage.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterIndentationTabPage.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,132 @@
+/*
+ * 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.uima.textmarker.ide.formatter.preferences;
+
+import java.net.URL;
+
+import org.apache.uima.textmarker.ide.formatter.TextMarkerFormatterConstants;
+import org.eclipse.dltk.ui.CodeFormatterConstants;
+import org.eclipse.dltk.ui.formatter.FormatterModifyTabPage;
+import org.eclipse.dltk.ui.formatter.IFormatterControlManager;
+import org.eclipse.dltk.ui.formatter.IFormatterModifyDialog;
+import org.eclipse.dltk.ui.preferences.FormatterMessages;
+import org.eclipse.dltk.ui.util.SWTFactory;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Text;
+
+
+public class TextMarkerFormatterIndentationTabPage extends FormatterModifyTabPage {
+
+ /**
+ * @param dialog
+ */
+ public TextMarkerFormatterIndentationTabPage(IFormatterModifyDialog dialog) {
+ super(dialog);
+ }
+
+ private Combo tabPolicy;
+
+ private Text indentSize;
+
+ private Text tabSize;
+
+ private final String[] tabPolicyItems = new String[] { CodeFormatterConstants.SPACE,
+ CodeFormatterConstants.TAB, CodeFormatterConstants.MIXED };
+
+ private class TabPolicyListener extends SelectionAdapter implements
+ IFormatterControlManager.IInitializeListener {
+
+ private final IFormatterControlManager manager;
+
+ public TabPolicyListener(IFormatterControlManager manager) {
+ this.manager = manager;
+ }
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ int index = tabPolicy.getSelectionIndex();
+ if (index >= 0) {
+ final boolean tabMode = CodeFormatterConstants.TAB.equals(tabPolicyItems[index]);
+ manager.enableControl(indentSize, !tabMode);
+ }
+ }
+
+ public void initialize() {
+ final boolean tabMode = CodeFormatterConstants.TAB.equals(manager
+ .getString(TextMarkerFormatterConstants.FORMATTER_TAB_CHAR));
+ manager.enableControl(indentSize, !tabMode);
+ }
+
+ }
+
+ private TabPolicyListener tabPolicyListener;
+
+ @Override
+ protected void createOptions(final IFormatterControlManager manager, Composite parent) {
+ Group tabPolicyGroup = SWTFactory.createGroup(parent,
+ Messages.TextMarkerFormatterIndentationTabPage_generalSettings, 2, 1,
+ GridData.FILL_HORIZONTAL);
+ tabPolicy = manager.createCombo(tabPolicyGroup,
+ TextMarkerFormatterConstants.FORMATTER_TAB_CHAR,
+ FormatterMessages.IndentationTabPage_general_group_option_tab_policy, tabPolicyItems);
+ tabPolicyListener = new TabPolicyListener(manager);
+ tabPolicy.addSelectionListener(tabPolicyListener);
+ manager.addInitializeListener(tabPolicyListener);
+ indentSize = manager.createNumber(tabPolicyGroup,
+ TextMarkerFormatterConstants.FORMATTER_INDENTATION_SIZE,
+ FormatterMessages.IndentationTabPage_general_group_option_indent_size);
+ tabSize = manager.createNumber(tabPolicyGroup, TextMarkerFormatterConstants.FORMATTER_TAB_SIZE,
+ FormatterMessages.IndentationTabPage_general_group_option_tab_size);
+ tabSize.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ int index = tabPolicy.getSelectionIndex();
+ if (index >= 0) {
+ final boolean tabMode = CodeFormatterConstants.TAB.equals(tabPolicyItems[index]);
+ if (tabMode) {
+ indentSize.setText(tabSize.getText());
+ }
+ }
+ }
+ });
+ //
+ Group indentGroup = SWTFactory.createGroup(parent,
+ Messages.TextMarkerFormatterIndentationTabPage_indentWithinBlocks, 1, 1,
+ GridData.FILL_HORIZONTAL);
+ manager.createCheckbox(indentGroup, TextMarkerFormatterConstants.INDENT_BLOCK,
+ Messages.TextMarkerFormatterIndentationTabPage_statementsWithinBlockBody);
+ Group indentBlocks = SWTFactory.createGroup(parent,
+ Messages.TextMarkerFormatterIndentationTabPage_indentWithinCreateActions, 1, 1,
+ GridData.FILL_HORIZONTAL);
+ manager.createCheckbox(indentBlocks, TextMarkerFormatterConstants.INDENT_STRUCTURE,
+ Messages.TextMarkerFormatterIndentationTabPage_assignmentsWithinCreateAction);
+ }
+
+ @Override
+ protected URL getPreviewContent() {
+ return getClass().getResource("indentation-preview.tm");
+ }
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterIndentationTabPage.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterIndentationTabPage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterLineWrappingPage.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterLineWrappingPage.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterLineWrappingPage.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterLineWrappingPage.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,89 @@
+/*
+ * 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.uima.textmarker.ide.formatter.preferences;
+
+import java.net.URL;
+
+import org.apache.uima.textmarker.ide.formatter.TextMarkerFormatterConstants;
+import org.eclipse.dltk.ui.formatter.FormatterModifyTabPage;
+import org.eclipse.dltk.ui.formatter.IFormatterControlManager;
+import org.eclipse.dltk.ui.formatter.IFormatterModifyDialog;
+import org.eclipse.dltk.ui.util.SWTFactory;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+
+
+public class TextMarkerFormatterLineWrappingPage extends FormatterModifyTabPage {
+
+ /**
+ * @param dialog
+ */
+ public TextMarkerFormatterLineWrappingPage(IFormatterModifyDialog dialog) {
+ super(dialog);
+ }
+
+ @Override
+ protected void createOptions(IFormatterControlManager manager, Composite parent) {
+ Group emptyLinesGroup = SWTFactory.createGroup(parent,
+ Messages.TextMarkerFormatterLineWrappingPage_generalWrapping, 2, 1,
+ GridData.FILL_HORIZONTAL);
+ manager.createNumber(emptyLinesGroup, TextMarkerFormatterConstants.MAX_LINE_LENGTH,
+ Messages.TextMarkerFormatterLineWrappingPage_maximumLineLenght);
+ // manager.createNumber(emptyLinesGroup,
+ // TextMarkerFormatterConstants.LINES_FILE_BETWEEN_BLOCK,
+ // Messages.TextMarkerFormatterBlankLinesPage_betweenBlocks);
+ // manager.createNumber(emptyLinesGroup,
+ // TextMarkerFormatterConstants.LINES_FILE_BETWEEN_CLASS,
+ // Messages.TextMarkerFormatterBlankLinesPage_betweenClasses);
+ // manager.createNumber(emptyLinesGroup,
+ // TextMarkerFormatterConstants.LINES_FILE_BETWEEN_METHOD,
+ // Messages.TextMarkerFormatterBlankLinesPage_betweenMethods);
+ // //
+ // Group emptyLinesInternalGroup = SWTFactory.createGroup(parent,
+ // Messages.TextMarkerFormatterBlankLinesPage_blankLinesWithingClassModuleDeclarations, 2, 1,
+ // GridData.FILL_HORIZONTAL);
+ // manager.createNumber(emptyLinesInternalGroup,
+ // TextMarkerFormatterConstants.LINES_BEFORE_FIRST,
+ // Messages.TextMarkerFormatterBlankLinesPage_befireFirstDeclaration);
+ // manager.createNumber(emptyLinesInternalGroup,
+ // TextMarkerFormatterConstants.LINES_BEFORE_MODULE,
+ // Messages.TextMarkerFormatterBlankLinesPage_beforeNestedModuleDeclarations);
+ // manager.createNumber(emptyLinesInternalGroup,
+ // TextMarkerFormatterConstants.LINES_BEFORE_CLASS,
+ // Messages.TextMarkerFormatterBlankLinesPage_beforeNestedClassDeclarations);
+ // manager.createNumber(emptyLinesInternalGroup,
+ // TextMarkerFormatterConstants.LINES_BEFORE_METHOD,
+ // Messages.TextMarkerFormatterBlankLinesPage_beforeMethodDeclarations);
+ // //
+ // Group preserveGroup = SWTFactory.createGroup(parent,
+ // Messages.TextMarkerFormatterBlankLinesPage_existingBlankLines, 2, 1,
+ // GridData.FILL_HORIZONTAL);
+ // manager.createNumber(preserveGroup,
+ // TextMarkerFormatterConstants.LINES_PRESERVE,
+ // Messages.TextMarkerFormatterBlankLinesPage_numberOfEmptyLinesToPreserve);
+ }
+
+ @Override
+ protected URL getPreviewContent() {
+ return getClass().getResource("wrapping-preview.tm"); //$NON-NLS-1$
+ }
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterLineWrappingPage.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterLineWrappingPage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterModifyDialog.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterModifyDialog.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterModifyDialog.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterModifyDialog.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,49 @@
+/*
+ * 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.uima.textmarker.ide.formatter.preferences;
+
+import org.eclipse.dltk.ui.formatter.FormatterModifyDialog;
+import org.eclipse.dltk.ui.formatter.IFormatterModifyDialogOwner;
+import org.eclipse.dltk.ui.formatter.IScriptFormatterFactory;
+
+public class TextMarkerFormatterModifyDialog extends FormatterModifyDialog {
+
+ /**
+ * @param parent
+ */
+ public TextMarkerFormatterModifyDialog(IFormatterModifyDialogOwner dialogOwner,
+ IScriptFormatterFactory formatterFactory) {
+ super(dialogOwner, formatterFactory);
+ setTitle(Messages.TextMarkerFormatterModifyDialog_TextMarkerFormatter);
+ }
+
+ @Override
+ protected void addPages() {
+ addTabPage(Messages.TextMarkerFormatterModifyDialog_indentation,
+ new TextMarkerFormatterIndentationTabPage(this));
+ addTabPage(Messages.TextMarkerFormatterModifyDialog_blankLines,
+ new TextMarkerFormatterBlankLinesPage(this));
+ addTabPage(Messages.TextMarkerFormatterModifyDialog_lineWrapping,
+ new TextMarkerFormatterLineWrappingPage(this));
+ // addTabPage(Messages.TextMarkerFormatterModifyDialog_comments,
+ // new TextMarkerFormatterCommentsPage(this));
+ }
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterModifyDialog.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/TextMarkerFormatterModifyDialog.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/bak_indentation-preview.tm
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/bak_indentation-preview.tm?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/bak_indentation-preview.tm (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/bak_indentation-preview.tm Fri Aug 12 11:00:38 2011
@@ -0,0 +1,60 @@
+PACKAGE org.apache.uima;
+
+SCRIPT org.apache.uima.DashTree;
+SCRIPT org.apache.uima.DashTreeError;
+SCRIPT org.apache.uima.BuildTree;
+TYPESYSTEM org.apache.uima.TerminologyTypeSystem;
+
+Document(CALL,DashTree);
+
+DECLARE link;
+entryContent curlyBracketsOpen inCurlyBrackets{-PARTOF,link}(MARK,link,3) curlyBracketsClose;
+
+Document(RETAINTYPE);
+
+// *** error handling ***
+Document(CALL,DashTreeError);
+// *** end of error handling ***
+
+// *** statistics ***
+INT count;
+Document{TOTALCOUNT,error,1,1000000,count}
+ (LOG,"Longmenu.txt: Es wurde(n) "+(count)+" Fehler gefunden!");
+Document{TOTALCOUNT,rootRow,1,1000000,count}
+ (LOG,"Longmenu.txt: Es wurde(n) "+(count)+" Wurzel-Elemente gefunden.");
+Document{TOTALCOUNT,childRow,1,1000000,count}
+ (LOG,"Longmenu.txt: Es wurde(n) "+(count)+" Kind-Elemente gefunden.");
+// *** end of statistics ***
+
+INT id;
+
+ACTION IncID = (ASSIGN,id,id+1);
+
+
+BLOCK(ChildRows) childRow {
+ childRow[1,9](ASSIGN,id,1+id;
+ CREATE,Term,
+ "Text" = entryContent,
+ "Info" = link,
+ "Id" = "A" + (id),
+ "TermType" = "answer");
+}
+
+BLOCK(RootRow) rootRow {
+ rootRow(ASSIGN,id,1+id;
+ CREATE,Term,
+ "Text" = entryContent,
+ "Info" = link,
+ "Id" = "A" + (id),
+ "TermType" = "answer");
+}
+
+Term{PARTOF,rootRow}(TRANSFER,Root);
+
+Term{PARTOF,rootRow}(MARK,SubTree,1,2) Term+{-PARTOF,rootRow};
+Document(CALL,BuildTree.BuildDashTree);
+
+
+
+
+
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/bak_indentation-preview.tm
------------------------------------------------------------------------------
svn:executable = *
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/blank-lines-preview.tm
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/blank-lines-preview.tm?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/blank-lines-preview.tm (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/blank-lines-preview.tm Fri Aug 12 11:00:38 2011
@@ -0,0 +1,7 @@
+PACKAGE org.apache.uima;
+
+DECLARE childRow, Doc2, Doc3, Doc4, Doc5;
+INT id;
+BOOLEAN b = false;
+
+BLOCK(ChildRows)childRow{}{childRow[1,9]{IF(b)->ASSIGN(id,1+id), ASSIGN(b,true)};Doc2{->MARK(childRow)};}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/blank-lines-preview.tm
------------------------------------------------------------------------------
svn:executable = *
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/indentation-preview.tm
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/indentation-preview.tm?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/indentation-preview.tm (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/indentation-preview.tm Fri Aug 12 11:00:38 2011
@@ -0,0 +1,10 @@
+PACKAGE org.apache.uima;
+
+DECLARE childRow, Doc2, Doc3, Doc4, Doc5;
+INT id;
+BOOLEAN b = false;
+
+BLOCK(ChildRows)childRow{}{childRow[1,9]{IF(b)->ASSIGN(id,1+id), ASSIGN(b,true)};Doc2{->MARK(childRow)};}
+
+
+
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/indentation-preview.tm
------------------------------------------------------------------------------
svn:executable = *
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/messages.properties
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/messages.properties?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/messages.properties (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/messages.properties Fri Aug 12 11:00:38 2011
@@ -0,0 +1,39 @@
+# ***************************************************************
+# * 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.
+# ***************************************************************
+
+TextMarkerFormatterModifyDialog_TextMarkerFormatter=TextMarker Formatter
+
+TextMarkerFormatterModifyDialog_indentation=Indentation
+TextMarkerFormatterIndentationTabPage_statementsWithinBlockBody=Statements within Blocks
+TextMarkerFormatterIndentationTabPage_assignmentsWithinCreateAction=Feature assignments within CREATE actions
+TextMarkerFormatterIndentationTabPage_generalSettings=General Settings
+TextMarkerFormatterIndentationTabPage_indentationCharacter=Indentation character
+TextMarkerFormatterIndentationTabPage_indentationSize=Indentation size
+TextMarkerFormatterIndentationTabPage_indentWithinBlocks=Indent within Blocks
+TextMarkerFormatterIndentationTabPage_indentWithinCreateActions=Indent within CREATE actions
+TextMarkerFormatterIndentationTabPage_tabSize=Tab size
+
+TextMarkerFormatterModifyDialog_blankLines=Blank Lines
+TextMarkerFormatterBlankLinesPage_blankLinesBeforeDeclarations=Declarations
+TextMarkerFormatterBlankLinesPage_beforeDeclarations=Lines before long declarations
+TextMarkerFormatterBlankLinesPage_numberOfEmptyLinesToPreserve=Number of empty lines to preserve
+
+TextMarkerFormatterModifyDialog_lineWrapping=Line Wrapping
+TextMarkerFormatterLineWrappingPage_generalWrapping=General
+TextMarkerFormatterLineWrappingPage_maximumLineLenght=Maximum line length
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/messages.properties
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/messages.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/wrapping-preview.tm
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/wrapping-preview.tm?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/wrapping-preview.tm (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/wrapping-preview.tm Fri Aug 12 11:00:38 2011
@@ -0,0 +1,10 @@
+PACKAGE org.apache.uima;
+
+DECLARE childRow, Doc2, Doc3, Doc4, Doc5;
+INT id;
+BOOLEAN b = false;
+
+BLOCK(ChildRows)childRow{}{childRow[1,9]{IF(b)->ASSIGN(id,1+id), ASSIGN(b,true)};Doc2{->MARK(childRow)};}
+
+
+
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/formatter/preferences/wrapping-preview.tm
------------------------------------------------------------------------------
svn:executable = *
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/GenericTextMarkerInstall.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/GenericTextMarkerInstall.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/GenericTextMarkerInstall.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/GenericTextMarkerInstall.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,81 @@
+/*
+ * 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.uima.textmarker.ide.launching;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.uima.textmarker.ide.core.TextMarkerNature;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.dltk.launching.AbstractInterpreterInstall;
+import org.eclipse.dltk.launching.IInterpreterInstallType;
+import org.eclipse.dltk.launching.IInterpreterRunner;
+
+
+public class GenericTextMarkerInstall extends AbstractInterpreterInstall {
+
+ @Override
+ public String getBuiltinModuleContent(String name) {
+ InputStream stream = GenericTextMarkerInstall.class.getResourceAsStream("builtins.tm");
+ DataInputStream st = new DataInputStream(stream);
+ StringBuffer buf = new StringBuffer();
+ try {
+ while (st.available() >= 0) {
+ String line = st.readLine();
+ if (line == null)
+ break;
+ buf.append(line);
+ buf.append('\n');
+ }
+
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return buf.toString();
+ }
+
+ @Override
+ public String[] getBuiltinModules() {
+ return new String[] { "builtins.tm" };
+ }
+
+ public GenericTextMarkerInstall(IInterpreterInstallType type, String id) {
+ super(type, id);
+ }
+
+ @Override
+ public IInterpreterRunner getInterpreterRunner(String mode) {
+ IInterpreterRunner runner = super.getInterpreterRunner(mode);
+ if (runner != null) {
+ return runner;
+ }
+
+ if (mode.equals(ILaunchManager.RUN_MODE)) {
+ return new TextMarkerInterpreterRunner(this);
+ }
+ return null;
+ }
+
+ public String getNatureId() {
+ return TextMarkerNature.NATURE_ID;
+ }
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/GenericTextMarkerInstall.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/GenericTextMarkerInstall.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/GenericTextMarkerInstallType.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/GenericTextMarkerInstallType.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/GenericTextMarkerInstallType.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/GenericTextMarkerInstallType.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,130 @@
+/*
+ * 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.uima.textmarker.ide.launching;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Map;
+
+import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
+import org.apache.uima.textmarker.ide.core.TextMarkerNature;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.dltk.core.environment.IDeployment;
+import org.eclipse.dltk.core.environment.IFileHandle;
+import org.eclipse.dltk.internal.launching.AbstractInterpreterInstallType;
+import org.eclipse.dltk.launching.EnvironmentVariable;
+import org.eclipse.dltk.launching.IInterpreterInstall;
+import org.eclipse.dltk.launching.LibraryLocation;
+
+public class GenericTextMarkerInstallType extends AbstractInterpreterInstallType {
+
+ public static final String DBGP_FOR_TM_BUNDLE_ID = "org.apache.uima.textmarker.ide.interpreter.dbgp";
+
+ public static final String EMBEDDED_TM_BUNDLE_ID = "org.apache.uima.textmarker.ide.interpreter";
+
+ public String getNatureId() {
+ return TextMarkerNature.NATURE_ID;
+ }
+
+ public String getName() {
+ return "Generic TextMarker Install";
+ }
+
+ @Override
+ public LibraryLocation[] getDefaultLibraryLocations(IFileHandle installLocation,
+ EnvironmentVariable[] variables, IProgressMonitor monitor) {
+ return new LibraryLocation[0];
+ }
+
+ private static String[] possibleExes = { "tm" };
+
+ @Override
+ protected String getPluginId() {
+ return TextMarkerIdePlugin.PLUGIN_ID;
+ }
+
+ @Override
+ protected String[] getPossibleInterpreterNames() {
+ return possibleExes;
+ }
+
+ @Override
+ protected IInterpreterInstall doCreateInterpreterInstall(String id) {
+ return new GenericTextMarkerInstall(this, id);
+ }
+
+ @Override
+ protected void filterEnvironment(Map environment) {
+ environment.remove("TMLIBPATH");
+ environment.remove("DISPLAY");
+ }
+
+ @Override
+ public IStatus validateInstallLocation(IFileHandle installLocation) {
+ return Status.OK_STATUS;
+ }
+
+ @Override
+ protected IPath createPathFile(IDeployment deployment) throws IOException {
+ throw new RuntimeException("This method should not be used");
+ }
+
+ @Override
+ protected String[] parsePaths(String result) {
+ ArrayList paths = new ArrayList();
+ String subs = null;
+ int index = 0;
+ while (index < result.length()) {
+ // skip whitespaces
+ while (index < result.length() && Character.isWhitespace(result.charAt(index)))
+ index++;
+ if (index == result.length())
+ break;
+
+ if (result.charAt(index) == '{') {
+ int start = index;
+ while (index < result.length() && result.charAt(index) != '}')
+ index++;
+ if (index == result.length())
+ break;
+ subs = result.substring(start + 1, index);
+ } else {
+ int start = index;
+ while (index < result.length() && result.charAt(index) != ' ')
+ index++;
+ subs = result.substring(start, index);
+ }
+
+ paths.add(subs);
+ index++;
+ }
+
+ return (String[]) paths.toArray(new String[paths.size()]);
+ }
+
+ @Override
+ protected ILog getLog() {
+ return TextMarkerIdePlugin.getDefault().getLog();
+ }
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/GenericTextMarkerInstallType.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/GenericTextMarkerInstallType.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/IConfigurableRunner.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/IConfigurableRunner.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/IConfigurableRunner.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/IConfigurableRunner.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,25 @@
+/*
+ * 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.uima.textmarker.ide.launching;
+
+public interface IConfigurableRunner {
+
+ public void setRunnerConfig(ITextMarkerInterpreterRunnerConfig config);
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/IConfigurableRunner.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/IConfigurableRunner.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/ITextMarkerInterpreterRunnerConfig.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/ITextMarkerInterpreterRunnerConfig.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/ITextMarkerInterpreterRunnerConfig.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/ITextMarkerInterpreterRunnerConfig.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,38 @@
+/*
+ * 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.uima.textmarker.ide.launching;
+
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.dltk.launching.InterpreterConfig;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.launching.VMRunnerConfiguration;
+
+public interface ITextMarkerInterpreterRunnerConfig {
+
+ public String getRunnerClassName(InterpreterConfig config, ILaunch launch, IJavaProject project);
+
+ public String[] computeClassPath(InterpreterConfig config, ILaunch launch, IJavaProject project)
+ throws Exception;
+
+ public String[] getProgramArguments(InterpreterConfig config, ILaunch launch, IJavaProject project);
+
+ public void adjustRunnerConfiguration(VMRunnerConfiguration vconfig, InterpreterConfig iconfig,
+ ILaunch launch, IJavaProject project);
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/ITextMarkerInterpreterRunnerConfig.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/ITextMarkerInterpreterRunnerConfig.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/JavaLocalApplicationLaunchConfigurationDelegate.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/JavaLocalApplicationLaunchConfigurationDelegate.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/JavaLocalApplicationLaunchConfigurationDelegate.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/JavaLocalApplicationLaunchConfigurationDelegate.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,81 @@
+/*
+ * 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.uima.textmarker.ide.launching;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
+import org.eclipse.debug.core.model.ISourceLocator;
+import org.eclipse.debug.core.model.IStackFrame;
+import org.eclipse.dltk.debug.core.DLTKDebugPlugin;
+import org.eclipse.dltk.debug.core.IDbgpService;
+import org.eclipse.dltk.debug.core.model.IScriptDebugTarget;
+import org.eclipse.dltk.debug.ui.ScriptStreamProxy;
+import org.eclipse.dltk.internal.debug.core.model.ScriptDebugTarget;
+import org.eclipse.jdt.launching.JavaLaunchDelegate;
+import org.eclipse.ui.console.IOConsole;
+
+public class JavaLocalApplicationLaunchConfigurationDelegate extends JavaLaunchDelegate implements
+ ILaunchConfigurationDelegate {
+
+ @Override
+ public String getVMArguments(ILaunchConfiguration configuration) throws CoreException {
+ return super.getVMArguments(configuration);
+ }
+
+ @Override
+ public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch,
+ IProgressMonitor monitor) throws CoreException {
+ // System.out.println("launching");
+ IDbgpService dbgpService = null;
+ try {
+ dbgpService = DLTKDebugPlugin.getDefault().getDbgpService();
+
+ IScriptDebugTarget target = new ScriptDebugTarget(
+ "org.apache.uima.textmarker.ide.debug.textmarkerModel", dbgpService, "hello", launch,
+ null);
+ IOConsole cs = new IOConsole("aa", null);
+ ScriptStreamProxy proxy = new ScriptStreamProxy(cs);
+ target.setStreamProxy(proxy);
+ launch.addDebugTarget(target);
+ final ISourceLocator sourceLocator = launch.getSourceLocator();
+ final TextMarkerSourceLookupDirector l = new TextMarkerSourceLookupDirector();
+ launch.setSourceLocator(new ISourceLocator() {
+
+ public Object getSourceElement(IStackFrame stackFrame) {
+ Object sourceElement = sourceLocator.getSourceElement(stackFrame);
+ if (sourceElement != null)
+ return sourceElement;
+ return l.getSourceElement(stackFrame);
+ }
+
+ });
+ } catch (Exception e) {
+
+ }
+
+ super.launch(configuration, mode, launch, monitor);
+ }
+
+ public static final String LOCAL_APPLICATION = "debug.localJavaApplication";
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/JavaLocalApplicationLaunchConfigurationDelegate.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/JavaLocalApplicationLaunchConfigurationDelegate.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/JavaLocalApplicationTabGroup.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/JavaLocalApplicationTabGroup.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/JavaLocalApplicationTabGroup.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/JavaLocalApplicationTabGroup.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,32 @@
+/*
+ * 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.uima.textmarker.ide.launching;
+
+import org.eclipse.debug.ui.ILaunchConfigurationDialog;
+
+public class JavaLocalApplicationTabGroup extends
+ org.eclipse.jdt.internal.debug.ui.launcher.LocalJavaApplicationTabGroup {
+
+ @Override
+ public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
+ super.createTabs(dialog, mode);
+ }
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/JavaLocalApplicationTabGroup.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/JavaLocalApplicationTabGroup.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerDebuggingEngineSelector.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerDebuggingEngineSelector.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerDebuggingEngineSelector.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerDebuggingEngineSelector.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,34 @@
+/*
+ * 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.uima.textmarker.ide.launching;
+
+import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
+import org.apache.uima.textmarker.ide.debug.TextMarkerDebugConstants;
+import org.eclipse.dltk.core.DLTKIdContributionSelector;
+import org.eclipse.dltk.core.PreferencesLookupDelegate;
+
+public class TextMarkerDebuggingEngineSelector extends DLTKIdContributionSelector {
+ @Override
+ protected String getSavedContributionId(PreferencesLookupDelegate delegate) {
+ return delegate.getString(TextMarkerIdePlugin.PLUGIN_ID,
+ TextMarkerDebugConstants.DEBUGGING_ENGINE_ID_KEY);
+ }
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerDebuggingEngineSelector.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerDebuggingEngineSelector.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerInterpreterRunner.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerInterpreterRunner.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerInterpreterRunner.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerInterpreterRunner.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,364 @@
+/*
+ * 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.uima.textmarker.ide.launching;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Handler;
+import java.util.logging.LogRecord;
+import java.util.logging.Logger;
+
+import org.apache.uima.UIMAFramework;
+import org.apache.uima.analysis_engine.AnalysisEngine;
+import org.apache.uima.cas.CAS;
+import org.apache.uima.cas.impl.XmiCasDeserializer;
+import org.apache.uima.cas.impl.XmiCasSerializer;
+import org.apache.uima.resource.ResourceManager;
+import org.apache.uima.resource.ResourceSpecifier;
+import org.apache.uima.textmarker.action.LogAction;
+import org.apache.uima.textmarker.engine.TextMarkerEngine;
+import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
+import org.apache.uima.textmarker.ide.core.builder.TextMarkerProjectUtils;
+import org.apache.uima.util.FileUtils;
+import org.apache.uima.util.XMLInputSource;
+import org.apache.uima.util.XMLSerializer;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.dltk.core.DLTKCore;
+import org.eclipse.dltk.core.IScriptProject;
+import org.eclipse.dltk.launching.AbstractInterpreterRunner;
+import org.eclipse.dltk.launching.AbstractScriptLaunchConfigurationDelegate;
+import org.eclipse.dltk.launching.IInterpreterInstall;
+import org.eclipse.dltk.launching.InterpreterConfig;
+import org.eclipse.dltk.launching.ScriptLaunchConfigurationConstants;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jdt.launching.VMRunnerConfiguration;
+import org.eclipse.ui.console.ConsolePlugin;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsoleManager;
+import org.eclipse.ui.console.MessageConsole;
+import org.eclipse.ui.console.MessageConsoleStream;
+import org.xml.sax.SAXException;
+
+public class TextMarkerInterpreterRunner extends AbstractInterpreterRunner implements
+ IConfigurableRunner {
+
+ public static final ITextMarkerInterpreterRunnerConfig DEFAULT_CONFIG = new ITextMarkerInterpreterRunnerConfig() {
+
+ public void adjustRunnerConfiguration(VMRunnerConfiguration vconfig, InterpreterConfig iconfig,
+ ILaunch launch, IJavaProject project) {
+ System.out.println("adjust runner");
+ }
+
+ public String[] computeClassPath(InterpreterConfig config, ILaunch launch, IJavaProject project)
+ throws Exception {
+ return TextMarkerInterpreterRunner.getClassPath(project);
+ }
+
+ public String[] getProgramArguments(InterpreterConfig config, ILaunch launch,
+ IJavaProject project) {
+ return new String[0];
+ }
+
+ public String getRunnerClassName(InterpreterConfig config, ILaunch launch, IJavaProject project) {
+ return "TextMarkerRunner";
+ }
+
+ };
+
+ private ITextMarkerInterpreterRunnerConfig config = DEFAULT_CONFIG;
+
+ @Override
+ public void run(InterpreterConfig config, ILaunch launch, IProgressMonitor monitor)
+ throws CoreException {
+ doRunImpl(config, launch, this.config, monitor);
+ }
+
+ private static Handler initConsoleLink(String module) {
+ final MessageConsole console;
+ final MessageConsoleStream out;
+ console = findConsole(module);
+ out = console.newMessageStream();
+
+ Handler handler = new Handler() {
+
+ @Override
+ public void publish(LogRecord record) {
+ String message = record.getMessage();
+ if (message.equals("\\n")) {
+ out.println();
+ }
+ String[] split = message.split("\\\\n");
+ for (String string : split) {
+ out.println(string);
+ }
+ console.activate();
+ }
+
+ @Override
+ public void flush() {
+
+ }
+
+ @Override
+ public void close() throws SecurityException {
+
+ }
+ };
+ Logger.getLogger(LogAction.LOGGER_NAME).addHandler(handler);
+ return handler;
+ }
+
+ private static void clearConsoleLink(Handler handler) {
+ Logger.getLogger(LogAction.LOGGER_NAME).removeHandler(handler);
+ }
+
+ private static MessageConsole findConsole(String name) {
+ ConsolePlugin plugin = ConsolePlugin.getDefault();
+ IConsoleManager conMan = plugin.getConsoleManager();
+ IConsole[] existing = conMan.getConsoles();
+ for (int i = 0; i < existing.length; i++)
+ if (name.equals(existing[i].getName()))
+ return (MessageConsole) existing[i];
+ MessageConsole myConsole = new MessageConsole(name, null);
+ conMan.addConsoles(new IConsole[] { myConsole });
+ return myConsole;
+ }
+
+ public static List<File> getFiles(File dir, boolean recusive) {
+ List<File> result = new ArrayList<File>();
+ for (File each : dir.listFiles()) {
+ // TODO: find a solution for this hotfix
+ if (each.getName().endsWith(".svn")) {
+ continue;
+ }
+ result.add(each);
+ if (each.isDirectory() && recusive) {
+ result.addAll(getFiles(each, recusive));
+ }
+ }
+ return result;
+ }
+
+ public static void doRunImpl(InterpreterConfig config, ILaunch launch,
+ ITextMarkerInterpreterRunnerConfig iconfig, IProgressMonitor monitor)
+ throws CoreException {
+ String launchMode = launch.getLaunchMode();
+ IScriptProject proj = AbstractScriptLaunchConfigurationDelegate.getScriptProject(launch
+ .getLaunchConfiguration());
+
+ IPath projectPath = proj.getResource().getLocation();
+ IPath inputDirPath = projectPath.append(TextMarkerProjectUtils.getDefaultInputLocation());
+ IPath outputDirPath = projectPath.append(TextMarkerProjectUtils.getDefaultOutputLocation());
+ String engine = TextMarkerProjectUtils.getEngineDescriptorPath(config.getScriptFilePath(),
+ proj.getProject()).toPortableString();
+ IPath rootPath = TextMarkerProjectUtils.getDescriptorRootPath(proj.getProject());
+
+ File inputDir = inputDirPath.makeAbsolute().toFile();
+ File outputDir = outputDirPath.makeAbsolute().toFile();
+
+ List<File> inputFiles = getFiles(inputDir, false);
+
+ int ticks = (inputFiles.size() * 2) + 1;
+ SubProgressMonitor mon = new SubProgressMonitor(monitor, ticks);
+
+ mon.setTaskName("Initializing");
+ Handler handler = initConsoleLink(config.getScriptFilePath().lastSegment());
+
+ CAS cas = null;
+
+ AnalysisEngine ae = null;
+ try {
+ File specFile = new File(engine);
+ XMLInputSource in = new XMLInputSource(specFile);
+ ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
+ ResourceManager resMgr = UIMAFramework.newDefaultResourceManager();
+ resMgr.setDataPath(rootPath.toPortableString());
+ ae = UIMAFramework.produceAnalysisEngine(specifier, resMgr, null);
+ } catch (Exception e) {
+ String message = e.getMessage();
+ DLTKCore.error(message, e);
+ clearConsoleLink(handler);
+ throw new CoreException(new Status(IStatus.ERROR, TextMarkerIdePlugin.PLUGIN_ID,
+ ScriptLaunchConfigurationConstants.ERR_INTERNAL_ERROR, message, e));
+ }
+
+ AnalysisEngine mae = null;
+ try {
+ // modifier
+ IPath modifierPath = rootPath.append("Modifier.xml");
+ File modifierFile = new File(modifierPath.toPortableString());
+ if (modifierFile.exists()) {
+ XMLInputSource min = new XMLInputSource(modifierFile);
+ ResourceSpecifier mspecifier = UIMAFramework.getXMLParser().parseResourceSpecifier(min);
+ mae = UIMAFramework.produceAnalysisEngine(mspecifier);
+ String sml = (String) ae.getConfigParameterValue(TextMarkerEngine.STYLE_MAP);
+ mae.setConfigParameterValue(TextMarkerEngine.STYLE_MAP, sml);
+ mae.setConfigParameterValue(TextMarkerEngine.DESCRIPTOR_PATHS,
+ ae.getConfigParameterValue(TextMarkerEngine.DESCRIPTOR_PATHS));
+ mae.reconfigure();
+ }
+ } catch (Exception e) {
+ String message = e.getMessage();
+ DLTKCore.error(message, e);
+ clearConsoleLink(handler);
+ throw new CoreException(new Status(IStatus.ERROR, TextMarkerIdePlugin.PLUGIN_ID,
+ ScriptLaunchConfigurationConstants.ERR_INTERNAL_ERROR, message, e));
+ }
+ try {
+ if ("debug".equals(launchMode)) {
+ ae.setConfigParameterValue(TextMarkerEngine.CREATE_DEBUG_INFO, true);
+ ae.setConfigParameterValue(TextMarkerEngine.CREATE_MATCH_DEBUG_INFO, true);
+ ae.setConfigParameterValue(TextMarkerEngine.CREATE_PROFILING_INFO, true);
+ ae.setConfigParameterValue(TextMarkerEngine.CREATE_STATISTIC_INFO, true);
+ ae.reconfigure();
+ }
+ } catch (Exception e) {
+ clearConsoleLink(handler);
+ String message = e.getMessage();
+ DLTKCore.error(message, e);
+ throw new CoreException(new Status(IStatus.ERROR, TextMarkerIdePlugin.PLUGIN_ID,
+ ScriptLaunchConfigurationConstants.ERR_INTERNAL_ERROR, message, e));
+ }
+ mon.worked(1);
+ for (File each : inputFiles) {
+
+ mon.setTaskName("Processing " + each.getName());
+ try {
+ if (cas == null) {
+ cas = ae.newCAS();
+ } else {
+ cas.reset();
+ }
+ if (each.getName().endsWith("xmi")) {
+ XmiCasDeserializer.deserialize(new FileInputStream(each), cas, true);
+ } else {
+ cas.setDocumentText(getText(each));
+ }
+ TextMarkerEngine.removeSourceDocumentInformation(cas);
+ TextMarkerEngine.addSourceDocumentInformation(cas, each);
+
+ ae.process(cas);
+ if (mae != null) {
+ mae.process(cas);
+ }
+ mon.worked(1);
+ File outputFile = new File(outputDir, each.getName() + ".xmi");
+ mon.setTaskName("Saving " + outputFile.getName());
+ writeXmi(cas, outputFile);
+ if (mae != null) {
+ CAS modifiedCas = cas.getView(TextMarkerEngine.MODIFIED_SOFA);
+ String documentText = modifiedCas.getDocumentText();
+ if (documentText != null) {
+ FileUtils.saveString2File(documentText, new File(outputDir, each.getName()
+ + ".modified.html"));
+ }
+ }
+ mon.worked(1);
+ } catch (Exception e) {
+ if (cas != null) {
+ cas.release();
+ }
+ clearConsoleLink(handler);
+ String message = e.getMessage();
+ DLTKCore.error(message, e);
+ throw new CoreException(new Status(IStatus.ERROR, TextMarkerIdePlugin.PLUGIN_ID,
+ ScriptLaunchConfigurationConstants.ERR_INTERNAL_ERROR, message, e));
+ }
+ }
+ if (outputDir.listFiles().length == 1) {
+ // show it...?
+ }
+ if (cas != null) {
+ cas.release();
+ }
+
+ IFolder folder = proj.getProject().getFolder(TextMarkerProjectUtils.getDefaultOutputLocation());
+ folder.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ clearConsoleLink(handler);
+ mon.done();
+ }
+
+ private static String getText(File each) {
+ try {
+ return org.apache.uima.pear.util.FileUtil.loadTextFile(each, "UTF-8");
+ } catch (IOException e) {
+ DLTKCore.error(e.getMessage(), e);
+ }
+ return "";
+ }
+
+ private static void writeXmi(CAS aCas, File name) throws IOException, SAXException {
+ FileOutputStream out = null;
+
+ try {
+ // write XMI
+ out = new FileOutputStream(name);
+ XmiCasSerializer ser = new XmiCasSerializer(aCas.getTypeSystem());
+ XMLSerializer xmlSer = new XMLSerializer(out, false);
+ ser.serialize(aCas, xmlSer.getContentHandler());
+ } finally {
+ if (out != null) {
+ out.close();
+ }
+ }
+ }
+
+ public static String[] getClassPath(IJavaProject myJavaProject) {
+ String[] newClassPath = new String[0];// classPath.length + 2];
+ return newClassPath;
+ }
+
+ protected static String[] computeBaseClassPath(IJavaProject myJavaProject) throws CoreException {
+ if (!myJavaProject.exists())
+ return new String[0];
+ return JavaRuntime.computeDefaultRuntimeClassPath(myJavaProject);
+ }
+
+ protected String constructProgramString(InterpreterConfig config) {
+ return "";
+ }
+
+ public TextMarkerInterpreterRunner(IInterpreterInstall install) {
+ super(install);
+ }
+
+ @Override
+ protected String getProcessType() {
+ return TextMarkerLaunchConfigurationConstants.ID_TM_PROCESS_TYPE;
+ }
+
+ public void setRunnerConfig(ITextMarkerInterpreterRunnerConfig config) {
+ this.config = config;
+ }
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerInterpreterRunner.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerInterpreterRunner.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerLaunchConfigurationConstants.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerLaunchConfigurationConstants.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerLaunchConfigurationConstants.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerLaunchConfigurationConstants.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,32 @@
+/*
+ * 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.uima.textmarker.ide.launching;
+
+import org.eclipse.dltk.launching.ScriptLaunchConfigurationConstants;
+
+public class TextMarkerLaunchConfigurationConstants extends ScriptLaunchConfigurationConstants {
+ protected TextMarkerLaunchConfigurationConstants() {
+
+ }
+
+ public static final String ID_TM_SCRIPT = "org.apache.uima.textmarker.ide.launching.TextMarkerLaunchConfigurationType"; //$NON-NLS-1$
+
+ public static final String ID_TM_PROCESS_TYPE = "textmarkerInterpreter"; //$NON-NLS-1$
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerLaunchConfigurationConstants.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerLaunchConfigurationConstants.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerLaunchConfigurationDelegate.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerLaunchConfigurationDelegate.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerLaunchConfigurationDelegate.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerLaunchConfigurationDelegate.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,56 @@
+/*
+ * 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.uima.textmarker.ide.launching;
+
+import org.apache.uima.textmarker.ide.core.TextMarkerNature;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.dltk.launching.AbstractScriptLaunchConfigurationDelegate;
+import org.eclipse.dltk.launching.IInterpreterRunner;
+import org.eclipse.dltk.launching.InterpreterConfig;
+
+
+public class TextMarkerLaunchConfigurationDelegate extends
+ AbstractScriptLaunchConfigurationDelegate {
+
+ @Override
+ protected void runRunner(ILaunchConfiguration configuration, IInterpreterRunner runner,
+ InterpreterConfig config, ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ if (runner instanceof IConfigurableRunner) {
+ ITextMarkerInterpreterRunnerConfig runnerConfig = getConfig();
+ if (runnerConfig != null) {
+ IConfigurableRunner rc = (IConfigurableRunner) runner;
+ rc.setRunnerConfig(runnerConfig);
+ }
+ }
+ runner.run(config, launch, monitor);
+ }
+
+ public ITextMarkerInterpreterRunnerConfig getConfig() {
+ return null;
+ }
+
+ @Override
+ public String getLanguageId() {
+ return TextMarkerNature.NATURE_ID;
+ }
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerLaunchConfigurationDelegate.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerLaunchConfigurationDelegate.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerSourceLookupDirector.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerSourceLookupDirector.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerSourceLookupDirector.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerSourceLookupDirector.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,83 @@
+/*
+ * 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.uima.textmarker.ide.launching;
+
+import java.io.File;
+import java.net.URI;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.model.IPersistableSourceLocator;
+import org.eclipse.debug.core.model.IStackFrame;
+import org.eclipse.dltk.internal.debug.core.model.ScriptStackFrame;
+
+public class TextMarkerSourceLookupDirector implements IPersistableSourceLocator {
+
+ public TextMarkerSourceLookupDirector() {
+ }
+
+ public Object getSourceElement(IStackFrame stackFrame) {
+ if (stackFrame instanceof ScriptStackFrame) {
+ ScriptStackFrame sf = (ScriptStackFrame) stackFrame;
+ URI uri = sf.getFileName();
+
+ String pathname = uri.getPath();
+ if (Platform.getOS().equals(Platform.OS_WIN32)) {
+ pathname = pathname.substring(1);
+ }
+
+ File file = new File(pathname);
+
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IContainer container = root.getContainerForLocation(new Path(file.getParent()));
+
+ if (container != null) {
+ IResource resource = container.findMember(file.getName());
+
+ if (resource instanceof IFile) {
+ return resource;
+ }
+ } else {
+ return file;
+ }
+ }
+
+ return null;
+ }
+
+ public String getMemento() throws CoreException {
+ return null;
+ }
+
+ public void initializeDefaults(ILaunchConfiguration configuration) throws CoreException {
+
+ }
+
+ public void initializeFromMemento(String memento) throws CoreException {
+
+ }
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerSourceLookupDirector.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerSourceLookupDirector.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerSourcePathComputer.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerSourcePathComputer.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerSourcePathComputer.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerSourcePathComputer.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,41 @@
+/*
+ * 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.uima.textmarker.ide.launching;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.sourcelookup.ISourceContainer;
+import org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate;
+
+public class TextMarkerSourcePathComputer implements ISourcePathComputerDelegate {
+
+ public TextMarkerSourcePathComputer() {
+ }
+
+ public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration,
+ IProgressMonitor monitor) throws CoreException {
+ List containers = new ArrayList();
+ return (ISourceContainer[]) containers.toArray(new ISourceContainer[containers.size()]);
+ }
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerSourcePathComputer.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/TextMarkerSourcePathComputer.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/builtins.tm
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/builtins.tm?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/builtins.tm (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/builtins.tm Fri Aug 12 11:00:38 2011
@@ -0,0 +1 @@
+PACKAGE org.apache.uima.tm;
\ No newline at end of file
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/launching/builtins.tm
------------------------------------------------------------------------------
svn:executable = *