Commits

Colin Gordon committed 192294c

adding unannotated source w/ working build script

Comments (0)

Files changed (165)

logviewer/analyze.sh

+#!/bin/bash
+export PATH=~/research/guitypes/checker/binary:$PATH
+
+CHECKER=/homes/gws/csgordon/research/guitypes/checker/dist/lib/guitypes-`date "+%Y%m%d"`.jar
+
+CFJARS="/homes/gws/csgordon/research/guitypes/checker/binary/jsr308-all.jar"
+
+JARS="/homes/gws/csgordon/research/experiments/timed/logviewer/logviewer/de.anbos.eclipse.logviewer.plugin/lib/jakarta-regexp-1.5.jar"
+
+#ECLIPSEJARS="/usr/lib/eclipse/plugins/org.eclipse.ui.navigator_3.5.100.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.ui.ide_3.7.0.dist.jar:/usr/lib/eclipse/dropins/jdt/plugins/org.eclipse.jdt.ui_3.7.0.dist.jar:/usr/lib/eclipse/dropins/jdt/plugins/org.eclipse.jdt.core_3.7.0.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.ui.navigator.resources_3.4.300.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.debug.core_3.7.0.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.debug.ui_3.7.0.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.core.resources_3.7.100.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.swt.gtk.linux.x86_64_3.7.0.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.ui_3.7.0.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.swt_3.7.0.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.jface_3.7.0.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.core.commands_3.6.0.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.ui.workbench_3.7.0.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.core.runtime_3.7.0.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.osgi_3.7.0.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.equinox.common_3.6.0.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.core.jobs_3.5.100.dist.jar:/usr/lib/ecliplse/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.0.dist/runtime_registry_compatibility.jar:/usr/lib/eclipse/plugins/org.eclipse.equinox.registry_3.5.100.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.equinox.preferences_3.4.0.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.core.contenttype_3.4.100.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.equinox.app_1.3.100.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.ui.forms_3.5.100.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.ui.workbench.texteditor_3.7.0.dist.jar:/usr/lib/eclipse/plugins/org.eclipse.core.net_1.2.100.dist.jar"
+ECLIPSEJARS="/usr/lib/eclipse/dropins/jdt/plugins/org.eclipse.jdt.debug_3.7.0.dist/jdimodel.jar:`ls /usr/lib/eclipse/plugins/*.jar /usr/lib/eclipse/dropins/jdt/plugins/*.jar | tr "\n" :`:/homes/gws/csgordon/research/experiments/timed/jvmmonitor/jvmmonitor-read-only/org.jvmmonitor.ui/lib/org.swtchart_0.8.0.v20120301.jar"
+
+
+
+DEBUG= #"-AprintErrorStack -Afilenames -Ashowchecks" #-Alint=debugSpew"
+ERRS=9999
+
+COMMAND="javac -encoding ISO-8859-1 -J-Xbootclasspath/p:$CFJARS -Xmaxerrs $ERRS -cp $CHECKER:$JARS:$ECLIPSEJARS -processor guitypes.checkers.GUIEffectsChecker $DEBUG"
+
+echo $COMMAND
+
+JAVAFILES=`find . -name "*.java"`
+#echo $JAVAFILES
+
+if [ -e $CHECKER ];
+then
+    find . -name '*.java' | xargs $COMMAND;
+else
+    pushd ~/research/guitypes/checker && ant dist && popd && find . -name '*.java' | xargs $COMMAND;
+fi
+
+
+#

logviewer/de.anbos.eclipse.logviewer.feature/.project

+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>de.anbos.eclipse.logviewer.feature</name>
+	<comment></comment>
+	<projects>
+		<project>de.anbos.eclipse.logviewer.plugin</project>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.pde.FeatureBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.FeatureNature</nature>
+	</natures>
+</projectDescription>

logviewer/de.anbos.eclipse.logviewer.feature/build.properties

+bin.includes = feature.xml
+src.includes = .project,\
+               build.properties,\
+               build.xml,\
+               feature.properties,\
+               feature.xml

logviewer/de.anbos.eclipse.logviewer.feature/feature.properties

+updateSiteName=Eclipse Log Viewer Update Site
+
+description=The Eclipse Log Viewer is a non blocking IO stream reader that can tail any number of files.\n\
+It allows to syntax color the log files with either a regular expression or a word match.
+
+licenseUrl=http://www.apache.org/licenses/LICENSE-2.0
+
+license=Copyright (c) 2009 - 2011 by Andre Bossert\n\
+\n\
+Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);\n\
+you may not use this file except in compliance with the License.\n\
+You may obtain a copy of the License at\n\
+\n\
+http://www.apache.org/licenses/LICENSE-2.0\n\
+\n\
+Unless required by applicable law or agreed to in writing,\n\
+software distributed under the License is distributed on an &quot;AS IS&quot; BASIS,\n\
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\
+See the License for the specific language governing permissions\n\
+and limitations under the License.

logviewer/de.anbos.eclipse.logviewer.feature/feature.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+      id="de.anbos.eclipse.logviewer.feature"
+      label="Log Viewer Feature"
+      version="0.9.8.8"
+      provider-name="Andre Bossert"
+      plugin="de.anbos.eclipse.logviewer.plugin">
+
+   <description url="http://code.google.com/a/eclipselabs.org/p/logviewer/">
+      The Eclipse Log Viewer is a non blocking IO stream reader that
+can tail any number of files and eclipse consoles.
+It allows to syntax color the log files with either a regular
+expression or a word match.
+   </description>
+
+   <copyright url="http://www.apache.org/licenses/LICENSE-2.0">
+      Copyright (c) 2009 - 2011 by Andre Bossert
+Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;quot;);
+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 &amp;quot;AS
+IS&amp;quot; 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.
+   </copyright>
+
+   <license url="http://www.apache.org/licenses/LICENSE-2.0">
+      Copyright (c) 2009 - 2011 by Andre Bossert
+Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;quot;);
+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 &amp;quot;AS
+IS&amp;quot; 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.
+   </license>
+
+   <url>
+      <update label="Eclipse Log Viewer Update Site" url="http://logviewer.eclipselabs.org.codespot.com/git/de.anbos.eclipse.logviewer.update/"/>
+      <discovery label="Eclipse Log Viewer Update Site" url="http://logviewer.eclipselabs.org.codespot.com/git/de.anbos.eclipse.logviewer.update/"/>
+   </url>
+
+   <plugin
+         id="de.anbos.eclipse.logviewer.plugin"
+         download-size="0"
+         install-size="0"
+         version="0.9.8.8"
+         unpack="false"/>
+
+</feature>

logviewer/de.anbos.eclipse.logviewer.plugin/.classpath

+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry exported="true" kind="lib" path="lib/jakarta-regexp-1.5.jar"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

logviewer/de.anbos.eclipse.logviewer.plugin/.gitignore

+/bin

logviewer/de.anbos.eclipse.logviewer.plugin/.project

+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>de.anbos.eclipse.logviewer.plugin</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

logviewer/de.anbos.eclipse.logviewer.plugin/.settings/org.eclipse.jdt.ui.prefs

+#Sun Aug 07 10:38:04 CEST 2005
+eclipse.preferences.version=1
+internal.default.compliance=default

logviewer/de.anbos.eclipse.logviewer.plugin/META-INF/MANIFEST.MF

+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %logviewer.plugin.name
+Bundle-SymbolicName: de.anbos.eclipse.logviewer.plugin;singleton:=true
+Bundle-Version: 0.9.8.8
+Bundle-ClassPath: bin,
+ lib/jakarta-regexp-1.5.jar,
+ .
+Bundle-Activator: de.anbos.eclipse.logviewer.plugin.LogViewerPlugin
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.jface.text,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.core.expressions
+Bundle-ActivationPolicy: lazy
+Bundle-Vendor: Andre Bossert
+Import-Package: org.eclipse.core.resources,
+ org.eclipse.ui.console
+Export-Package: de.anbos.eclipse.logviewer.plugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5

logviewer/de.anbos.eclipse.logviewer.plugin/build.properties

+bin.includes = plugin.xml,\
+               META-INF/,\
+               icons/,\
+               plugin.properties,\
+               META-INF/,\
+               icons/,\
+               plugin.properties,\
+               plugin.xml,\
+               .,\
+               lib/,\
+               plugin_de.properties,\
+               bin/
+src.includes = lib/,\
+               bin/,\
+               icons/
+source.. = src/

logviewer/de.anbos.eclipse.logviewer.plugin/icons/active/copy_active.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/active/encoding_active.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/active/filter_active.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/active/find_obj_active.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/active/open_active.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/active/prop_ps.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/active/refresh_active.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/active/remove_active.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/active/removeall_active.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/active/rename_active.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/active/start_active.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/active/start_all_active.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/active/stop_active.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/active/stop_all_active.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/logviewer.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/passive/copy_passive.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/passive/filter_passive.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/passive/find_obj_passive.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/passive/open_passive.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/passive/prop_ps.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/passive/refresh_passive.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/passive/remove_passive.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/passive/removeall_passive.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/passive/rename_passive.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/passive/start_all_passive.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/passive/start_passive.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/passive/stop_all_passive.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/icons/passive/stop_passive.gif

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/lib/jakarta-regexp-1.5.jar

Binary file added.

logviewer/de.anbos.eclipse.logviewer.plugin/notes.txt

+menu:null?after=viewsShowIn
+
+popup:org.eclipse.ui.popup.any?before=additions
+
+popup:org.eclipse.ui.popup.any?after=additions

logviewer/de.anbos.eclipse.logviewer.plugin/plugin.properties

+logviewer.plugin.name=Log Viewer
+logviewer.properties.main.page.title=Log Viewer
+logviewer.properties.rules.page.title=Rules
+logviewer.actionset.name=Log Viewer
+logviewer.action.openfile.name=Open Log Viewer
+logviewer.action.openwith.name=Open with Log Viewer
+logviewer.plugin.console.name=Log Viewer Console

logviewer/de.anbos.eclipse.logviewer.plugin/plugin.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+   <extension point="org.eclipse.ui.views">
+      <category name="Log Viewer" id="logviewer"/>
+      <view
+            name="%logviewer.plugin.name"
+            icon="icons/logviewer.gif"
+            category="logviewer"
+            class="de.anbos.eclipse.logviewer.plugin.LogViewer"
+            id="de.anbos.eclipse.logviewer.plugin.LogViewer">
+      </view>
+   </extension>
+   <extension
+         point="org.eclipse.ui.perspectiveExtensions">
+      <perspectiveExtension
+            targetID="org.eclipse.ui.resourcePerspective">
+         <view
+               id="de.anbos.eclipse.logviewer.plugin.LogViewer"
+               ratio="0.5"
+               relationship="right"
+               relative="org.eclipse.ui.views.TaskList"
+               visible="false">
+         </view>
+      </perspectiveExtension>
+   </extension>
+   <extension
+      point = "org.eclipse.ui.preferencePages">
+       <page id="de.anbos.eclipse.logviewer.plugin.LogViewer.page1"
+	    class="de.anbos.eclipse.logviewer.plugin.preferences.LogViewerPreferences"
+            name="%logviewer.properties.main.page.title">
+       </page>
+       <page id="de.anbos.eclipse.logviewer.plugin.LogViewer.page1.3"
+        class="de.anbos.eclipse.logviewer.plugin.preferences.rule.RulePreferencePage"
+            name="%logviewer.properties.rules.page.title"
+            category="de.anbos.eclipse.logviewer.plugin.LogViewer.page1">
+       </page>
+   </extension>
+   <extension
+         point="org.eclipse.ui.actionSets">
+      <actionSet
+            label="%logviewer.actionset.name"
+            visible="true"
+            id="de.anbos.eclipse.logviewer.plugin.actionset">
+         <action
+               class="de.anbos.eclipse.logviewer.plugin.action.FileOpenWorkbenchAction"
+               icon="icons/logviewer.gif"
+               id="de.anbos.eclipse.logviewer.plugin.action.fileopen"
+               label="%logviewer.action.openfile.name"
+               menubarPath="File/content"
+               style="push"
+               toolbarPath="Normal/additions"
+               tooltip="Open the Log Viewer in the current workbench page">
+         </action>
+      </actionSet>
+   </extension>
+   <extension
+         point="org.eclipse.ui.menus">
+      <menuContribution
+            locationURI="popup:de.anbos.eclipse.logviewer.plugin.LogViewer?after=additions">
+         <command
+               commandId="org.eclipse.ui.edit.findReplace"
+               disabledIcon="icons/passive/find_obj_passive.gif"
+               icon="icons/active/find_obj_active.gif"
+               style="push">
+         </command>
+         <command
+               commandId="org.eclipse.ui.edit.copy"
+               disabledIcon="icons/passive/copy_passive.gif"
+               icon="icons/active/copy_active.gif"
+               style="push">
+         </command>
+      </menuContribution>
+      <menuContribution
+            locationURI="popup:org.eclipse.ui.popup.any?before=additions">
+         <separator
+               name="de.anbos.eclipse.logviewer.plugin.separator2"
+               visible="true">
+         </separator>
+         <command
+               commandId="de.anbos.eclipse.logviewer.plugin.openwith"
+               icon="icons/logviewer.gif"
+               id="de.anbos.eclipse.logviewer.additions"
+               label="%logviewer.action.openwith.name"
+               tooltip="Open the Log Viewer for selected files">
+            <visibleWhen
+                  checkEnabled="false">
+               <with
+                     variable="activePart">
+                  <or>
+                     <test
+                           forcePluginActivation="true"
+                           property="de.anbos.eclipse.logviewer.plugin.EditorPropertyTester.hasResourceSelection">
+                     </test>
+                     <test
+                           forcePluginActivation="true"
+                           property="de.anbos.eclipse.logviewer.plugin.EditorPropertyTester.hasAbstractConsole">
+                     </test>
+                  </or>
+               </with>
+            </visibleWhen>
+         </command>
+         <separator
+               name="de.anbos.eclipse.logviewer.plugin.separator1"
+               visible="true">
+         </separator>
+      </menuContribution>
+   </extension>
+   <extension
+         point="org.eclipse.ui.handlers">
+      <handler
+            class="de.anbos.eclipse.logviewer.plugin.commands.FindReplaceHandler"
+            commandId="org.eclipse.ui.edit.findReplace">
+         <activeWhen>
+            <with
+                  variable="activePartId">
+               <equals
+                     value="de.anbos.eclipse.logviewer.plugin.LogViewer">
+               </equals>
+            </with>
+         </activeWhen>
+      </handler>
+      <handler
+            class="de.anbos.eclipse.logviewer.plugin.commands.CopyToClipboardHandler"
+            commandId="org.eclipse.ui.edit.copy">
+         <activeWhen>
+            <with
+                  variable="activePartId">
+               <equals
+                     value="de.anbos.eclipse.logviewer.plugin.LogViewer">
+               </equals>
+            </with>
+         </activeWhen>
+      </handler>
+      <handler
+            class="de.anbos.eclipse.logviewer.plugin.commands.OpenWith"
+            commandId="de.anbos.eclipse.logviewer.plugin.openwith">
+      </handler>
+   </extension>
+   <extension
+         point="org.eclipse.ui.console.consolePageParticipants">
+      <consolePageParticipant
+            class="de.anbos.eclipse.logviewer.plugin.ConsolePageParticipant"
+            id="de.anbos.eclipse.logviewer.plugin.consolePageParticipant">
+         <enablement>
+            <instanceof
+                  value="org.eclipse.ui.console.AbstractConsole">
+            </instanceof></enablement>
+      </consolePageParticipant>
+   </extension>
+   <extension
+         point="org.eclipse.ui.console.consoleFactories">
+      <consoleFactory
+            class="de.anbos.eclipse.logviewer.plugin.ConsoleFactory"
+            icon="icons/logviewer.gif"
+            label="%logviewer.plugin.console.name">
+      </consoleFactory>
+   </extension>
+   <extension
+         point="org.eclipse.ui.commands">
+      <command
+            id="de.anbos.eclipse.logviewer.plugin.openwith"
+            name="%logviewer.action.openwith.name">
+      </command>
+   </extension>
+   <extension
+         point="org.eclipse.core.expressions.propertyTesters">
+      <propertyTester
+            class="de.anbos.eclipse.logviewer.plugin.EditorPropertyTester"
+            id="de.anbos.eclipse.logviewer.plugin.EditorPropertyTester"
+            namespace="de.anbos.eclipse.logviewer.plugin.EditorPropertyTester"
+            properties="hasResourceSelection,hasAbstractConsole"
+            type="org.eclipse.ui.IWorkbenchPart">
+      </propertyTester>
+   </extension>
+</plugin>

logviewer/de.anbos.eclipse.logviewer.plugin/plugin_de.properties

+logviewer.plugin.name=Log Viewer
+logviewer.properties.main.page.title=Log Viewer
+logviewer.properties.rules.page.title=Regeln
+logviewer.actionset.name=Log Viewer
+logviewer.action.openfile.name=Log Viewer \u00F6ffnen
+logviewer.action.openwith.name=Mit Log Viewer \u00F6ffnen
+logviewer.plugin.console.name=Log Viewer Console

logviewer/de.anbos.eclipse.logviewer.plugin/screens/LogViewerPreferences_0.9.7.jpg

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/screens/LogViewerView_0.9.7.jpg

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/screens/LogViewer_open_Console_0.9.8.jpg

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/screens/LogViewer_view_Console_0.9.8.jpg

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/screens/LogViewer_view_File_0.9.8.jpg

Added
New image

logviewer/de.anbos.eclipse.logviewer.plugin/src/de/anbos/eclipse/logviewer/plugin/ConsoleFactory.java

+/*
+ * Copyright 2009 - 2010 by Andre Bossert
+ * Licensed 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 de.anbos.eclipse.logviewer.plugin;
+
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.console.IConsoleConstants;
+import org.eclipse.ui.console.IConsoleFactory;
+import org.eclipse.ui.console.IConsoleView;
+
+public class ConsoleFactory implements IConsoleFactory {
+
+	public void openConsole() {
+		LogViewer logView = null;
+
+		// get log view
+		try {
+			logView = (LogViewer) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("de.anbos.eclipse.logviewer.plugin.LogViewer");
+		} catch (PartInitException e) {
+			e.printStackTrace();
+		}
+
+		// get console view
+		IConsoleView consoleView = null;
+		try {
+			consoleView = (IConsoleView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(IConsoleConstants.ID_CONSOLE_VIEW);
+		} catch (PartInitException e) {
+			e.printStackTrace();
+		}
+
+		if (logView != null && consoleView != null) {
+			// show it
+			consoleView.display(logView.getConsole());
+			//logView.printDefaultMessage();
+		}
+	}
+
+}

logviewer/de.anbos.eclipse.logviewer.plugin/src/de/anbos/eclipse/logviewer/plugin/ConsolePageParticipant.java

+/*
+ * Copyright 2009, 2010 by Andre Bossert
+ * Licensed 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 de.anbos.eclipse.logviewer.plugin;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsoleConstants;
+import org.eclipse.ui.console.IConsolePageParticipant;
+import org.eclipse.ui.part.IPageBookViewPage;
+
+import de.anbos.eclipse.logviewer.plugin.action.ConsoleOpenAction;
+
+public class ConsolePageParticipant implements IConsolePageParticipant {
+
+	private IPageBookViewPage page;
+
+	public void activated() {
+		// no op
+	}
+
+	public void deactivated() {
+		// no op
+	}
+
+	public void dispose() {
+		page = null;
+	}
+
+	public void init(IPageBookViewPage myPage, IConsole console) {
+        page = myPage;
+        IToolBarManager toolBarManager = page.getSite().getActionBars()
+        .getToolBarManager();
+        toolBarManager.appendToGroup(IConsoleConstants.OUTPUT_GROUP, new Separator());
+        toolBarManager.appendToGroup(IConsoleConstants.OUTPUT_GROUP, new Action(
+        		LogViewerPlugin.getResourceString("logviewer.action.openwith.name"),
+        		UIImages.getImageDescriptor(ILogViewerConstants.IMG_LOG_VIEWER)) {
+            public void run() {
+            	ConsolePageParticipant.this.run();
+            }
+        });
+	}
+
+	@SuppressWarnings("rawtypes")
+	public Object getAdapter(Class adapter) {
+		return null;
+	}
+
+	private void run() {
+		IWorkbenchPart part = page.getSite().getWorkbenchWindow().getActivePage().getActivePart();
+		ConsoleOpenAction action = EditorPropertyTester.hasAbstractConsole(part);
+		if (action != null)
+			action.run(null);
+	}
+
+}

logviewer/de.anbos.eclipse.logviewer.plugin/src/de/anbos/eclipse/logviewer/plugin/EditorPropertyTester.java

+/*
+ * Copyright 2009 - 2010 by Andre Bossert
+ * Licensed 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 de.anbos.eclipse.logviewer.plugin;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IWorkbenchPart;
+
+import de.anbos.eclipse.logviewer.plugin.action.ConsoleOpenAction;
+import de.anbos.eclipse.logviewer.plugin.action.FileOpenAction;
+
+public class EditorPropertyTester extends PropertyTester {
+
+	public EditorPropertyTester() {
+		super();
+	}
+
+	public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+        if("hasResourceSelection".equals(property) && receiver instanceof IWorkbenchPart){
+            return hasResourceSelection((IWorkbenchPart)receiver) != null;
+        }
+        if("hasAbstractConsole".equals(property) && receiver instanceof IWorkbenchPart){
+            return hasAbstractConsole((IWorkbenchPart)receiver) != null;
+        }        
+		return false;
+	}
+
+    static public FileOpenAction hasResourceSelection(IWorkbenchPart part) {
+		ISelection selection = ResourceUtils.getResourceSelection(part);
+		if (selection != null) {
+			FileOpenAction action = new FileOpenAction();
+			action.selectionChanged(null, selection);
+			if (action.isEnabled())
+				return action;
+		}
+    	return null;
+    }
+
+    static public ConsoleOpenAction hasAbstractConsole(IWorkbenchPart part) {
+		ISelection selection = ResourceUtils.getConsoleSelection(part);
+		if (selection != null) {
+			ConsoleOpenAction action = new ConsoleOpenAction();
+			action.selectionChanged(null, selection);
+			if (action.isEnabled())
+				return action;
+		}
+    	return null;
+    }
+
+}

logviewer/de.anbos.eclipse.logviewer.plugin/src/de/anbos/eclipse/logviewer/plugin/ILogViewerConstants.java

+
+package de.anbos.eclipse.logviewer.plugin;
+
+/*
+ * Copyright (c) 2007 - 2011 by Michael Mimo Moratti
+ * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+ * 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 &quot;AS IS&quot; 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.
+ */
+
+public interface ILogViewerConstants {
+
+	// FileTail settings -----------------------------------------------------------
+	
+	public static final long TAIL_FILEOPEN_ERROR_WAIT		= 500;
+	
+	// Images ------------------------------------------------------------------
+	
+	public static final String IMG_OPEN_FILE_ACTIVE			= "IMG_OPEN_FILE_ACTIVE"; //$NON-NLS-1$
+	public static final String IMG_OPEN_FILE_PASSIVE		= "IMG_OPEN_FILE_PASSIVE"; //$NON-NLS-1$
+	public static final String IMG_CLEAR_HISTORY_ACTIVE		= "IMG_CLEAR_HISTORY_ACTIVE"; //$NON-NLS-1$
+	public static final String IMG_CLEAR_HISTORY_PASSIVE	= "IMG_CLEAR_HISTORY_PASSIVE"; //$NON-NLS-1$
+	public static final String IMG_PREFERENCES_ACTIVE		= "IMG_PREFERENCES_ACTIVE"; //$NON-NLS-1$
+	public static final String IMG_PREFERENCES_PASSIVE		= "IMG_PREFERENCES_PASSIVE"; //$NON-NLS-1$
+	public static final String IMG_CLOSE_FILE_ACTIVE		= "IMG_CLOSE_FILE_ACTIVE"; //$NON-NLS-1$
+	public static final String IMG_CLOSE_FILE_PASSIVE		= "IMG_CLOSE_FILE_PASSIVE"; //$NON-NLS-1$
+	public static final String IMG_CLOSEALL_ACTIVE			= "IMG_CLOSEALL_ACTIVE"; //$NON-NLS-1$
+	public static final String IMG_CLOSEALL_PASSIVE			= "IMG_CLOSEALL_PASSIVE"; //$NON-NLS-1$
+	public static final String IMG_REFRESH_FILE_ACTIVE		= "IMG_REFRESH_FILE_ACTIVE"; //$NON-NLS-1$
+	public static final String IMG_REFRESH_FILE_PASSIVE		= "IMG_REFRESH_FILE_PASSIVE"; //$NON-NLS-1$
+	public static final String IMG_START_TAIL_ACTIVE		= "IMG_START_TAIL_ACTIVE"; //$NON-NLS-1$
+	public static final String IMG_START_TAIL_PASSIVE		= "IMG_START_TAIL_PASSIVE"; //$NON-NLS-1$
+	public static final String IMG_START_ALL_TAIL_ACTIVE	= "IMG_START_ALL_TAIL_ACTIVE"; //$NON-NLS-1$
+	public static final String IMG_START_ALL_TAIL_PASSIVE	= "IMG_START_ALL_TAIL_PASSIVE"; //$NON-NLS-1$
+	public static final String IMG_STOP_TAIL_ACTIVE			= "IMG_STOP_TAIL_ACTIVE"; //$NON-NLS-1$
+	public static final String IMG_STOP_TAIL_PASSIVE		= "IMG_STOP_TAIL_PASSIVE"; //$NON-NLS-1$
+	public static final String IMG_STOP_ALL_TAIL_ACTIVE		= "IMG_STOP_ALL_TAIL_ACTIVE"; //$NON-NLS-1$
+	public static final String IMG_STOP_ALL_TAIL_PASSIVE	= "IMG_STOP_ALL_TAIL_PASSIVE"; //$NON-NLS-1$
+	public static final String IMG_FILTER_ACTIVE			= "IMG_FILTER_ACTIVE"; //$NON-NLS-1$
+	public static final String IMG_FILTER_PASSIVE			= "IMG_FILTER_PASSIVE"; //$NON-NLS-1$
+	public static final String IMG_ENCODING_ACTIVE			= "IMG_ENCODING_ACTIVE"; //$NON-NLS-1$
+	public static final String IMG_FIND_ACTIVE				= "IMG_FIND_ACTIVE"; //$NON-NLS-1$
+	public static final String IMG_FIND_PASSIVE				= "IMG_FIND_PASSIVE"; //$NON-NLS-1$
+	public static final String IMG_RENAME_ACTIVE			= "IMG_RENAME_ACTIVE"; //$NON-NLS-1$
+	public static final String IMG_RENAME_PASSIVE			= "IMG_RENAME_PASSIVE"; //$NON-NLS-1$
+	public static final String IMG_COPY_ACTIVE				= "IMG_COPY_ACTIVE"; //$NON-NLS-1$
+	public static final String IMG_COPY_PASSIVE				= "IMG_COPY_PASSIVE"; //$NON-NLS-1$
+	public static final String IMG_LOG_VIEWER				= "IMG_LOG_VIEWER";
+	
+	// Preferences -------------------------------------------------------------
+	
+	/* defines the maximal amount of rows that are backloged */
+	public static final int 	MAX_BACKLOG					= 200000;
+	public static final int 	DEFAULT_BACKLOG				= 4000;
+	public static final String 	PREF_BACKLOG				= "BACKLOG"; //$NON-NLS-1$
+	
+	public static final int 	MAX_TAIL_BUFFER_SIZE		= 4096;
+	public static final int 	DEFAULT_BUFFER_CAPACITY		= 1024;
+	public static final String 	PREF_BUFFER					= "BUFFER"; //$NON-NLS-1$
+	
+	public static final int		MAX_READWAIT_SIZE			= 1000000;
+	public static final int		DEFAULT_READWAIT_SIZE		= 250;
+	public static final String	PREF_READWAIT				= "READWAIT"; //$NON-NLS-1$
+	
+	public static final String	PREF_ENCODING				= "ENCODING"; //$NON-NLS-1$
+	
+	public static final String	PREF_CURSORLINE_COLOR		= "CURSOR_LINE_COLOR"; //$NON-NLS-1$
+	
+	public static final String	PREF_EDITOR_FONT_STYLE		= "EDITOR_FONT_SYLE"; //$NON-NLS-1$
+	
+	public static final String 	PREF_COLORING_ITEMS			= "ITEM_COLORING"; //$NON-NLS-1$
+	
+	public static final String 	PREF_LAST_OPEN_FILES		= "LAST_OPEN_FILES"; //$NON-NLS-1$
+	
+	/* defines the maximum amount of files in the drop down history */
+	public static final int		MAX_FILES_IN_HISTORY		= 10;
+	public static final String 	PREF_HISTORY_FILES			= "HISTORY_FILES"; //$NON-NLS-1$
+	
+	/* word wrap */
+	public static boolean DEAFULT_WORD_WRAP                 = false;
+	public static final String	PREF_WORD_WRAP				= "WORD_WRAP"; //$NON-NLS-1$
+
+	/* show when updated */
+	public static boolean DEAFULT_SHOW_WHEN_UPDATED         = false;
+	public static final String	PREF_SHOW_WHEN_UPDATED   	= "SHOW_WHEN_UPDATED"; //$NON-NLS-1$
+
+	/* filter extensions */
+	public static String DEFAULT_FILTER_EXTENSIONS     	    = "*.log;*.txt;*.er?";
+	public static final String	PREF_FILTER_EXTENSIONS   	= "FILTER_EXTENSIONS"; //$NON-NLS-1$
+
+	/* show top of file */
+	public static boolean DEAFULT_SHOW_TOP_OF_FILE         = false;
+	public static final String	PREF_SHOW_TOP_OF_FILE   	= "SHOW_TOP_OF_FILE"; //$NON-NLS-1$
+
+}

logviewer/de.anbos.eclipse.logviewer.plugin/src/de/anbos/eclipse/logviewer/plugin/LogFile.java

+package de.anbos.eclipse.logviewer.plugin;
+
+/*
+ * Copyright (c) 2007 - 2011 by Michael Mimo Moratti
+ * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+ * 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 &quot;AS IS&quot; 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.
+ */
+
+public class LogFile {
+
+    // Attribute ---------------------------------------------------------------
+    
+	public enum LogFileType{
+		LOGFILE_SYSTEM_FILE,
+		LOGFILE_ECLIPSE_CONSOLE,
+		LOGFILE_STREAM
+	};
+
+    private String fileName;
+    private LogFileType fileType;
+    private String tabName;
+    private String encoding;
+    private boolean monitor;
+    
+    // Constructor -------------------------------------------------------------
+    
+    public LogFile(LogFileType fileType, String fileName, String tabName, String encoding, boolean monitor) {
+    	this.fileType = fileType;
+        this.fileName = fileName;
+        setTabName(tabName);
+        setEncoding(encoding);
+        setMonitor(monitor);
+    }
+    
+    // Public ------------------------------------------------------------------
+
+    public LogFileType getFileType() {
+		return fileType;
+	}
+    
+    public String getFileName() {
+        return fileName;
+    }
+
+	public String getTabName() {
+        return tabName;
+    }
+
+    public String getEncoding() {
+		return encoding;
+	}
+
+	public void setEncoding(String encoding) {
+		this.encoding = encoding;
+	}
+
+	public boolean getMonitor() {
+        return monitor;
+    }
+
+    public void setTabName(String tabName) {
+		// issue 42: isEmpty method is available since java6 according to Sun's API Doc. So, it does not work on java5.
+        //if (tabName == null || tabName.isEmpty()) {
+    	if ((tabName == null) || (tabName.length() == 0)) {
+        	this.tabName = fileName.substring(fileName.lastIndexOf(System.getProperty("file.separator")) + 1);
+        } else {
+        	this.tabName = tabName;
+        }
+    }
+
+    public void setMonitor(boolean monitor) {
+    	this.monitor = monitor;
+    }    
+}

logviewer/de.anbos.eclipse.logviewer.plugin/src/de/anbos/eclipse/logviewer/plugin/LogFileTab.java

+package de.anbos.eclipse.logviewer.plugin;
+
+import java.io.IOException;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.TabItem;
+
+import de.anbos.eclipse.logviewer.plugin.file.document.LogDocument;
+
+/*
+ * Copyright (c) 2007 - 2011 by Michael Mimo Moratti
+ * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+ * 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 &quot;AS IS&quot; 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.
+ */
+
+public class LogFileTab {
+
+    // Attribute ---------------------------------------------------------------
+    
+    private String key;
+    private TabItem item;
+    private LogDocument document;
+    private ISelection selection;
+    private int topIndex;
+    
+    // Constructor -------------------------------------------------------------
+    
+    public LogFileTab(String key, TabItem item, LogDocument document) {
+        this.key = key;
+        this.item = item;
+        this.document = document;
+        this.selection = null;
+        this.topIndex = 0;
+    }
+    
+    // Public ------------------------------------------------------------------
+    
+    public void close() throws IOException {
+        document.setMonitor(false);
+    }
+    
+    public String getKey() {
+        return key;
+    }
+    
+    public TabItem getItem() {
+        return item;
+    }
+    
+    public LogDocument getDocument() {
+        return document;
+    }
+
+	public ISelection getSelection() {
+		return selection;
+	}
+
+	public int getTopIndex() {
+		return topIndex;
+	}
+
+	public void setSelection(ISelection selection) {
+		this.selection = selection;
+	}
+
+	public void setTopIndex(int topIndex) {
+		this.topIndex = topIndex;
+	}
+    
+}

logviewer/de.anbos.eclipse.logviewer.plugin/src/de/anbos/eclipse/logviewer/plugin/LogViewer.java

+package de.anbos.eclipse.logviewer.plugin;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
+
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.IDocumentListener;
+import org.eclipse.jface.text.IFindReplaceTarget;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DropTarget;
+import org.eclipse.swt.dnd.DropTargetAdapter;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.TabItem;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+
+import de.anbos.eclipse.logviewer.plugin.LogFile.LogFileType;
+import de.anbos.eclipse.logviewer.plugin.action.ClearHistoryAction;
+import de.anbos.eclipse.logviewer.plugin.action.CloseAllFilesViewAction;
+import de.anbos.eclipse.logviewer.plugin.action.FileCloseViewAction;
+import de.anbos.eclipse.logviewer.plugin.action.FileEncondingViewAction;
+import de.anbos.eclipse.logviewer.plugin.action.FileOpenViewAction;
+import de.anbos.eclipse.logviewer.plugin.action.PreferencesViewAction;
+import de.anbos.eclipse.logviewer.plugin.action.RefreshCurrentFileViewAction;
+import de.anbos.eclipse.logviewer.plugin.action.StartTailOnAllFileViewAction;
+import de.anbos.eclipse.logviewer.plugin.action.StartTailOnCurrentFileViewAction;
+import de.anbos.eclipse.logviewer.plugin.action.StopTailOnAllFileViewAction;
+import de.anbos.eclipse.logviewer.plugin.action.StopTailOnCurrentFileViewAction;
+import de.anbos.eclipse.logviewer.plugin.action.TabRenameAction;
+import de.anbos.eclipse.logviewer.plugin.action.delegate.FileOpenViewActionDelegate;
+import de.anbos.eclipse.logviewer.plugin.file.document.LogDocument;
+import de.anbos.eclipse.logviewer.plugin.preferences.FileHistoryTracker;
+import de.anbos.eclipse.logviewer.plugin.preferences.PreferenceValueConverter;
+import de.anbos.eclipse.logviewer.plugin.ui.menu.LocalPullDownMenu;
+import de.anbos.eclipse.logviewer.plugin.viewer.LogFileViewer;
+
+import org.eclipse.ui.console.ConsolePlugin;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IOConsole;
+import org.eclipse.ui.console.IOConsoleOutputStream;
+
+/*
+ * Copyright (c) 2007 - 2011 by Michael Mimo Moratti
+ * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+ * 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 &quot;AS IS&quot; 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.
+ */
+
+public class LogViewer extends ViewPart {
+
+    // Attribute ---------------------------------------------------------------
+
+    private Logger logger;
+    private Composite parent;
+
+    private LogViewerConsole console;
+
+    private boolean stopAfterChange = false;
+
+    private TabFolder tabfolder;
+    private LogFileViewer viewer;
+
+    private Map<String, LogFileTab> logTab;
+    private TabItem oldTabItem;
+
+    private ViewDocumentListener documentListener;
+
+    private FileOpenViewAction fileOpenAction;
+    private ClearHistoryAction clearHistoryAction;
+    private PreferencesViewAction preferencesAction;
+    private FileCloseViewAction fileCloseAction;
+    private CloseAllFilesViewAction closeAllFilesAction;
+    private RefreshCurrentFileViewAction refreshCurrentFileAction;
+    private StartTailOnCurrentFileViewAction startTailOnCurrentFile;
+    private StopTailOnCurrentFileViewAction stopTailOnCurrentFile;
+    private StartTailOnAllFileViewAction startTailOnAllFiles;
+    private StopTailOnAllFileViewAction stopTailOnAllFiles;
+    private FileEncondingViewAction fileEncodingAction;
+    private TabRenameAction tabRenameAction;
+
+    private int monitorCounter;
+    private int monitorCounterMax;
+
+    // Constructor -------------------------------------------------------------
+
+    public LogViewer() {
+        logger = LogViewerPlugin.getDefault().getLogger();
+        logTab = new Hashtable<String, LogFileTab>();
+        oldTabItem = null;
+        console = null;
+        resetMonitorCounter();
+    }
+
+    // Public ------------------------------------------------------------------
+
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+     */
+    public void createPartControl(Composite parent) {
+        //viewer
+        this.parent = parent;
+        documentListener = new ViewDocumentListener();
+        tabfolder = new TabFolder(parent,0);
+        tabfolder.addSelectionListener(new TabSelectionListener());
+        viewer = new LogFileViewer(tabfolder,SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+
+        // DnD
+    	DropTarget target = new DropTarget(parent, DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK);
+    	target.setTransfer(new Transfer[] {FileTransfer.getInstance(), TextTransfer.getInstance()});
+    	target.addDropListener (new DropTargetAdapter() {
+    		public void dragEnter(DropTargetEvent e) {
+    			if (e.detail == DND.DROP_NONE)
+    				e.detail = DND.DROP_COPY;
+    		}
+    		public void drop(DropTargetEvent event) {
+    			if (event.data == null || ((String[])event.data).length < 1) {
+    				event.detail = DND.DROP_NONE;
+    				return;
+    			}
+    			//File file = new File(((String[])event.data)[0]);
+    			if (!checkAndOpenFile(LogFileType.LOGFILE_SYSTEM_FILE,((String[])event.data)[0], false))
+    				event.detail = DND.DROP_NONE;
+    		}
+    	});
+
+		// fill the menues
+        makeActions();
+        hookContextMenu();
+        contributeToActionBars();
+        openAllLastOpenFiles();
+    }
+
+	public void closeCurrentLogFile() {
+        try {
+            LogFileTab tab = getSelectedTab();
+            removeMonitorCounter(tab.getDocument().isMonitor());
+            tab.close();
+            logTab.remove(tab.getKey());
+        } catch(IOException e) {
+            logger.logError("unable to remove the current; active tab"); //$NON-NLS-1$
+        }
+        int index = tabfolder.getSelectionIndex();
+        getSelectedItem().dispose();
+        if (!greyAllOutIfNoFiles()) {
+            if(index == 0) {
+                tabfolder.setSelection(0);
+            } else {
+                tabfolder.setSelection(index - 1);
+            }
+        }
+    }
+
+    public void closeAllLogFiles() {
+    	Iterator<String> keyIterator = logTab.keySet().iterator();
+    	while(keyIterator.hasNext()) {
+    		Object key = keyIterator.next();
+    		LogFileTab tab = (LogFileTab)logTab.get(key);
+    		try {
+				tab.close();
+				tab.getItem().dispose();
+			} catch (IOException e) {
+				logger.logError("unable to remove tab: " + tab.getDocument().getFile().getFileName()); //$NON-NLS-1$
+			}
+    	}
+    	logTab.clear();
+    	greyAllOutIfNoFiles();
+    }
+
+    public void refreshCurrentLogFile() {
+        try {
+        	boolean wasMonitor = getSelectedTab().getDocument().isMonitor();
+        	if (!wasMonitor)
+        		stopAfterChange = true;
+        	getSelectedTab().getDocument().synchronize();
+        } catch(Exception e) {
+            logger.logError("unable to refresh the current tab's content",e); //$NON-NLS-1$
+        }
+    }
+
+    public void startTailOnAllDocuments() {
+    	Iterator<String> keyIterator = logTab.keySet().iterator();
+    	while(keyIterator.hasNext()) {
+    		Object key = keyIterator.next();
+    		LogFileTab tab = (LogFileTab)logTab.get(key);
+    		tab.getDocument().setMonitor(true);
+    	}
+    	setMonitorCounterToMax();
+    	updateTailStartStopButtons(true);
+    }
+
+    public void stopTailOnAllDocuments() {
+    	Iterator<String> keyIterator = logTab.keySet().iterator();
+    	while(keyIterator.hasNext()) {
+    		Object key = keyIterator.next();
+    		LogFileTab tab = (LogFileTab)logTab.get(key);
+    		tab.getDocument().setMonitor(false);
+
+    	}
+    	setMonitorCounterToMin();
+    	updateTailStartStopButtons(false);
+    }
+
+    public void startTail() {
+        try {
+        	getSelectedTab().getDocument().setMonitor(true);
+        	increaseMonitorCounter();
+        	updateTailStartStopButtons(true);
+        } catch(Exception e) {
+            logger.logError("unable to start tailing",e); //$NON-NLS-1$
+        }
+    }
+
+    public void stopTail() {
+        try {
+        	getSelectedTab().getDocument().setMonitor(false);
+        	decreaseMonitorCounter();
+        	updateTailStartStopButtons(false);
+        } catch(Exception e) {
+            logger.logError("unable to stop tailing",e); //$NON-NLS-1$
+        }
+    }
+
+    boolean greyAllOutIfNoFiles() {
+    	if(tabfolder.getItemCount() == 0) {
+    		fileCloseAction.setEnabled(false);
+    		closeAllFilesAction.setEnabled(false);
+	        refreshCurrentFileAction.setEnabled(false);
+	        fileEncodingAction.setEnabled(false);
+	        startTailOnCurrentFile.setEnabled(false);
+	        stopTailOnCurrentFile.setEnabled(false);
+	        startTailOnAllFiles.setEnabled(false);
+	        stopTailOnAllFiles.setEnabled(false);
+	        tabRenameAction.setEnabled(false);
+	        resetMonitorCounter();
+	        return true;
+    	}
+    	return false;
+    }
+
+    void updateTailStartStopButtons(boolean monitor) {
+        stopTailOnCurrentFile.setEnabled(monitor);
+        startTailOnCurrentFile.setEnabled(!monitor);
+        if (monitorCounter == 0)
+        {
+        	startTailOnAllFiles.setEnabled(true);
+        	stopTailOnAllFiles.setEnabled(false);
+        } else if (monitorCounter == monitorCounterMax) {
+        	startTailOnAllFiles.setEnabled(false);
+        	stopTailOnAllFiles.setEnabled(true);
+        } else {
+        	startTailOnAllFiles.setEnabled(true);
+        	stopTailOnAllFiles.setEnabled(true);
+        }
+    }
+
+    public boolean hasLogFile(LogFile file) {
+        if(file == null) {
+            return false;
+        }
+        return logTab.containsKey(file.getFileName());
+    }
+
+    void increaseMonitorCounter() {
+    	if (monitorCounter < monitorCounterMax)
+    		monitorCounter++;
+    }
+
+    void decreaseMonitorCounter() {
+    	if (monitorCounter > 0)
+    		monitorCounter--;
+    }
+
+    void setMonitorCounterToMax() {
+    	monitorCounter = monitorCounterMax;
+    }
+
+    void setMonitorCounterToMin() {
+    	monitorCounter = 0;
+    }
+
+    void resetMonitorCounter() {
+    	monitorCounter = 0;
+    	monitorCounterMax = 0;
+    }
+
+    void removeMonitorCounter(boolean monitor) {
+    	if (monitorCounterMax > 0)
+    		monitorCounterMax--;
+    	if (monitor)
+    		decreaseMonitorCounter();
+    }
+
+    void addMonitorCounter(boolean monitor) {
+  		monitorCounterMax++;
+    	if (monitor)
+    		increaseMonitorCounter();
+    }
+
+    public boolean checkAndOpenFile(LogFileType type, String fullPath, boolean fromAction) {
+    	File file = new File(fullPath);
+		if (!fromAction && file.isDirectory()) {
+			FileOpenViewActionDelegate action = new FileOpenViewActionDelegate();
+			action.setParentPath(fullPath);
+			action.run(this, getSite().getShell());
+			return action.isFileOpened();
+		}else {
+    	    LogFile logFile = new LogFile(type,fullPath,null,null,true);
+    	    if(!hasLogFile(logFile)) {
+                FileHistoryTracker.getInstance().storeFile(type, fullPath);
+    	    }
+    	    // open or show file
+    	    openLogFile(logFile);
+		}
+        return true;
+    }
+
+    public void openLogFile(LogFile file) {
+        String key = file.getFileName();
+        if(!logTab.containsKey(key)) {
+            try {
+            	if (file.getTabName().equals(LogViewerPlugin.getResourceString("logviewer.plugin.console.name")))
+            		createConsole();
+            	String encoding = LogViewerPlugin.getDefault().getPreferenceStore().getString(ILogViewerConstants.PREF_ENCODING);
+            	LogDocument document = new LogDocument(file,encoding);
+                TabItem item = new TabItem(tabfolder,0);
+                item.setControl(viewer.getControl());
+                item.setText(file.getTabName());
+                item.setToolTipText(file.getFileName());
+                logTab.put(key,new LogFileTab(key,item,document));
+                document.addDocumentListener(documentListener);
+
+            	// restore monitor status
+                boolean monitorState = file.getMonitor();
+                document.setMonitor(monitorState);
+                addMonitorCounter(monitorState);
+                updateTailStartStopButtons(monitorState);
+
+                refreshCurrentFileAction.setEnabled(true);
+                fileEncodingAction.setEnabled(true);
+                fileCloseAction.setEnabled(true);
+                closeAllFilesAction.setEnabled(true);
+                tabRenameAction.setEnabled(true);
+    	        startTailOnAllFiles.setEnabled(true);
+    	        stopTailOnAllFiles.setEnabled(true);
+            } catch(Exception e) {
+                logger.logError("unable to open the selected logfile",e); //$NON-NLS-1$
+                LogViewerPlugin.getDefault().showErrorMessage(LogViewerPlugin.getResourceString("main.error.open.file",new String[]{file.getFileName()})); //$NON-NLS-1$
+                return;
+            }
+        }
+        // show active document
+        LogFileTab tab = (LogFileTab)logTab.get(key);
+        try {
+            showDocument(tab.getDocument(),null,0,true);
+        	tabfolder.setSelection(new TabItem[] {tab.getItem()});
+        	oldTabItem = tab.getItem();
+        	// send event to refresh encoding
+        	Event event = new Event();
+    		event.item = tab.getItem();
+    		tabfolder.notifyListeners(SWT.Selection, event);
+        } catch(Exception e) {
+            logger.logError("showing the document has lead to the following exception",e); //$NON-NLS-1$
+        }
+
+        // check if file should be refreshed
+        if (!file.getMonitor())
+        	refreshCurrentLogFile();
+    }
+
+    public boolean isAvailable() {
+        return viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed();
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IWorkbenchPart#setFocus()
+     */