-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9d4632
commit ea4dcab
Showing
84 changed files
with
3,932 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>pt.iscte.pidesco.feature</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.pde.FeatureBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.pde.FeatureNature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bin.includes = feature.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<feature | ||
id="pt.iscte.pidesco.feature" | ||
label="Pidesco Core" | ||
version="0.1"> | ||
|
||
<description url="http://www.example.com/description"> | ||
[Enter Feature Description here.] | ||
</description> | ||
|
||
<copyright url="http://www.example.com/copyright"> | ||
[Enter Copyright Description here.] | ||
</copyright> | ||
|
||
<license url="http://www.example.com/license"> | ||
[Enter License Description here.] | ||
</license> | ||
|
||
<plugin | ||
id="pt.iscte.pidesco.javaeditor" | ||
download-size="0" | ||
install-size="0" | ||
version="0.0.0" | ||
unpack="false"/> | ||
|
||
<plugin | ||
id="pt.iscte.pidesco" | ||
download-size="0" | ||
install-size="0" | ||
version="0.0.0" | ||
unpack="false"/> | ||
|
||
<plugin | ||
id="pt.iscte.pidesco.projectbrowser" | ||
download-size="0" | ||
install-size="0" | ||
version="0.0.0" | ||
unpack="false"/> | ||
|
||
</feature> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>pt.iscte.pidesco.javaeditor</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> |
7 changes: 7 additions & 0 deletions
7
pt.iscte.pidesco.javaeditor/.settings/org.eclipse.jdt.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 | ||
org.eclipse.jdt.core.compiler.compliance=1.7 | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: Simple Java Editor | ||
Bundle-SymbolicName: pt.iscte.pidesco.javaeditor;singleton:=true | ||
Bundle-Version: 1.1 | ||
Require-Bundle: org.eclipse.core.runtime, | ||
org.eclipse.ui;bundle-version="0.0.0", | ||
org.eclipse.core.resources;bundle-version="0.0.0", | ||
org.eclipse.ui.console;bundle-version="0.0.0", | ||
org.eclipse.jface.text;bundle-version="0.0.0", | ||
org.eclipse.ui.editors;bundle-version="0.0.0", | ||
org.eclipse.ui.ide;bundle-version="0.0.0", | ||
org.eclipse.core.filesystem;bundle-version="0.0.0", | ||
org.eclipse.jdt;bundle-version="3.10.0", | ||
org.eclipse.jdt.core;bundle-version="3.10.0", | ||
pt.iscte.pidesco.projectbrowser;bundle-version="0.1.0", | ||
pt.iscte.pidesco;bundle-version="0.1.0" | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7 | ||
Bundle-Vendor: pt.iscte.dcti | ||
Export-Package: pt.iscte.pidesco.javaeditor.service | ||
Bundle-Activator: pt.iscte.pidesco.javaeditor.internal.JavaEditorActivator | ||
Bundle-ActivationPolicy: lazy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
source.. = src/ | ||
output.. = bin/ | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
plugin.xml,\ | ||
images/,\ | ||
about.ini |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?eclipse version="3.4"?> | ||
<plugin> | ||
<extension | ||
point="org.eclipse.ui.editors"> | ||
<editor | ||
class="pt.iscte.pidesco.javaeditor.internal.SimpleJavaEditor" | ||
default="true" | ||
extensions="java" | ||
icon="images/javafile.gif" | ||
id="pt.iscte.pidesco.javaeditor" | ||
name="Simple Java editor"> | ||
<contentTypeBinding | ||
contentTypeId="org.eclipse.jdt.core.javaSource"> | ||
</contentTypeBinding> | ||
</editor> | ||
</extension> | ||
|
||
<extension | ||
point="org.eclipse.ui.startup"> | ||
<startup | ||
class="pt.iscte.pidesco.javaeditor.internal.Startup"> | ||
</startup> | ||
</extension> | ||
|
||
<extension | ||
id="packagefocus" | ||
name="Package filter" | ||
point="pt.iscte.pidesco.projectbrowser.filter"> | ||
<filter | ||
class="pt.iscte.pidesco.javaeditor.PackageFocusFilter"> | ||
</filter> | ||
</extension> | ||
<extension | ||
id="packagefocus" | ||
name="Package focus" | ||
point="pt.iscte.pidesco.tool"> | ||
<tool | ||
class="pt.iscte.pidesco.javaeditor.PackageFocusTool" | ||
description="Focus on the package of the opened class" | ||
hasState="true" | ||
icon="package_filter.gif" | ||
view="pt.iscte.pidesco.projectbrowser.tree"> | ||
</tool> | ||
</extension> | ||
|
||
</plugin> |
31 changes: 31 additions & 0 deletions
31
pt.iscte.pidesco.javaeditor/src/pt/iscte/pidesco/javaeditor/PackageFocusFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package pt.iscte.pidesco.javaeditor; | ||
|
||
import java.io.File; | ||
|
||
import pt.iscte.pidesco.javaeditor.internal.JavaEditorActivator; | ||
import pt.iscte.pidesco.javaeditor.internal.JavaEditorServicesImpl; | ||
import pt.iscte.pidesco.javaeditor.service.JavaEditorServices; | ||
import pt.iscte.pidesco.projectbrowser.extensibility.ProjectBrowserFilter; | ||
import pt.iscte.pidesco.projectbrowser.model.PackageElement; | ||
import pt.iscte.pidesco.projectbrowser.model.SourceElement; | ||
|
||
public class PackageFocusFilter implements ProjectBrowserFilter { | ||
|
||
private JavaEditorServices services; | ||
|
||
public PackageFocusFilter() { | ||
services = JavaEditorActivator.getInstance().getServices(); | ||
} | ||
|
||
@Override | ||
public boolean include(SourceElement element, PackageElement parent) { | ||
File f = services.getOpenedFile(); | ||
if(element.isPackage() && ((PackageElement) element).hasChild(f, true)) | ||
return true; | ||
else if (element.isClass() && parent.hasChild(f, false)) | ||
return true; | ||
|
||
return false; | ||
} | ||
|
||
} |
44 changes: 44 additions & 0 deletions
44
pt.iscte.pidesco.javaeditor/src/pt/iscte/pidesco/javaeditor/PackageFocusTool.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package pt.iscte.pidesco.javaeditor; | ||
|
||
import java.io.File; | ||
|
||
import org.osgi.framework.BundleContext; | ||
import org.osgi.framework.ServiceReference; | ||
|
||
import pt.iscte.pidesco.extensibility.PidescoServices; | ||
import pt.iscte.pidesco.extensibility.PidescoTool; | ||
import pt.iscte.pidesco.javaeditor.internal.JavaEditorActivator; | ||
import pt.iscte.pidesco.javaeditor.service.JavaEditorListener; | ||
import pt.iscte.pidesco.projectbrowser.service.ProjectBrowserServices; | ||
|
||
public class PackageFocusTool implements PidescoTool { | ||
|
||
private static final String FILTER_ID = "pt.iscte.pidesco.javaeditor.packagefocus"; | ||
|
||
@Override | ||
public void run(boolean selected) { | ||
|
||
BundleContext context = JavaEditorActivator.getInstance().getContext(); | ||
|
||
ServiceReference<PidescoServices> ref1 = context.getServiceReference(PidescoServices.class); | ||
final PidescoServices services = context.getService(ref1); | ||
|
||
ServiceReference<ProjectBrowserServices> ref2 = context.getServiceReference(ProjectBrowserServices.class); | ||
ProjectBrowserServices browser = context.getService(ref2); | ||
|
||
|
||
if(selected) { | ||
browser.activateFilter(FILTER_ID); | ||
JavaEditorActivator.getInstance().addListener( | ||
new JavaEditorListener.Adapter() { | ||
@Override | ||
public void fileOpened(File file) { | ||
services.runTool(ProjectBrowserServices.REFRESH_TOOL_ID, true); | ||
} | ||
}); | ||
} | ||
else { | ||
browser.deactivateFilter(FILTER_ID); | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
pt.iscte.pidesco.javaeditor/src/pt/iscte/pidesco/javaeditor/internal/Common.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2014 Andre L. Santos. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Andre L Santos - developer | ||
******************************************************************************/ | ||
package pt.iscte.pidesco.javaeditor.internal; | ||
|
||
import org.eclipse.jface.text.TextAttribute; | ||
import org.eclipse.jface.text.rules.IToken; | ||
import org.eclipse.jface.text.rules.Token; | ||
import org.eclipse.swt.SWT; | ||
|
||
public class Common { | ||
public static IToken createToken(TokenColor color, boolean bold) { | ||
if(bold) | ||
return new Token(new TextAttribute(color.color, null, SWT.BOLD)); | ||
else | ||
return new Token(new TextAttribute(color.color)); | ||
|
||
} | ||
} | ||
|
96 changes: 96 additions & 0 deletions
96
pt.iscte.pidesco.javaeditor/src/pt/iscte/pidesco/javaeditor/internal/Configuration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2014 Andre L. Santos. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Andre L Santos - developer | ||
******************************************************************************/ | ||
package pt.iscte.pidesco.javaeditor.internal; | ||
|
||
import java.util.Iterator; | ||
|
||
import org.eclipse.jface.text.BadLocationException; | ||
import org.eclipse.jface.text.IDocument; | ||
import org.eclipse.jface.text.TextAttribute; | ||
import org.eclipse.jface.text.presentation.IPresentationReconciler; | ||
import org.eclipse.jface.text.presentation.PresentationReconciler; | ||
import org.eclipse.jface.text.rules.DefaultDamagerRepairer; | ||
import org.eclipse.jface.text.source.Annotation; | ||
import org.eclipse.jface.text.source.IAnnotationHover; | ||
import org.eclipse.jface.text.source.ISourceViewer; | ||
import org.eclipse.jface.text.source.SourceViewerConfiguration; | ||
|
||
|
||
public class Configuration extends SourceViewerConfiguration { | ||
// private JavaCodeScanner tagScanner; | ||
|
||
public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) { | ||
return new String[] { | ||
IDocument.DEFAULT_CONTENT_TYPE, | ||
JavaCodePartitionScanner.JAVA_COMMENT}; | ||
// JavaCodePartitionScanner.JAVA_CODE }; | ||
} | ||
|
||
|
||
// protected JavaCodeScanner getTagScanner() { | ||
// if (tagScanner == null) { | ||
// tagScanner = new JavaCodeScanner(); | ||