Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(85) |
Oct
(105) |
Nov
(35) |
Dec
(41) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(15) |
Feb
|
Mar
(7) |
Apr
(25) |
May
(55) |
Jun
(92) |
Jul
(81) |
Aug
(63) |
Sep
(32) |
Oct
(32) |
Nov
(1) |
Dec
(44) |
2005 |
Jan
(56) |
Feb
(47) |
Mar
(9) |
Apr
(1) |
May
(7) |
Jun
(2) |
Jul
(19) |
Aug
(23) |
Sep
(117) |
Oct
(10) |
Nov
|
Dec
(151) |
2006 |
Jan
(6) |
Feb
(24) |
Mar
(23) |
Apr
(25) |
May
(4) |
Jun
(91) |
Jul
(18) |
Aug
(232) |
Sep
(160) |
Oct
(224) |
Nov
(170) |
Dec
(133) |
2007 |
Jan
(47) |
Feb
(37) |
Mar
(23) |
Apr
(209) |
May
(85) |
Jun
(169) |
Jul
(48) |
Aug
(72) |
Sep
(56) |
Oct
(36) |
Nov
(7) |
Dec
(2) |
2008 |
Jan
(38) |
Feb
(50) |
Mar
(18) |
Apr
(9) |
May
(46) |
Jun
(1) |
Jul
(18) |
Aug
(33) |
Sep
(8) |
Oct
(27) |
Nov
|
Dec
(21) |
2009 |
Jan
(3) |
Feb
(33) |
Mar
(35) |
Apr
(10) |
May
(27) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
(1) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
1
(1) |
2
(8) |
3
(5) |
4
(4) |
5
|
6
(3) |
7
(7) |
8
(2) |
9
(2) |
10
(10) |
11
|
12
(1) |
13
(2) |
14
(3) |
15
|
16
(23) |
17
|
18
(7) |
19
|
20
|
21
|
22
|
23
|
24
|
25
|
26
|
27
|
28
|
29
(4) |
30
(3) |
|
|
|
|
From: <luelljoc@us...> - 2003-09-07 16:45:49
|
Update of /cvsroot/e-p-i-c/org.epic.perleditor/icons In directory sc8-pr-cvs1:/tmp/cvs-serv6120/icons Added Files: light_bulb.gif Log Message: Initial version. --- NEW FILE: light_bulb.gif --- (This appears to be a binary file; contents omitted.) |
From: <luelljoc@us...> - 2003-09-07 16:43:18
|
Update of /cvsroot/e-p-i-c/org.epic.perleditor/src/org/epic/perleditor/popupmenus In directory sc8-pr-cvs1:/tmp/cvs-serv5426/src/org/epic/perleditor/popupmenus Added Files: PerlDocAction.java PopupMessages.java PopupMessages.properties Log Message: Initial version. --- NEW FILE: PerlDocAction.java --- package org.epic.perleditor.popupmenus; import org.eclipse.jface.action.IAction; import org.eclipse.jface.dialogs.InputDialog; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.editors.text.TextEditor; import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.jface.text.TextSelection; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.window.*; import org.eclipse.swt.widgets.*; import org.eclipse.swt.*; import org.epic.perleditor.editors.util.PerlExecutableUtilities; import org.epic.perleditor.editors.PerlImages; import java.util.List; import java.io.*; public class PerlDocAction extends ApplicationWindow implements org.eclipse.ui.IEditorActionDelegate { private ITextEditor fTextEditor; private String selection; private String content; private String title; final static int WINDOW_WIDTH = 500; final static int WINDOW_HEIGHT = 500; final static int WINDOW_OFFSET_X = 200; final static int WINDOW_OFFSET_Y = 100; public PerlDocAction() { super(null); } protected Control createContents(Composite parent) { getShell().setBounds(WINDOW_OFFSET_X, WINDOW_OFFSET_Y, WINDOW_WIDTH, WINDOW_HEIGHT); getShell().setText(title); getShell().setImage(PerlImages.ICON_EDITOR.createImage()); Text t = new Text(parent, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL); t.setText(content); return t; } /* (non-Javadoc) * @see org.eclipse.ui.texteditor.IUpdate#update() */ public void update() { } /* (non-Javadoc) * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart) */ public void setActiveEditor(IAction action, IEditorPart targetEditor) { fTextEditor = (ITextEditor) targetEditor; } /* (non-Javadoc) * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ public void run(IAction action) { selection = ((TextSelection) fTextEditor.getSelectionProvider().getSelection()) .getText(); if (selection.length() == 0) { InputDialog inputDialog = new InputDialog( getShell(), PopupMessages.getString("PerlDoc.search.title") + " (" + action.getText() + ")", PopupMessages.getString("PerlDoc.search.message"), "", null); int returnCode = inputDialog.open(); if (returnCode == Window.OK) { selection = inputDialog.getValue(); } else { return; } } String option = null; String actionId = action.getId(); if (actionId.endsWith("Module")) { option = "-t"; } else if (actionId.endsWith("ModuleSource")) { option = "-m"; } else if (actionId.endsWith("BuiltinFunction")) { option = "-t -f"; } else if (actionId.endsWith("Faq")) { option = "-t -q"; } title = "Perldoc for " + selection + " (" + action.getText() + ")"; content = getPerlDoc(option, selection); if (content.length() == 0) { MessageDialog.openInformation( getShell(), PopupMessages.getString("NoDocumentation.title"), PopupMessages.getString("NoDocumentation.message")); return; } else { this.close(); this.setBlockOnOpen(true); this.open(); } } /* (non-Javadoc) * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) */ public void selectionChanged(IAction action, ISelection selection) { } private String getPerlDoc(String option, String selection) { String perlCode = "use Env qw(@PERL5LIB);\n\n" + "push(@PERL5LIB, @INC);\n" + "exec('perldoc " + option + " \"" + selection + "\"');"; String tmpFileName = null; String content = ""; try { // Construct command line parameters List cmdList = PerlExecutableUtilities.getPerlExecutableCommandLine( (TextEditor) fTextEditor); String[] cmdParams = (String[]) cmdList.toArray(new String[cmdList.size()]); //Get working directory -- Fixes Bug: 736631 String workingDir = ((IFileEditorInput) fTextEditor.getEditorInput()) .getFile() .getLocation() .makeAbsolute() .removeLastSegments(1) .toString(); /* * Due to Java Bug #4763384 sleep for a very small amount of time * immediately after starting the subprocess */ Process proc = Runtime.getRuntime().exec( cmdParams, null, new File(workingDir)); Thread.sleep(1); InputStream in = proc.getInputStream(); OutputStream out = proc.getOutputStream(); try { out.write(perlCode.getBytes()); } catch (Exception ex) { System.out.println(ex); } out.close(); content = PerlExecutableUtilities.readStringFromStream(in); in.close(); } catch (Exception ex) { ex.printStackTrace(); } return content; } } --- NEW FILE: PopupMessages.java --- /******************************************************************************* * Copyright (c) 2000, 2003 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.epic.perleditor.popupmenus; import java.text.MessageFormat; import java.util.MissingResourceException; import java.util.ResourceBundle; public class PopupMessages { private static final String RESOURCE_BUNDLE= PopupMessages.class.getName(); private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); private PopupMessages() { } public static String getString(String key) { try { return fgResourceBundle.getString(key); } catch (MissingResourceException e) { return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ } } /** * Gets a string from the resource bundle and formats it with the argument * * @param key the string used to get the bundle value, must not be null */ public static String getFormattedString(String key, Object[] args) { String format= null; try { format= fgResourceBundle.getString(key); } catch (MissingResourceException e) { return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ } return MessageFormat.format(format, args); } /** * Gets a string from the resource bundle and formats it with the argument * * @param key the string used to get the bundle value, must not be null */ public static String getFormattedString(String key, Object arg) { String format= null; try { format= fgResourceBundle.getString(key); } catch (MissingResourceException e) { return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$ } if (arg == null) arg= ""; //$NON-NLS-1$ return MessageFormat.format(format, new Object[] { arg }); } } --- NEW FILE: PopupMessages.properties --- NoSelection.title=No Selection NoSelection.message=No selection available. NoDocumentation.title=Perldoc NoDocumentation.message=Documentation not available. PerlDoc.search.title=Perldoc Search PerlDoc.search.message=Enter search string: |
From: <luelljoc@us...> - 2003-09-07 16:42:25
|
Update of /cvsroot/e-p-i-c/org.epic.perleditor/src/org/epic/perleditor/popupmenus In directory sc8-pr-cvs1:/tmp/cvs-serv5272/src/org/epic/perleditor/popupmenus Log Message: Directory /cvsroot/e-p-i-c/org.epic.perleditor/src/org/epic/perleditor/popupmenus added to the repository |
From: <luelljoc@us...> - 2003-09-07 16:41:52
|
Update of /cvsroot/e-p-i-c/org.epic.perleditor/src/org/epic/perleditor/editors In directory sc8-pr-cvs1:/tmp/cvs-serv5067/src/org/epic/perleditor/editors Modified Files: PerlEditor.java Log Message: Compatibility version which should work for Eclipse 2.1 and 3.x In a later step this should be changed to support only Eclipse 3.x. At this point the code should be cleaned up. Basic Perldoc support added. Index: PerlEditor.java =================================================================== RCS file: /cvsroot/e-p-i-c/org.epic.perleditor/src/org/epic/perleditor/editors/PerlEditor.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- PerlEditor.java 26 Aug 2003 15:18:08 -0000 1.9 +++ PerlEditor.java 7 Sep 2003 16:41:48 -0000 1.10 @@ -1,3 +1,14 @@ +/* + * This is a compatibility version which should work for Eclipse 2.1 and 3.x + * In a later step this should be changed to support only Eclipse 3.x. + * At this point the code should be cleaned up. + * When cleaning up code the class SharedTextColors and the method + * configureSourceViewerDecorationSupport() should be removed and the method + * createSourceViewer() has to be updated. + * All Methods/Classes subject to change are marked with + * "TODO For Eclipse 3.0 compatibility" + */ + package org.epic.perleditor.editors; import java.util.Iterator; @@ -18,8 +29,9 @@ import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.editors.text.TextEditor; -import org.eclipse.ui.internal.editors.text.EditorsPlugin; +import org.eclipse.ui.editors.text.TextEditorPreferenceConstants; import org.eclipse.ui.texteditor.AnnotationPreference; +import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess; import org.eclipse.ui.texteditor.IDocumentProvider; import org.eclipse.ui.texteditor.MarkerAnnotationPreferences; import org.eclipse.ui.texteditor.SourceViewerDecorationSupport; @@ -46,6 +58,12 @@ import cbg.editor.*; +// TODO For Eclipse 3.0 compatibility +import org.eclipse.swt.widgets.Display; +import java.util.Map; +import java.util.HashMap; +import org.eclipse.swt.graphics.Color; + /** * Perl specific text editor. */ @@ -82,6 +100,8 @@ this.setPreferenceStore( PerlEditorPlugin.getDefault().getPreferenceStore()); + + setEditorContextMenuId("#PerlDocEditorContext"); } /** The PerlEditor implementation of this @@ -234,9 +254,7 @@ /* * Method declared on AbstractTextEditor */ - // TODO protected void initializeEditor() { - //TODO ????? //PerlEditorEnvironment.connect(this); setSourceViewerConfiguration( new PerlSourceViewerConfiguration( @@ -252,34 +270,18 @@ IVerticalRuler ruler, int styles) { - super.fAnnotationAccess = createAnnotationAccess(); - - ISharedTextColors sharedColors = - EditorsPlugin.getDefault().getSharedTextColors(); + fAnnotationAccess = createAnnotationAccess(); + ISharedTextColors sharedColors = new SharedTextColors(); fOverviewRuler = new OverviewRuler( fAnnotationAccess, VERTICAL_RULER_WIDTH, sharedColors); + fOverviewRuler.addHeaderAnnotationType(AnnotationType.WARNING); + fOverviewRuler.addHeaderAnnotationType(AnnotationType.ERROR); - MarkerAnnotationPreferences fAnnotationPreferences = - new MarkerAnnotationPreferences(); - - Iterator e = - fAnnotationPreferences.getAnnotationPreferences().iterator(); - - while (e.hasNext()) { - - AnnotationPreference preference = (AnnotationPreference) e.next(); - - if (preference.contributesToHeader()) - fOverviewRuler.addHeaderAnnotationType( - preference.getAnnotationType()); - - } - - ISourceViewer sourceViewer = + ISourceViewer viewer = new PerlSourceViewer( parent, ruler, @@ -289,14 +291,13 @@ fSourceViewerDecorationSupport = new SourceViewerDecorationSupport( - sourceViewer, + viewer, fOverviewRuler, fAnnotationAccess, sharedColors); - configureSourceViewerDecorationSupport(); - return sourceViewer; + return viewer; } @@ -396,4 +397,107 @@ getSourceViewer().getTextWidget().setForeground( PerlColorProvider.getColor(rgb)); } + + // TODO For Eclipse 3.0 compatibility + /** + * Configures the decoration support for this editor's the source viewer. + * + * @since 2.1 + */ + protected void configureSourceViewerDecorationSupport() { + MarkerAnnotationPreferences fAnnotationPreferences = + new MarkerAnnotationPreferences(); + Iterator e = + fAnnotationPreferences.getAnnotationPreferences().iterator(); + while (e.hasNext()) + fSourceViewerDecorationSupport.setAnnotationPreference( + (AnnotationPreference) e.next()); + fSourceViewerDecorationSupport.setAnnotationPainterPreferenceKeys( + DefaultMarkerAnnotationAccess.UNKNOWN, + TextEditorPreferenceConstants.EDITOR_UNKNOWN_INDICATION_COLOR, + TextEditorPreferenceConstants.EDITOR_UNKNOWN_INDICATION, + TextEditorPreferenceConstants + .EDITOR_UNKNOWN_INDICATION_IN_OVERVIEW_RULER, + 0); + + fSourceViewerDecorationSupport.setCursorLinePainterPreferenceKeys( + TextEditorPreferenceConstants.EDITOR_CURRENT_LINE, + TextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR); + fSourceViewerDecorationSupport.setMarginPainterPreferenceKeys( + TextEditorPreferenceConstants.EDITOR_PRINT_MARGIN, + TextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR, + TextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN); + fSourceViewerDecorationSupport.setSymbolicFontName( + getFontPropertyPreferenceKey()); + } + +} + +// TODO For Eclipse 3.0 compatibility +/******************************************************************************* + * Copyright (c) 2000, 2003 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +/* + * @see org.eclipse.jface.text.source.ISharedTextColors + * @since 2.1 + */ +class SharedTextColors implements ISharedTextColors { + + /** The display table. */ + private Map fDisplayTable; + + /** Creates an returns a shared color manager. */ + public SharedTextColors() { + super(); + } + + /* + * @see ISharedTextColors#getColor(RGB) + */ + public Color getColor(RGB rgb) { + if (rgb == null) + return null; + + if (fDisplayTable == null) + fDisplayTable = new HashMap(2); + + Display display = Display.getCurrent(); + + Map colorTable = (Map) fDisplayTable.get(display); + if (colorTable == null) { + colorTable = new HashMap(10); + fDisplayTable.put(display, colorTable); + } + + Color color = (Color) colorTable.get(rgb); + if (color == null) { + color = new Color(display, rgb); + colorTable.put(rgb, color); + } + + return color; + } + + /* + * @see ISharedTextColors#dispose() + */ + public void dispose() { + if (fDisplayTable != null) { + Iterator j = fDisplayTable.values().iterator(); + while (j.hasNext()) { + Iterator i = ((Map) j.next()).values().iterator(); + while (i.hasNext()) + ((Color) i.next()).dispose(); + } + } + } + } |
From: <luelljoc@us...> - 2003-09-07 16:38:25
|
Update of /cvsroot/e-p-i-c/org.epic.perleditor In directory sc8-pr-cvs1:/tmp/cvs-serv4310 Modified Files: plugin.xml Log Message: Basic Perldoc support added. Index: plugin.xml =================================================================== RCS file: /cvsroot/e-p-i-c/org.epic.perleditor/plugin.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- plugin.xml 3 Sep 2003 01:13:58 -0000 1.6 +++ plugin.xml 7 Sep 2003 16:38:22 -0000 1.7 @@ -120,5 +120,48 @@ </filter> </page> </extension> + + <!-- Perldoc Perl Editor popup menu definition --> +<extension point="org.eclipse.ui.popupMenus"> + + <viewerContribution + id="org.epic.perleditor.PerlDocPopup" + targetID="#PerlDocEditorContext" > + <menu + id="PelDocPopupMenu" + path="additions" + label="&Perldoc"> + <separator name="PerlDocGroup"/> + </menu> + <action + id="org.epic.perleditor.popupmenus.PerlDocAction.Faq" + label="FAQ Search" + icon="icons/light_bulb.gif" + menubarPath="PelDocPopupMenu/PerlDocGroup" + class="org.epic.perleditor.popupmenus.PerlDocAction"> + </action> + <action + id="org.epic.perleditor.popupmenus.PerlDocAction.BuiltinFunction" + label="Builtin Function Documentation" + icon="icons/epic.gif" + menubarPath="PelDocPopupMenu/PerlDocGroup" + class="org.epic.perleditor.popupmenus.PerlDocAction"> + </action> + <action + id="org.epic.perleditor.popupmenus.PerlDocAction.ModuleSource" + label="Module/Program Source" + icon="icons/module_node.gif" + menubarPath="PelDocPopupMenu/PerlDocGroup" + class="org.epic.perleditor.popupmenus.PerlDocAction"> + </action> + <action + id="org.epic.perleditor.popupmenus.PerlDocAction.Module" + label="Module/Program Documentation" + icon="icons/module_node.gif" + menubarPath="PelDocPopupMenu/PerlDocGroup" + class="org.epic.perleditor.popupmenus.PerlDocAction"> + </action> + </viewerContribution> + </extension> </plugin> |
From: <luelljoc@us...> - 2003-09-07 16:31:31
|
Update of /cvsroot/e-p-i-c/org.epic.ext.unsupported.colorer In directory sc8-pr-cvs1:/tmp/cvs-serv2933 Modified Files: plugin.xml Log Message: Basic Perldoc support added. Index: plugin.xml =================================================================== RCS file: /cvsroot/e-p-i-c/org.epic.ext.unsupported.colorer/plugin.xml,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- plugin.xml 10 May 2003 12:15:42 -0000 1.1.1.1 +++ plugin.xml 7 Sep 2003 16:31:25 -0000 1.2 @@ -19,6 +19,7 @@ --> </runtime> <requires> + <import plugin="org.apache.xerces"/> <import plugin="org.eclipse.ui"/> <import plugin="org.eclipse.core.resources"/> <import plugin="org.epic.ext.cbg.editor"/> @@ -118,5 +119,48 @@ <filter name="nature" value="org.epic.perleditor.perlnature"/> </page> </extension> + +<!-- Perldoc Perl Editor popup menu definition --> +<extension point="org.eclipse.ui.popupMenus"> + + <viewerContribution + id="org.epic.perleditor.PerlDocPopup" + targetID="#PerlDocEditorContext" > + <menu + id="PelDocPopupMenu" + path="additions" + label="&Perldoc"> + <separator name="PerlDocGroup"/> + </menu> + <action + id="org.epic.perleditor.popupmenus.PerlDocAction.Faq" + label="FAQ Search" + icon="icons/light_bulb.gif" + menubarPath="PelDocPopupMenu/PerlDocGroup" + class="org.epic.perleditor.popupmenus.PerlDocAction"> + </action> + <action + id="org.epic.perleditor.popupmenus.PerlDocAction.BuiltinFunction" + label="Builtin Function Documentation" + icon="icons/epic.gif" + menubarPath="PelDocPopupMenu/PerlDocGroup" + class="org.epic.perleditor.popupmenus.PerlDocAction"> + </action> + <action + id="org.epic.perleditor.popupmenus.PerlDocAction.ModuleSource" + label="Module/Program Source" + icon="icons/module_node.gif" + menubarPath="PelDocPopupMenu/PerlDocGroup" + class="org.epic.perleditor.popupmenus.PerlDocAction"> + </action> + <action + id="org.epic.perleditor.popupmenus.PerlDocAction.Module" + label="Module/Program Documentation" + icon="icons/module_node.gif" + menubarPath="PelDocPopupMenu/PerlDocGroup" + class="org.epic.perleditor.popupmenus.PerlDocAction"> + </action> + </viewerContribution> + </extension> </plugin> |
From: <luelljoc@us...> - 2003-09-07 16:30:55
|
Update of /cvsroot/e-p-i-c/org.epic.ext.unsupported.colorer/src/org/epic/ext/unsupported/colorer In directory sc8-pr-cvs1:/tmp/cvs-serv2797/src/org/epic/ext/unsupported/colorer Modified Files: PerlEditor.java Log Message: Compatibility version which should work for Eclipse 2.1 and 3.x In a later step this should be changed to support only Eclipse 3.x. At this point the code should be cleaned up. Basic Perldoc support added. Index: PerlEditor.java =================================================================== RCS file: /cvsroot/e-p-i-c/org.epic.ext.unsupported.colorer/src/org/epic/ext/unsupported/colorer/PerlEditor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- PerlEditor.java 27 Aug 2003 14:53:47 -0000 1.2 +++ PerlEditor.java 7 Sep 2003 16:30:48 -0000 1.3 @@ -1,4 +1,15 @@ /* + * This is a compatibility version which should work for Eclipse 2.1 and 3.x + * In a later step this should be changed to support only Eclipse 3.x. + * At this point the code should be cleaned up. + * When cleaning up code the class SharedTextColors and the method + * configureSourceViewerDecorationSupport() should be removed and the method + * createSourceViewer() has to be updated. + * All Methods/Classes subject to change are marked with + * "TODO For Eclipse 3.0 compatibility" + */ + +/* * This file is a duplicate of org.epic.perleditor.editors.PerlEditor * to allow the use of the Colorer plugin * Changes are marked with todo tags! @@ -23,8 +34,10 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IFileEditorInput; +import org.eclipse.ui.editors.text.TextEditorPreferenceConstants; import org.eclipse.ui.internal.editors.text.EditorsPlugin; import org.eclipse.ui.texteditor.AnnotationPreference; +import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess; import org.eclipse.ui.texteditor.IDocumentProvider; import org.eclipse.ui.texteditor.MarkerAnnotationPreferences; import org.eclipse.ui.texteditor.SourceViewerDecorationSupport; @@ -44,6 +57,13 @@ import org.epic.perleditor.editors.*; import net.sf.colorer.eclipse.editors.*; +// TODO For Eclipse 3.0 compatibility +import org.eclipse.swt.widgets.Display; +import java.util.Map; +import java.util.HashMap; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.RGB; + /** * Perl specific text editor. */ @@ -81,6 +101,8 @@ this.setPreferenceStore(PerlEditorPlugin.getDefault().getPreferenceStore()); + + setEditorContextMenuId("#PerlDocEditorContext"); } /** The <code>PerlEditor</code> implementation of this @@ -238,59 +260,42 @@ } /* Create SourceViewer so we can use the PerlSourceViewer class */ - protected final ISourceViewer createSourceViewer( - Composite parent, - IVerticalRuler ruler, - int styles) { - - super.fAnnotationAccess = createAnnotationAccess(); - - ISharedTextColors sharedColors = - EditorsPlugin.getDefault().getSharedTextColors(); - - fOverviewRuler = - new OverviewRuler( - fAnnotationAccess, - VERTICAL_RULER_WIDTH, - sharedColors); + protected final ISourceViewer createSourceViewer( + Composite parent, + IVerticalRuler ruler, + int styles) { - MarkerAnnotationPreferences fAnnotationPreferences = - new MarkerAnnotationPreferences(); + fAnnotationAccess = createAnnotationAccess(); + ISharedTextColors sharedColors = new SharedTextColors(); - Iterator e = - fAnnotationPreferences.getAnnotationPreferences().iterator(); + fOverviewRuler = + new OverviewRuler( + fAnnotationAccess, + VERTICAL_RULER_WIDTH, + sharedColors); + fOverviewRuler.addHeaderAnnotationType(AnnotationType.WARNING); + fOverviewRuler.addHeaderAnnotationType(AnnotationType.ERROR); - while (e.hasNext()) { + ISourceViewer viewer = + new PerlSourceViewer( + parent, + ruler, + fOverviewRuler, + isOverviewRulerVisible(), + styles); - AnnotationPreference preference = (AnnotationPreference) e.next(); + fSourceViewerDecorationSupport = + new SourceViewerDecorationSupport( + viewer, + fOverviewRuler, + fAnnotationAccess, + sharedColors); + configureSourceViewerDecorationSupport(); - if (preference.contributesToHeader()) - fOverviewRuler.addHeaderAnnotationType( - preference.getAnnotationType()); + return viewer; } - ISourceViewer sourceViewer = - new PerlSourceViewer( - parent, - ruler, - fOverviewRuler, - isOverviewRulerVisible(), - styles); - - fSourceViewerDecorationSupport = - new SourceViewerDecorationSupport( - sourceViewer, - fOverviewRuler, - fAnnotationAccess, - sharedColors); - - configureSourceViewerDecorationSupport(); - - return sourceViewer; - - } - /* protected IVerticalRuler createVerticalRuler() { ruler = new CompositeRuler(); @@ -380,4 +385,107 @@ public ISourceViewer getViewer() { return getSourceViewer(); } + + // TODO For Eclipse 3.0 compatibility + /** + * Configures the decoration support for this editor's the source viewer. + * + * @since 2.1 + */ + protected void configureSourceViewerDecorationSupport() { + MarkerAnnotationPreferences fAnnotationPreferences = + new MarkerAnnotationPreferences(); + Iterator e = + fAnnotationPreferences.getAnnotationPreferences().iterator(); + while (e.hasNext()) + fSourceViewerDecorationSupport.setAnnotationPreference( + (AnnotationPreference) e.next()); + fSourceViewerDecorationSupport.setAnnotationPainterPreferenceKeys( + DefaultMarkerAnnotationAccess.UNKNOWN, + TextEditorPreferenceConstants.EDITOR_UNKNOWN_INDICATION_COLOR, + TextEditorPreferenceConstants.EDITOR_UNKNOWN_INDICATION, + TextEditorPreferenceConstants + .EDITOR_UNKNOWN_INDICATION_IN_OVERVIEW_RULER, + 0); + + fSourceViewerDecorationSupport.setCursorLinePainterPreferenceKeys( + TextEditorPreferenceConstants.EDITOR_CURRENT_LINE, + TextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR); + fSourceViewerDecorationSupport.setMarginPainterPreferenceKeys( + TextEditorPreferenceConstants.EDITOR_PRINT_MARGIN, + TextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR, + TextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN); + fSourceViewerDecorationSupport.setSymbolicFontName( + getFontPropertyPreferenceKey()); + } + +} + +// TODO For Eclipse 3.0 compatibility +/******************************************************************************* + * Copyright (c) 2000, 2003 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +/* + * @see org.eclipse.jface.text.source.ISharedTextColors + * @since 2.1 + */ +class SharedTextColors implements ISharedTextColors { + + /** The display table. */ + private Map fDisplayTable; + + /** Creates an returns a shared color manager. */ + public SharedTextColors() { + super(); + } + + /* + * @see ISharedTextColors#getColor(RGB) + */ + public Color getColor(RGB rgb) { + if (rgb == null) + return null; + + if (fDisplayTable == null) + fDisplayTable = new HashMap(2); + + Display display = Display.getCurrent(); + + Map colorTable = (Map) fDisplayTable.get(display); + if (colorTable == null) { + colorTable = new HashMap(10); + fDisplayTable.put(display, colorTable); + } + + Color color = (Color) colorTable.get(rgb); + if (color == null) { + color = new Color(display, rgb); + colorTable.put(rgb, color); + } + + return color; + } + + /* + * @see ISharedTextColors#dispose() + */ + public void dispose() { + if (fDisplayTable != null) { + Iterator j = fDisplayTable.values().iterator(); + while (j.hasNext()) { + Iterator i = ((Map) j.next()).values().iterator(); + while (i.hasNext()) + ((Color) i.next()).dispose(); + } + } + } + } |