You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(83) |
Feb
(10) |
Mar
|
Apr
|
May
|
Jun
(10) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ce...@us...> - 2004-01-13 17:06:33
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/editor
In directory sc8-pr-cvs1:/tmp/cvs-serv28825/src/net/sourceforge/csseditor/internal/editor
Modified Files:
ShowSelectedElementOnlyAction.java
Log Message:
Cleanup
Index: ShowSelectedElementOnlyAction.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/editor/ShowSelectedElementOnlyAction.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ShowSelectedElementOnlyAction.java 27 Dec 2003 18:46:55 -0000 1.2
--- ShowSelectedElementOnlyAction.java 13 Jan 2004 17:06:30 -0000 1.3
***************
*** 52,56 ****
super(CssEditorMessages.getResourceBundle(),
"CssEditor.showSelectedElementOnly.", null); //$NON-NLS-1$
! this.store = CssEditorPlugin.getDefault().getPreferenceStore();
update();
}
--- 52,56 ----
super(CssEditorMessages.getResourceBundle(),
"CssEditor.showSelectedElementOnly.", null); //$NON-NLS-1$
! store = CssEditorPlugin.getDefault().getPreferenceStore();
update();
}
***************
*** 73,80 ****
highlightRange.getLength(), true);
}
! this.store.removePropertyChangeListener(this);
! this.store.setValue(
CssEditorPreferences.EDITOR_SHOW_SELECTED_ELEMENT_ONLY, show);
! this.store.addPropertyChangeListener(this);
}
}
--- 73,80 ----
highlightRange.getLength(), true);
}
! store.removePropertyChangeListener(this);
! store.setValue(
CssEditorPreferences.EDITOR_SHOW_SELECTED_ELEMENT_ONLY, show);
! store.addPropertyChangeListener(this);
}
}
***************
*** 86,97 ****
super.setEditor(editor);
if (editor != null) {
! if (this.store == null) {
! this.store = CssEditorPlugin.getDefault().getPreferenceStore();
! this.store.addPropertyChangeListener(this);
}
synchronizeWithPreference(editor);
! } else if (this.store != null) {
! this.store.removePropertyChangeListener(this);
! this.store = null;
}
update();
--- 86,97 ----
super.setEditor(editor);
if (editor != null) {
! if (store == null) {
! store = CssEditorPlugin.getDefault().getPreferenceStore();
! store.addPropertyChangeListener(this);
}
synchronizeWithPreference(editor);
! } else if (store != null) {
! store.removePropertyChangeListener(this);
! store = null;
}
update();
***************
*** 128,131 ****
--- 128,133 ----
* Synchronizes the appearance of the editor with what the preference store
* contains.
+ *
+ * @param editor the editor to synchronize
*/
private void synchronizeWithPreference(ITextEditor editor) {
|
|
From: <ce...@us...> - 2004-01-13 17:03:54
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/outline In directory sc8-pr-cvs1:/tmp/cvs-serv28123/src/net/sourceforge/csseditor/internal/outline Modified Files: CssOutlinePage.java Log Message: Cleanup: javadoc fixes, unnecessary 'this' qualifiers removed Index: CssOutlinePage.java =================================================================== RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/outline/CssOutlinePage.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CssOutlinePage.java 13 Jan 2004 16:19:22 -0000 1.3 --- CssOutlinePage.java 13 Jan 2004 17:03:49 -0000 1.4 *************** *** 46,52 **** /** * Implements the outline page associated with the CSS editor. - * - * TODO Implement ordering by selector specificity - * (see http://www.w3.org/TR/CSS21/cascade.html#specificity) */ public class CssOutlinePage extends ContentOutlinePage { --- 46,49 ---- *************** *** 97,102 **** // Action Implementation ----------------------------------------------- ! /** ! * @see Action.run() */ public void run() { --- 94,99 ---- // Action Implementation ----------------------------------------------- ! /* ! * @see org.eclipse.jface.action.Action#run() */ public void run() { *************** *** 131,136 **** /** ! * This action toggles whether this Java Outline page links ! * its selection to the active editor. */ private class ToggleLinkingAction extends ResourceAction { --- 128,133 ---- /** ! * This action toggles whether this Java Outline page links its selection ! * to the active editor. */ private class ToggleLinkingAction extends ResourceAction { *************** *** 148,153 **** } ! /** ! * Runs the action. */ public void run() { --- 145,150 ---- } ! /* ! * @see org.eclipse.jface.action.Action#run() */ public void run() { *************** *** 169,173 **** new Runnable() { public void run() { ! CssOutlinePage.this.editor.synchronizeOutlinePage(); } }); --- 166,170 ---- new Runnable() { public void run() { ! editor.synchronizeOutlinePage(); } }); *************** *** 207,211 **** // ContentOutlinePage Implementation --------------------------------------- ! /** * @see org.eclipse.ui.part.IPage#createControl(Composite) */ --- 204,208 ---- // ContentOutlinePage Implementation --------------------------------------- ! /* * @see org.eclipse.ui.part.IPage#createControl(Composite) */ *************** *** 219,223 **** } ! /** * @see org.eclipse.ui.part.IPage#dispose() */ --- 216,220 ---- } ! /* * @see org.eclipse.ui.part.IPage#dispose() */ *************** *** 230,234 **** } ! /** * @see org.eclipse.ui.part.IPageBookViewPage#init(org.eclipse.ui.part.IPageSite) */ --- 227,231 ---- } ! /* * @see org.eclipse.ui.part.IPageBookViewPage#init(org.eclipse.ui.part.IPageSite) */ *************** *** 243,247 **** } ! /** * @see org.eclipse.ui.part.Page#makeContributions(IMenuManager, IToolBarManager, IStatusLineManager) */ --- 240,244 ---- } ! /* * @see org.eclipse.ui.part.Page#makeContributions(IMenuManager, IToolBarManager, IStatusLineManager) */ |
|
From: <ce...@us...> - 2004-01-13 16:54:30
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/outline
In directory sc8-pr-cvs1:/tmp/cvs-serv25969/src/net/sourceforge/csseditor/internal/outline
Modified Files:
CssOutlineDoubleClickListener.java
Log Message:
Cleanup: better variable names, javadoc fix
Index: CssOutlineDoubleClickListener.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/outline/CssOutlineDoubleClickListener.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CssOutlineDoubleClickListener.java 27 Dec 2003 18:46:55 -0000 1.2
--- CssOutlineDoubleClickListener.java 13 Jan 2004 16:54:27 -0000 1.3
***************
*** 38,42 ****
* The associated content outline page.
*/
! private ContentOutlinePage page;
// Constructors ------------------------------------------------------------
--- 38,42 ----
* The associated content outline page.
*/
! private ContentOutlinePage outlinePage;
// Constructors ------------------------------------------------------------
***************
*** 45,57 ****
* Constructor.
*
! * @param page the associated outline page
*/
! public CssOutlineDoubleClickListener(ContentOutlinePage page) {
! this.page = page;
}
// IDoubleClickListener Implementation -------------------------------------
! /**
* @see IDoubleClickListener#doubleClick(DoubleClickEvent)
*/
--- 45,57 ----
* Constructor.
*
! * @param outlinePage the associated outline page
*/
! public CssOutlineDoubleClickListener(ContentOutlinePage outlinePage) {
! this.outlinePage = outlinePage;
}
// IDoubleClickListener Implementation -------------------------------------
! /*
* @see IDoubleClickListener#doubleClick(DoubleClickEvent)
*/
***************
*** 69,75 ****
*/
private void showPropertiesView() {
! IWorkbenchPage page = this.page.getSite().getPage();
try {
! page.showView(IPageLayout.ID_PROP_SHEET);
} catch (PartInitException e) {
CssEditorPlugin.log(
--- 69,75 ----
*/
private void showPropertiesView() {
! IWorkbenchPage workbenchPage = outlinePage.getSite().getPage();
try {
! workbenchPage.showView(IPageLayout.ID_PROP_SHEET);
} catch (PartInitException e) {
CssEditorPlugin.log(
|
|
From: <ce...@us...> - 2004-01-13 16:20:01
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/outline
In directory sc8-pr-cvs1:/tmp/cvs-serv18234/src/net/sourceforge/csseditor/internal/outline
Modified Files:
CssOutlineContentProvider.java
Log Message:
Fix javadoc comments, removed unnecessary 'this' qualifiers, guard against null
Index: CssOutlineContentProvider.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/outline/CssOutlineContentProvider.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CssOutlineContentProvider.java 27 Dec 2003 18:46:55 -0000 1.2
--- CssOutlineContentProvider.java 13 Jan 2004 16:19:58 -0000 1.3
***************
*** 53,57 ****
// ITreeContentProvider Implementation -------------------------------------
! /**
* ITreeContentProvider#getChildren(Object)
*/
--- 53,57 ----
// ITreeContentProvider Implementation -------------------------------------
! /*
* ITreeContentProvider#getChildren(Object)
*/
***************
*** 63,67 ****
}
! /**
* @see ITreeContentProvider#getParent(Object)
*/
--- 63,67 ----
}
! /*
* @see ITreeContentProvider#getParent(Object)
*/
***************
*** 73,77 ****
}
! /**
* @see ITreeContentProvider#hasChildren(Object)
*/
--- 73,77 ----
}
! /*
* @see ITreeContentProvider#hasChildren(Object)
*/
***************
*** 80,102 ****
}
! /**
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(Object)
*/
public Object[] getElements(Object inputElement) {
! if (this.styleSheet != null) {
! return this.styleSheet.getRules();
}
return new Object[0];
}
! /**
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
public void dispose() {
! this.outlinePage = null;
! this.styleSheet = null;
}
! /**
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object)
*/
--- 80,102 ----
}
! /*
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(Object)
*/
public Object[] getElements(Object inputElement) {
! if (styleSheet != null) {
! return styleSheet.getRules();
}
return new Object[0];
}
! /*
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
public void dispose() {
! outlinePage = null;
! styleSheet = null;
}
! /*
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object)
*/
***************
*** 110,114 ****
IStyleSheet newStyleSheet = (IStyleSheet) newInput;
newStyleSheet.addListener(this);
! this.styleSheet = newStyleSheet;
}
}
--- 110,114 ----
IStyleSheet newStyleSheet = (IStyleSheet) newInput;
newStyleSheet.addListener(this);
! styleSheet = newStyleSheet;
}
}
***************
*** 117,127 ****
// IStyleSheetListener Implementation --------------------------------------
! /**
* @see IStyleSheetListener#styleSheetChanged(StyleSheetChangeEvent)
*/
public void styleSheetChanged(StyleSheetChangeEvent event) {
! this.outlinePage.getControl().getDisplay().asyncExec(new Runnable() {
public void run() {
! CssOutlineContentProvider.this.outlinePage.update();
}
});
--- 117,129 ----
// IStyleSheetListener Implementation --------------------------------------
! /*
* @see IStyleSheetListener#styleSheetChanged(StyleSheetChangeEvent)
*/
public void styleSheetChanged(StyleSheetChangeEvent event) {
! outlinePage.getControl().getDisplay().asyncExec(new Runnable() {
public void run() {
! if (outlinePage != null) {
! outlinePage.update();
! }
}
});
|
|
From: <ce...@us...> - 2004-01-13 16:19:26
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/outline
In directory sc8-pr-cvs1:/tmp/cvs-serv18121/src/net/sourceforge/csseditor/internal/outline
Modified Files:
CssOutlinePage.java
Log Message:
Be conservative: retrieve the stylesheet before populating the outline page, and check whether it's null
Index: CssOutlinePage.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/outline/CssOutlinePage.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CssOutlinePage.java 27 Dec 2003 18:46:55 -0000 1.2
--- CssOutlinePage.java 13 Jan 2004 16:19:22 -0000 1.3
***************
*** 286,297 ****
*/
public void update() {
! TreeViewer viewer = getTreeViewer();
! if (viewer != null) {
! Control control = viewer.getControl();
! if ((control != null) && !control.isDisposed()) {
! control.setRedraw(false);
! viewer.setInput(getStyleSheet());
! viewer.expandAll();
! control.setRedraw(true);
}
}
--- 286,300 ----
*/
public void update() {
! IStyleSheet styleSheet = getStyleSheet();
! if (styleSheet != null) {
! TreeViewer viewer = getTreeViewer();
! if (viewer != null) {
! Control control = viewer.getControl();
! if ((control != null) && !control.isDisposed()) {
! control.setRedraw(false);
! viewer.setInput(styleSheet);
! viewer.expandAll();
! control.setRedraw(true);
! }
}
}
|
|
From: <ce...@us...> - 2004-01-13 16:18:41
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/editor
In directory sc8-pr-cvs1:/tmp/cvs-serv17970/src/net/sourceforge/csseditor/internal/editor
Modified Files:
CssEditor.java
Log Message:
Don't update the outline page when the file is saved, it will update anyway with the next reconcile.
Fixes bug #876168.
Index: CssEditor.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/editor/CssEditor.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** CssEditor.java 13 Jan 2004 14:13:53 -0000 1.4
--- CssEditor.java 13 Jan 2004 16:18:39 -0000 1.5
***************
*** 198,210 ****
/*
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#editorSaved()
- */
- protected void editorSaved() {
- if (outlinePage != null) {
- outlinePage.update();
- }
- }
-
- /*
* @see org.eclipse.ui.texteditor.AbstractTextEditor#getAdapter(Class)
*/
--- 198,201 ----
|
|
From: <ce...@us...> - 2004-01-13 15:17:11
|
Update of /cvsroot/csseditor/htdocs
In directory sc8-pr-cvs1:/tmp/cvs-serv30874
Modified Files:
index.html
Log Message:
Improve and factor out the news styles
Index: index.html
===================================================================
RCS file: /cvsroot/csseditor/htdocs/index.html,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** index.html 11 Jan 2004 14:24:57 -0000 1.11
--- index.html 13 Jan 2004 15:17:08 -0000 1.12
***************
*** 10,13 ****
--- 10,14 ----
href="http://sourceforge.net/export/rss2_projnews.php?group_id=97094"/>
<link rel="stylesheet" type="text/css" media="screen" href="style/layout.css">
+ <link rel="stylesheet" type="text/css" media="screen" href="style/news.css">
<link rel="stylesheet" type="text/css" media="print" href="style/print.css">
</head>
|
|
From: <ce...@us...> - 2004-01-13 15:17:11
|
Update of /cvsroot/csseditor/htdocs/style
In directory sc8-pr-cvs1:/tmp/cvs-serv30874/style
Modified Files:
layout.css
Added Files:
news.css
Log Message:
Improve and factor out the news styles
--- NEW FILE: news.css ---
/* $Revision: 1.10 $ */
#news {
background: #069;
border: white 1px solid;
color: white;
float: right;
font-size: 8pt;
margin: -4em 2em 1em;
padding: .25em 1em;
width: 20em;
}
#news h2 {
background: transparent;
border-bottom: white 1px solid;
font-size: 10pt;
margin: 0 0 .5em;
padding: .1em 0;
}
#news hr {
display: none;
}
#news :link, #news :visited {
font-weight: bold;
color: white;
text-decoration: none;
}
#news div {
margin-bottom: 1em;
text-align: right;
}
#news div :link, #news div :visited {
color: #90C8FF;
font-size: xx-small;
font-style: italic;
}
#news .rsslink {
font: bold 8pt Verdana, sans-serif;
background-color: #F60;
border: 1px outset;
float: right;
padding: 0 3px;
}
#news .rsslink:hover {
text-decoration: none;
}
Index: layout.css
===================================================================
RCS file: /cvsroot/csseditor/htdocs/style/layout.css,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** layout.css 11 Jan 2004 14:18:29 -0000 1.10
--- layout.css 13 Jan 2004 15:17:08 -0000 1.11
***************
*** 142,188 ****
margin-top: 3em;
}
-
- #news {
- background: #069;
- border: white 1px solid;
- color: white;
- float: right;
- font-size: 8pt;
- margin: -4em 2em 1em;
- padding: .25em 1em;
- width: 20em;
- }
- #news h2 {
- background: transparent;
- border-bottom: white 1px solid;
- font-size: 10pt;
- margin: 0 0 .5em;
- padding: .1em 0;
- }
- #news hr {
- display: none;
- }
- #news :link, #news :visited {
- font-weight: bold;
- color: white;
- text-decoration: none;
- }
- #news div {
- margin-top: .5em;
- }
- #news div :link, #news div :visited {
- font-size: 8pt;
- font-weight: normal;
- margin-bottom: 1em;
- }
- #news .rsslink {
- font: bold 8pt Verdana, sans-serif;
- background-color: #F60;
- border: 1px outset;
- float: right;
- padding: 0 3px;
- }
- #news .rsslink:hover {
- text-decoration: none;
- }
-
--- 142,143 ----
|
|
From: <ce...@us...> - 2004-01-13 14:14:56
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/editor
In directory sc8-pr-cvs1:/tmp/cvs-serv15397/src/net/sourceforge/csseditor/internal/editor
Modified Files:
CssEditorActionContributor.java
Log Message:
Remove unnecessary 'this' qualifiers
Index: CssEditorActionContributor.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/editor/CssEditorActionContributor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CssEditorActionContributor.java 27 Dec 2003 18:46:55 -0000 1.2
--- CssEditorActionContributor.java 13 Jan 2004 14:14:53 -0000 1.3
***************
*** 94,107 ****
}
! this.contentAssistAction.setAction(
getAction(editor, ICssEditorActionConstants.CONTENT_ASSIST));
! this.showSelectedElementOnlyAction.setEditor(editor);
! this.showSelectedElementOnlyAction.update();
IActionBars bars = getActionBars();
bars.setGlobalActionHandler(
ITextEditorActionDefinitionIds.TOGGLE_SHOW_SELECTED_ELEMENT_ONLY,
! this.showSelectedElementOnlyAction);
bars.setGlobalActionHandler(
ICssEditorActionDefinitionIds.COMMENT,
--- 94,107 ----
}
! contentAssistAction.setAction(
getAction(editor, ICssEditorActionConstants.CONTENT_ASSIST));
! showSelectedElementOnlyAction.setEditor(editor);
! showSelectedElementOnlyAction.update();
IActionBars bars = getActionBars();
bars.setGlobalActionHandler(
ITextEditorActionDefinitionIds.TOGGLE_SHOW_SELECTED_ELEMENT_ONLY,
! showSelectedElementOnlyAction);
bars.setGlobalActionHandler(
ICssEditorActionDefinitionIds.COMMENT,
|
|
From: <ce...@us...> - 2004-01-13 14:13:56
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/editor
In directory sc8-pr-cvs1:/tmp/cvs-serv15199/src/net/sourceforge/csseditor/internal/editor
Modified Files:
CssEditor.java
Log Message:
Cleanup: removed unnecessary 'this' qualifiers, removed 'f' prefix of fields, etc
Index: CssEditor.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/editor/CssEditor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CssEditor.java 13 Jan 2004 14:08:17 -0000 1.3
--- CssEditor.java 13 Jan 2004 14:13:53 -0000 1.4
***************
*** 106,110 ****
* The associated outline page.
*/
! private CssOutlinePage fOutlinePage;
/**
--- 106,110 ----
* The associated outline page.
*/
! private CssOutlinePage outlinePage;
/**
***************
*** 112,116 ****
* selection and highlight range.
*/
! private ISelectionChangedListener fOutlineSelectionChangedListener;
// Constructors ------------------------------------------------------------
--- 112,116 ----
* selection and highlight range.
*/
! private ISelectionChangedListener outlineSelectionChangedListener;
// Constructors ------------------------------------------------------------
***************
*** 128,132 ****
/*
! * @see org.eclipse.ui.texteditor.AbstractTextEditor#affectsTextPresentation(org.eclipse.jface.util.PropertyChangeEvent)
*/
protected boolean affectsTextPresentation(PropertyChangeEvent event) {
--- 128,132 ----
/*
! * @see org.eclipse.ui.texteditor.AbstractTextEditor#affectsTextPresentation(PropertyChangeEvent)
*/
protected boolean affectsTextPresentation(PropertyChangeEvent event) {
***************
*** 183,187 ****
/*
! * @see org.eclipse.ui.texteditor.ExtendedTextEditor#configureSourceViewerDecorationSupport(org.eclipse.ui.texteditor.SourceViewerDecorationSupport)
*/
protected void configureSourceViewerDecorationSupport(
--- 183,187 ----
/*
! * @see org.eclipse.ui.texteditor.ExtendedTextEditor#configureSourceViewerDecorationSupport(SourceViewerDecorationSupport)
*/
protected void configureSourceViewerDecorationSupport(
***************
*** 201,206 ****
*/
protected void editorSaved() {
! if (this.fOutlinePage != null) {
! this.fOutlinePage.update();
}
}
--- 201,206 ----
*/
protected void editorSaved() {
! if (outlinePage != null) {
! outlinePage.update();
}
}
***************
*** 212,223 ****
if (IContentOutlinePage.class.equals(adapter)) {
! if (this.fOutlinePage == null) {
! this.fOutlinePage = new CssOutlinePage(this);
! this.fOutlineSelectionChangedListener =
new OutlineSelectionChangedListener();
! this.fOutlinePage.addSelectionChangedListener(
! this.fOutlineSelectionChangedListener);
}
! return this.fOutlinePage;
}
--- 212,223 ----
if (IContentOutlinePage.class.equals(adapter)) {
! if (outlinePage == null) {
! outlinePage = new CssOutlinePage(this);
! outlineSelectionChangedListener =
new OutlineSelectionChangedListener();
! outlinePage.addSelectionChangedListener(
! outlineSelectionChangedListener);
}
! return outlinePage;
}
***************
*** 260,264 ****
}
StyledText styledText = sourceViewer.getTextWidget();
! if (styledText == null) {
return null;
}
--- 260,264 ----
}
StyledText styledText = sourceViewer.getTextWidget();
! if ((styledText == null) || styledText.isDisposed()) {
return null;
}
***************
*** 276,283 ****
*/
public void outlinePageClosed() {
! if (this.fOutlinePage != null) {
! this.fOutlinePage.removeSelectionChangedListener(
! this.fOutlineSelectionChangedListener);
! this.fOutlinePage = null;
resetHighlightRange();
}
--- 276,283 ----
*/
public void outlinePageClosed() {
! if (outlinePage != null) {
! outlinePage.removeSelectionChangedListener(
! outlineSelectionChangedListener);
! outlinePage = null;
resetHighlightRange();
}
***************
*** 307,316 ****
*/
public void synchronizeOutlinePage(ISourceReference element) {
! if (this.fOutlinePage != null) {
! this.fOutlinePage.removeSelectionChangedListener(
! this.fOutlineSelectionChangedListener);
! this.fOutlinePage.select(element);
! this.fOutlinePage.addSelectionChangedListener(
! this.fOutlineSelectionChangedListener);
}
}
--- 307,316 ----
*/
public void synchronizeOutlinePage(ISourceReference element) {
! if (outlinePage != null) {
! outlinePage.removeSelectionChangedListener(
! outlineSelectionChangedListener);
! outlinePage.select(element);
! outlinePage.addSelectionChangedListener(
! outlineSelectionChangedListener);
}
}
|
|
From: <ce...@us...> - 2004-01-13 14:08:20
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/editor
In directory sc8-pr-cvs1:/tmp/cvs-serv14030/src/net/sourceforge/csseditor/internal/editor
Modified Files:
CssEditor.java
Log Message:
Avoid a potential NPE
Index: CssEditor.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/editor/CssEditor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CssEditor.java 27 Dec 2003 18:46:55 -0000 1.2
--- CssEditor.java 13 Jan 2004 14:08:17 -0000 1.3
***************
*** 328,332 ****
private IRule getRuleAt(int offset) {
! return getStyleSheet().getRuleAt(offset);
}
--- 328,336 ----
private IRule getRuleAt(int offset) {
! IStyleSheet styleSheet = getStyleSheet();
! if (styleSheet == null) {
! return null;
! }
! return styleSheet.getRuleAt(offset);
}
|
|
From: <ce...@us...> - 2004-01-13 13:54:09
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/model
In directory sc8-pr-cvs1:/tmp/cvs-serv11308/src/net/sourceforge/csseditor/internal/model
Modified Files:
SourceReference.java StyleSheet.java StyleRule.java
AtRule.java PropertyInfo.java Declaration.java
AbstractRule.java
Log Message:
REmove unnecessary 'this' qualifiers
Index: SourceReference.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/model/SourceReference.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SourceReference.java 27 Dec 2003 18:46:55 -0000 1.2
--- SourceReference.java 13 Jan 2004 13:54:05 -0000 1.3
***************
*** 56,61 ****
public String getSource() {
try {
! return this.document.get(this.sourceRegion.getOffset(),
! this.sourceRegion.getLength());
} catch (BadLocationException e) {
throw new IllegalStateException(
--- 56,61 ----
public String getSource() {
try {
! return document.get(sourceRegion.getOffset(),
! sourceRegion.getLength());
} catch (BadLocationException e) {
throw new IllegalStateException(
***************
*** 68,72 ****
*/
public IRegion getSourceRegion() {
! return this.sourceRegion;
}
--- 68,72 ----
*/
public IRegion getSourceRegion() {
! return sourceRegion;
}
***************
*** 74,78 ****
public final void setSourceRegion(IRegion region) {
! this.sourceRegion = new Region(region.getOffset(), region.getLength());
}
--- 74,78 ----
public final void setSourceRegion(IRegion region) {
! sourceRegion = new Region(region.getOffset(), region.getLength());
}
***************
*** 80,84 ****
protected final IDocument getDocument() {
! return this.document;
}
--- 80,84 ----
protected final IDocument getDocument() {
! return document;
}
Index: StyleSheet.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/model/StyleSheet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** StyleSheet.java 27 Dec 2003 18:46:55 -0000 1.2
--- StyleSheet.java 13 Jan 2004 13:54:05 -0000 1.3
***************
*** 53,57 ****
private Object dirtyLock = new Object();
-
private boolean dirty = true;
--- 53,56 ----
***************
*** 80,84 ****
*/
public IRule[] getRules() {
! return (IRule[]) this.rules.toArray(new IRule[this.rules.size()]);
}
--- 79,83 ----
*/
public IRule[] getRules() {
! return (IRule[]) rules.toArray(new IRule[rules.size()]);
}
***************
*** 89,106 ****
throws LexicalErrorException, SyntaxErrorException {
! synchronized (this.dirtyLock) {
! if (!this.dirty) {
return;
}
! this.dirty = false;
}
synchronized (this) {
! this.rules.clear();
ICssParser parser = new DefaultCssParser();
parser.setProblemCollector(problemCollector);
parser.setSource(getDocument());
! IRule[] rules = parser.parseRules(this);
! this.rules.addAll(Arrays.asList(rules));
fireChangeEvent();
}
--- 88,104 ----
throws LexicalErrorException, SyntaxErrorException {
! synchronized (dirtyLock) {
! if (!dirty) {
return;
}
! dirty = false;
}
synchronized (this) {
! rules.clear();
ICssParser parser = new DefaultCssParser();
parser.setProblemCollector(problemCollector);
parser.setSource(getDocument());
! rules.addAll(Arrays.asList(parser.parseRules(this)));
fireChangeEvent();
}
***************
*** 111,115 ****
*/
public void addListener(IStyleSheetListener listener) {
! this.listeners.add(listener);
}
--- 109,113 ----
*/
public void addListener(IStyleSheetListener listener) {
! listeners.add(listener);
}
***************
*** 118,122 ****
*/
public void removeListener(IStyleSheetListener listener) {
! this.listeners.remove(listener);
}
--- 116,120 ----
*/
public void removeListener(IStyleSheetListener listener) {
! listeners.remove(listener);
}
***************
*** 134,139 ****
*/
public void documentChanged(DocumentEvent event) {
! synchronized (this.dirtyLock) {
! this.dirty = true;
}
}
--- 132,137 ----
*/
public void documentChanged(DocumentEvent event) {
! synchronized (dirtyLock) {
! dirty = true;
}
}
***************
*** 147,151 ****
*/
public void addRule(IRule rule) {
! this.rules.add(rule);
}
--- 145,149 ----
*/
public void addRule(IRule rule) {
! rules.add(rule);
}
***************
*** 154,158 ****
private void fireChangeEvent() {
StyleSheetChangeEvent event = new StyleSheetChangeEvent(this);
! for (Iterator i = this.listeners.iterator(); i.hasNext(); ) {
IStyleSheetListener listener = (IStyleSheetListener) i.next();
listener.styleSheetChanged(event);
--- 152,156 ----
private void fireChangeEvent() {
StyleSheetChangeEvent event = new StyleSheetChangeEvent(this);
! for (Iterator i = listeners.iterator(); i.hasNext(); ) {
IStyleSheetListener listener = (IStyleSheetListener) i.next();
listener.styleSheetChanged(event);
Index: StyleRule.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/model/StyleRule.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** StyleRule.java 27 Dec 2003 18:46:55 -0000 1.2
--- StyleRule.java 13 Jan 2004 13:54:05 -0000 1.3
***************
*** 63,67 ****
*/
public final ISourceReference getSelector() {
! return this.selector;
}
--- 63,67 ----
*/
public final ISourceReference getSelector() {
! return selector;
}
Index: AtRule.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/model/AtRule.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AtRule.java 27 Dec 2003 18:46:55 -0000 1.2
--- AtRule.java 13 Jan 2004 13:54:05 -0000 1.3
***************
*** 61,65 ****
*/
public final ISourceReference getName() {
! return this.name;
}
--- 61,65 ----
*/
public final ISourceReference getName() {
! return name;
}
***************
*** 68,72 ****
*/
public final ISourceReference getValue() {
! return this.value;
}
--- 68,72 ----
*/
public final ISourceReference getValue() {
! return value;
}
Index: PropertyInfo.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/model/PropertyInfo.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** PropertyInfo.java 14 Dec 2003 21:59:39 -0000 1.1.1.1
--- PropertyInfo.java 13 Jan 2004 13:54:05 -0000 1.2
***************
*** 76,80 ****
*/
public String getName() {
! return this.name;
}
--- 76,80 ----
*/
public String getName() {
! return name;
}
***************
*** 83,87 ****
*/
public String getCategory() {
! return this.category;
}
--- 83,87 ----
*/
public String getCategory() {
! return category;
}
***************
*** 90,94 ****
*/
public String getDescription() {
! return this.description;
}
--- 90,94 ----
*/
public String getDescription() {
! return description;
}
***************
*** 97,101 ****
*/
public boolean isShorthand() {
! return this.shorthand;
}
--- 97,101 ----
*/
public boolean isShorthand() {
! return shorthand;
}
Index: Declaration.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/model/Declaration.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Declaration.java 27 Dec 2003 18:46:55 -0000 1.2
--- Declaration.java 13 Jan 2004 13:54:05 -0000 1.3
***************
*** 68,72 ****
*/
public final IRule getRule() {
! return this.rule;
}
--- 68,72 ----
*/
public final IRule getRule() {
! return rule;
}
***************
*** 75,79 ****
*/
public final ISourceReference getProperty() {
! return this.property;
}
--- 75,79 ----
*/
public final ISourceReference getProperty() {
! return property;
}
***************
*** 82,86 ****
*/
public final ISourceReference getValue() {
! return this.value;
}
--- 82,86 ----
*/
public final ISourceReference getValue() {
! return value;
}
***************
*** 89,93 ****
*/
public final ISourceReference getPriority() {
! return this.priority;
}
--- 89,93 ----
*/
public final ISourceReference getPriority() {
! return priority;
}
***************
*** 97,104 ****
* Sets the property.
*
! * @param name The property to set
*/
! public final void setProperty(ISourceReference name) {
! this.property = name;
}
--- 97,104 ----
* Sets the property.
*
! * @param property The property to set
*/
! public final void setProperty(ISourceReference property) {
! this.property = property;
}
Index: AbstractRule.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/model/AbstractRule.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AbstractRule.java 27 Dec 2003 18:46:55 -0000 1.2
--- AbstractRule.java 13 Jan 2004 13:54:05 -0000 1.3
***************
*** 79,83 ****
*/
public final IStyleSheet getStyleSheet() {
! return this.styleSheet;
}
--- 79,83 ----
*/
public final IStyleSheet getStyleSheet() {
! return styleSheet;
}
***************
*** 86,90 ****
*/
public final IRule getParent() {
! return this.parent;
}
--- 86,90 ----
*/
public final IRule getParent() {
! return parent;
}
***************
*** 93,98 ****
*/
public final IRule[] getChildren() {
! return (IRule[]) this.children.toArray(
! new IRule[this.children.size()]);
}
--- 93,97 ----
*/
public final IRule[] getChildren() {
! return (IRule[]) children.toArray(new IRule[children.size()]);
}
***************
*** 101,105 ****
*/
public final IDeclaration getDeclarationAt(int offset) {
! for (Iterator i = this.declarations.iterator(); i.hasNext(); ) {
IDeclaration declaration = (IDeclaration) i.next();
IRegion region = declaration.getSourceRegion();
--- 100,104 ----
*/
public final IDeclaration getDeclarationAt(int offset) {
! for (Iterator i = declarations.iterator(); i.hasNext(); ) {
IDeclaration declaration = (IDeclaration) i.next();
IRegion region = declaration.getSourceRegion();
***************
*** 116,121 ****
*/
public final IDeclaration[] getDeclarations() {
! return (IDeclaration[]) this.declarations.toArray(
! new IDeclaration[this.declarations.size()]);
}
--- 115,120 ----
*/
public final IDeclaration[] getDeclarations() {
! return (IDeclaration[]) declarations.toArray(
! new IDeclaration[declarations.size()]);
}
***************
*** 127,134 ****
public Object getAdapter(Class adapter) {
if (adapter == IPropertySource.class) {
! if (this.propertySource == null) {
! this.propertySource = new CssRulePropertySource(this);
}
! return this.propertySource;
}
return null;
--- 126,133 ----
public Object getAdapter(Class adapter) {
if (adapter == IPropertySource.class) {
! if (propertySource == null) {
! propertySource = new CssRulePropertySource(this);
}
! return propertySource;
}
return null;
***************
*** 138,146 ****
public final void addChild(IRule rule) {
! this.children.add(rule);
}
public final void addDeclaration(IDeclaration declaration) {
! this.declarations.add(declaration);
}
--- 137,145 ----
public final void addChild(IRule rule) {
! children.add(rule);
}
public final void addDeclaration(IDeclaration declaration) {
! declarations.add(declaration);
}
|
|
From: <ce...@us...> - 2004-01-13 12:16:28
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor
In directory sc8-pr-cvs1:/tmp/cvs-serv23367
Modified Files:
plugin.xml
Log Message:
Getting ready for bugfix release 0.0.2
Index: plugin.xml
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/plugin.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** plugin.xml 27 Dec 2003 14:35:53 -0000 1.3
--- plugin.xml 13 Jan 2004 12:16:25 -0000 1.4
***************
*** 4,8 ****
id="net.sourceforge.csseditor"
name="%pluginName"
! version="0.0.1"
provider-name="%providerName"
class="net.sourceforge.csseditor.CssEditorPlugin">
--- 4,8 ----
id="net.sourceforge.csseditor"
name="%pluginName"
! version="0.0.2"
provider-name="%providerName"
class="net.sourceforge.csseditor.CssEditorPlugin">
***************
*** 32,39 ****
<editor
name="%editorName"
- extensions="css"
icon="icons/style_sheet_obj.gif"
! class="net.sourceforge.csseditor.internal.editor.CssEditor"
contributorClass="net.sourceforge.csseditor.internal.editor.CssEditorActionContributor"
id="net.sourceforge.csseditor.editor">
</editor>
--- 32,39 ----
<editor
name="%editorName"
icon="icons/style_sheet_obj.gif"
! extensions="css"
contributorClass="net.sourceforge.csseditor.internal.editor.CssEditorActionContributor"
+ class="net.sourceforge.csseditor.internal.editor.CssEditor"
id="net.sourceforge.csseditor.editor">
</editor>
***************
*** 93,98 ****
objectClass="org.eclipse.core.resources.IResource"
name="%propertyPage.name"
- class="net.sourceforge.csseditor.internal.properties.CssPropertyPage"
nameFilter="*.css"
id="net.sourceforge.csseditor.propertyPage">
</page>
--- 93,98 ----
objectClass="org.eclipse.core.resources.IResource"
name="%propertyPage.name"
nameFilter="*.css"
+ class="net.sourceforge.csseditor.internal.properties.CssPropertyPage"
id="net.sourceforge.csseditor.propertyPage">
</page>
***************
*** 107,112 ****
<command
name="%commentAction.label"
- category="org.eclipse.jdt.ui.category.source"
description="%commentAction.description"
id="net.sourceforge.csseditor.commentAction">
</command>
--- 107,112 ----
<command
name="%commentAction.label"
description="%commentAction.description"
+ category="org.eclipse.jdt.ui.category.source"
id="net.sourceforge.csseditor.commentAction">
</command>
***************
*** 130,135 ****
<command
name="%uncommentAction.label"
- category="org.eclipse.jdt.ui.category.source"
description="%uncommentAction.description"
id="net.sourceforge.csseditor.uncommentAction">
</command>
--- 130,135 ----
<command
name="%uncommentAction.label"
description="%uncommentAction.description"
+ category="org.eclipse.jdt.ui.category.source"
id="net.sourceforge.csseditor.uncommentAction">
</command>
***************
*** 167,178 ****
<action
label="%shiftLeftAction.label"
- menubarPath="net.sourceforge.csseditor.sourceMenu/editGroup"
retarget="true"
id="org.eclipse.ui.edit.text.shiftLeft">
</action>
<action
label="%shiftRightAction.label"
- menubarPath="net.sourceforge.csseditor.sourceMenu/editGroup"
retarget="true"
id="org.eclipse.ui.edit.text.shiftRight">
</action>
--- 167,178 ----
<action
label="%shiftLeftAction.label"
retarget="true"
+ menubarPath="net.sourceforge.csseditor.sourceMenu/editGroup"
id="org.eclipse.ui.edit.text.shiftLeft">
</action>
<action
label="%shiftRightAction.label"
retarget="true"
+ menubarPath="net.sourceforge.csseditor.sourceMenu/editGroup"
id="org.eclipse.ui.edit.text.shiftRight">
</action>
***************
*** 180,185 ****
definitionId="net.sourceforge.csseditor.uncommentAction"
label="%uncommentAction.label"
- menubarPath="net.sourceforge.csseditor.sourceMenu/editGroup"
retarget="true"
id="net.sourceforge.csseditor.uncommentAction">
</action>
--- 180,185 ----
definitionId="net.sourceforge.csseditor.uncommentAction"
label="%uncommentAction.label"
retarget="true"
+ menubarPath="net.sourceforge.csseditor.sourceMenu/editGroup"
id="net.sourceforge.csseditor.uncommentAction">
</action>
***************
*** 187,192 ****
definitionId="net.sourceforge.csseditor.commentAction"
label="%commentAction.label"
- menubarPath="net.sourceforge.csseditor.sourceMenu/editGroup"
retarget="true"
id="net.sourceforge.csseditor.commentAction">
</action>
--- 187,192 ----
definitionId="net.sourceforge.csseditor.commentAction"
label="%commentAction.label"
retarget="true"
+ menubarPath="net.sourceforge.csseditor.sourceMenu/editGroup"
id="net.sourceforge.csseditor.commentAction">
</action>
|
|
From: <ce...@us...> - 2004-01-13 12:15:01
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor
In directory sc8-pr-cvs1:/tmp/cvs-serv23105
Modified Files:
build.xml
Log Message:
Fix build to include resources in the plugin JAR
Index: build.xml
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/build.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** build.xml 12 Jan 2004 23:24:55 -0000 1.1
--- build.xml 13 Jan 2004 12:14:56 -0000 1.2
***************
*** 51,55 ****
<jar destfile="${build.dir}/csseditor.jar">
<fileset dir="${build.classes.dir}" includes="**/*.class"/>
! <fileset dir="${src.dir}" includes="**/*.properties"/>
</jar>
</target>
--- 51,55 ----
<jar destfile="${build.dir}/csseditor.jar">
<fileset dir="${build.classes.dir}" includes="**/*.class"/>
! <fileset dir="${src.dir}" excludes="**/*.java, **/package.html"/>
</jar>
</target>
***************
*** 72,76 ****
<target name="dist" depends="jar, srczip" description="Assemble distribution">
<mkdir dir="${dist.dir}"/>
! <property name="plugin.prefix" value="${plugin.id}_${plugin.version}"/>
<zip destfile="${dist.dir}/${plugin.id}_${plugin.version}.zip">
<zipfileset prefix="${plugin.prefix}" dir="${basedir}"
--- 72,77 ----
<target name="dist" depends="jar, srczip" description="Assemble distribution">
<mkdir dir="${dist.dir}"/>
! <property name="plugin.prefix"
! value="plugins/${plugin.id}_${plugin.version}"/>
<zip destfile="${dist.dir}/${plugin.id}_${plugin.version}.zip">
<zipfileset prefix="${plugin.prefix}" dir="${basedir}"
|
|
From: <ce...@us...> - 2004-01-13 11:59:13
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor In directory sc8-pr-cvs1:/tmp/cvs-serv20584 Modified Files: .cvsignore Log Message: doc.zip is not built currently Index: .cvsignore =================================================================== RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/.cvsignore,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** .cvsignore 14 Dec 2003 21:59:31 -0000 1.1.1.1 --- .cvsignore 13 Jan 2004 11:59:09 -0000 1.2 *************** *** 2,4 **** build dist - doc.zip --- 2,3 ---- |
|
From: <ce...@us...> - 2004-01-13 11:46:17
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/preferences
In directory sc8-pr-cvs1:/tmp/cvs-serv18758/src/net/sourceforge/csseditor/internal/preferences
Modified Files:
CssEditorTypingConfigurationBlock.java
Log Message:
Disable preferece checkboxes that currently don't have any effect
Index: CssEditorTypingConfigurationBlock.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/preferences/CssEditorTypingConfigurationBlock.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CssEditorTypingConfigurationBlock.java 27 Dec 2003 18:46:56 -0000 1.2
--- CssEditorTypingConfigurationBlock.java 13 Jan 2004 11:46:14 -0000 1.3
***************
*** 47,58 ****
getString("insertSpaceForTabs"), //$NON-NLS-1$
CssEditorPreferences.EDITOR_SPACES_FOR_TABS, 1);
- addBooleanField(composite, getString("closeStrings"), //$NON-NLS-1$
- CssEditorPreferences.EDITOR_CLOSE_STRINGS, 1);
- addBooleanField(composite,
- getString("closeBracketsAndParens"), //$NON-NLS-1$
- CssEditorPreferences.EDITOR_CLOSE_BRACKETS_AND_PARENS, 1);
- addBooleanField(composite, getString("closeBraces"), //$NON-NLS-1$
- CssEditorPreferences.EDITOR_CLOSE_BRACES, 1);
-
initialize();
--- 47,50 ----
|
|
From: <ce...@us...> - 2004-01-12 23:24:58
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor
In directory sc8-pr-cvs1:/tmp/cvs-serv22879
Added Files:
build.xml
Log Message:
Add experimental Ant build
--- NEW FILE: build.xml ---
<?xml version="1.0"?>
<project name="net.sourceforge.csseditor" default="dist" basedir=".">
<description>CSS Editor for Eclipse</description>
<property file="build.properties"/>
<property name="src.dir" location="src"/>
<property name="build.dir" location="build"/>
<property name="build.classes.dir" location="${build.dir}/classes"/>
<property name="build.docs.dir" location="${build.dir}/docs"/>
<property name="dist.dir" location="dist"/>
<property name="eclipse.home" location="../.."/>
<target name="init">
<xmlproperty file="plugin.xml" collapseattributes="yes"/>
<condition property="os" value="win32">
<os family="windows"/>
</condition>
<condition property="os" value="carbon">
<os family="mac"/>
</condition>
<!-- TODO: add other supported OSes here -->
<path id="classpath">
<pathelement location="${eclipse.home}/plugins/org.eclipse.compare_3.0.0/compare.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.core.resources_3.0.0/resources.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.core.runtime_3.0.0/runtime.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.jface_3.0.0/jface.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.jface.text_3.0.0/jfacetext.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.osgi_3.0.0/osgi.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.ui_3.0.0/ui.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.ui.ide_3.0.0/ide.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.ui.views_3.0.0/views.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.ui.workbench_3.0.0/workbench.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.ui.workbench.texteditor_3.0.0/texteditor.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.ui.editors_3.0.0/editors.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.swt.${os}_3.0.0/ws/${os}/swt.jar"/>
<pathelement location="${eclipse.home}/plugins/org.eclipse.text_3.0.0/text.jar"/>
</path>
</target>
<target name="compile" depends="init" description="Compile Java code">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${build.classes.dir}"
classpathref="classpath"/>
</target>
<target name="jar" depends="compile" description="Build plugin JAR">
<jar destfile="${build.dir}/csseditor.jar">
<fileset dir="${build.classes.dir}" includes="**/*.class"/>
<fileset dir="${src.dir}" includes="**/*.properties"/>
</jar>
</target>
<target name="srczip" depends="init" description="Build source ZIP">
<mkdir dir="${build.dir}"/>
<zip destfile="${build.dir}/csseditorsrc.zip">
<fileset dir="${src.dir}" includes="**/*.java"/>
</zip>
</target>
<target name="javadoc" depends="init" description="Generate API documentation">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.docs.dir}"/>
<javadoc packagenames="net.sourceforge.csseditor.*"
sourcepath="${src.dir}" destdir="${build.docs.dir}"
classpathref="classpath"/>
</target>
<target name="dist" depends="jar, srczip" description="Assemble distribution">
<mkdir dir="${dist.dir}"/>
<property name="plugin.prefix" value="${plugin.id}_${plugin.version}"/>
<zip destfile="${dist.dir}/${plugin.id}_${plugin.version}.zip">
<zipfileset prefix="${plugin.prefix}" dir="${basedir}"
includes="${bin.includes}" excludes="${bin.excludes}"/>
<zipfileset prefix="${plugin.prefix}" dir="${build.dir}"
includes="csseditor.jar, csseditorsrc.zip"/>
</zip>
</target>
<target name="clean" description="Remove generated files">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
</project>
|
|
From: <ce...@us...> - 2004-01-12 18:14:45
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/profiles
In directory sc8-pr-cvs1:/tmp/cvs-serv6047/src/net/sourceforge/csseditor/profiles
Modified Files:
Css2Profile.java
Log Message:
Add 'text-shadow' property
Index: Css2Profile.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/profiles/Css2Profile.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Css2Profile.java 14 Dec 2003 21:59:57 -0000 1.1.1.1
--- Css2Profile.java 12 Jan 2004 18:14:41 -0000 1.2
***************
*** 118,121 ****
--- 118,122 ----
addProperty("speak-punctuation", CATEGORY_AURAL); //$NON-NLS-1$
addProperty("speech-rate", CATEGORY_AURAL); //$NON-NLS-1$
+ addProperty("text-shadow", CATEGORY_TEXT); //$NON-NLS-1$
addProperty("stress", CATEGORY_AURAL); //$NON-NLS-1$
addProperty("top", CATEGORY_VISUAL_FORMATTING); //$NON-NLS-1$
|
|
From: <ce...@us...> - 2004-01-12 18:04:43
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/text
In directory sc8-pr-cvs1:/tmp/cvs-serv4058/src/net/sourceforge/csseditor/internal/text
Modified Files:
CssContentAssistProcessor.java
Log Message:
Fix some of the javadoc comments
Index: CssContentAssistProcessor.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/text/CssContentAssistProcessor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CssContentAssistProcessor.java 12 Jan 2004 17:37:13 -0000 1.3
--- CssContentAssistProcessor.java 12 Jan 2004 18:04:39 -0000 1.4
***************
*** 345,349 ****
* requested
* @param prefix the string immediately before the offset
! * @return
*/
private List proposeProperties(IDocument document, int offset,
--- 345,349 ----
* requested
* @param prefix the string immediately before the offset
! * @return the list of {@link ICompletionProposal}s
*/
private List proposeProperties(IDocument document, int offset,
***************
*** 377,387 ****
}
- /**
- *
- * @param document
- * @param offset
- * @param prefix
- * @return
- */
private List proposePseudoClasses(IDocument document, int offset,
String prefix) throws BadLocationException {
--- 377,380 ----
|
|
From: <ce...@us...> - 2004-01-12 17:50:25
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor/icons In directory sc8-pr-cvs1:/tmp/cvs-serv758/icons Modified Files: at_rule_obj.gif class_obj.gif property_obj.gif style_rule_obj.gif important_obj.gif style_sheet_obj.gif shorthand_obj.gif int_obj.gif pseudo_class_obj.gif Log Message: GIFs need to be binary, really Index: at_rule_obj.gif =================================================================== RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/icons/at_rule_obj.gif,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Index: class_obj.gif =================================================================== RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/icons/class_obj.gif,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Index: property_obj.gif =================================================================== RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/icons/property_obj.gif,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Index: style_rule_obj.gif =================================================================== RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/icons/style_rule_obj.gif,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Index: important_obj.gif =================================================================== RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/icons/important_obj.gif,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Index: style_sheet_obj.gif =================================================================== RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/icons/style_sheet_obj.gif,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Index: shorthand_obj.gif =================================================================== RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/icons/shorthand_obj.gif,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Index: int_obj.gif =================================================================== RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/icons/int_obj.gif,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Index: pseudo_class_obj.gif =================================================================== RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/icons/pseudo_class_obj.gif,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 |
|
From: <ce...@us...> - 2004-01-12 17:37:19
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/text
In directory sc8-pr-cvs1:/tmp/cvs-serv30122/src/net/sourceforge/csseditor/internal/text
Modified Files:
CssContentAssistProcessor.java
Log Message:
Fix für bug #875410, and a test case (albeit a rather bad one)
Index: CssContentAssistProcessor.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor/src/net/sourceforge/csseditor/internal/text/CssContentAssistProcessor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CssContentAssistProcessor.java 12 Jan 2004 13:56:08 -0000 1.2
--- CssContentAssistProcessor.java 12 Jan 2004 17:37:13 -0000 1.3
***************
*** 268,271 ****
--- 268,272 ----
}
}
+ return true;
} else {
IRegion region = rule.getSourceRegion();
|
|
From: <ce...@us...> - 2004-01-12 17:37:12
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor.tests/src/net/sourceforge/csseditor/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv30092/src/net/sourceforge/csseditor/tests
Modified Files:
UITests.java
Log Message:
Fix für bug #875410, and a test case (albeit a rather bad one)
Index: UITests.java
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor.tests/src/net/sourceforge/csseditor/tests/UITests.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** UITests.java 28 Dec 2003 19:47:23 -0000 1.3
--- UITests.java 12 Jan 2004 17:37:09 -0000 1.4
***************
*** 18,21 ****
--- 18,22 ----
import net.sourceforge.csseditor.tests.internal.text.CssCodeScannerTest;
+ import net.sourceforge.csseditor.tests.internal.text.CssContentAssistProcessorTest;
public class UITests {
***************
*** 25,28 ****
--- 26,30 ----
//$JUnit-BEGIN$
suite.addTestSuite(CssCodeScannerTest.class);
+ suite.addTestSuite(CssContentAssistProcessorTest.class);
//$JUnit-END$
return suite;
|
|
From: <ce...@us...> - 2004-01-12 17:37:12
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor.tests/src/net/sourceforge/csseditor/tests/internal/text In directory sc8-pr-cvs1:/tmp/cvs-serv30092/src/net/sourceforge/csseditor/tests/internal/text Added Files: CssContentAssistProcessorTest.java Log Message: Fix für bug #875410, and a test case (albeit a rather bad one) --- NEW FILE: CssContentAssistProcessorTest.java --- /* * Copyright (c) 2003 Christopher Lenz 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: * Christopher Lenz - initial API and implementation * * $Id: CssContentAssistProcessorTest.java,v 1.1 2004/01/12 17:37:09 cell Exp $ */ package net.sourceforge.csseditor.tests.internal.text; import java.util.Arrays; import net.sourceforge.csseditor.IProfile; import net.sourceforge.csseditor.internal.model.PropertyInfo; import net.sourceforge.csseditor.internal.text.CssContentAssistProcessor; import net.sourceforge.csseditor.tests.TextEditorTestCase; import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.contentassist.ICompletionProposal; import org.eclipse.jface.text.contentassist.IContentAssistProcessor; import org.eclipse.ui.texteditor.ITextEditor; import com.mockobjects.dynamic.C; import com.mockobjects.dynamic.Mock; /** * Tests for the <code>CssContentAssistProcessor</code> class, which implements * the computation of content assist proposals. */ public class CssContentAssistProcessorTest extends TextEditorTestCase { // Instance Variables ------------------------------------------------------ /** * A mock {@link IProfile}. */ private Mock mockProfile; /** * A mock {@link ITextViewer}. */ private Mock mockTextViewer; // Constructors ------------------------------------------------------------ /** * Default contructor. */ public CssContentAssistProcessorTest() { super("test.css"); } // TestCase Implementation ------------------------------------------------- /* * @see junit.framework.TestCase#setUp() */ protected void setUp() throws CoreException { super.setUp(); mockProfile = new Mock(IProfile.class); mockTextViewer = new Mock(ITextViewer.class); } /* * @see junit.framework.TestCase#tearDown() */ protected void tearDown() throws CoreException { super.tearDown(); mockProfile.verify(); mockTextViewer.verify(); } // Test Methods ------------------------------------------------------------ /** * Verifies that the content assist processor proposes the complete property * when triggered over a property where the last latter is missing, and when * there is only one matching property in the profile. */ public void testProposeSingleProperty() throws CoreException { ITextEditor editor = setUpEditor("sel { pro: val }"); mockTextViewer.matchAndReturn("getDocument", getDocument()); mockProfile.expectAndReturn("getProperties", Arrays.asList( new Object[] { "prop" })); mockProfile.expectAndReturn("getPropertyInfo", C.args(C.eq("prop")), new PropertyInfo("prop", "")); // TODO: This shouldn't be necessary, the content assist processor // should actually block until the model is synced with the source (aka // reconciled), but currently it'll return an empty list of proposals // (at best) try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } IContentAssistProcessor processor = new CssContentAssistProcessor( null, (IProfile) mockProfile.proxy(), editor); ICompletionProposal[] proposals = processor.computeCompletionProposals( (ITextViewer) mockTextViewer.proxy(), 9); assertNotNull(proposals); assertEquals(1, proposals.length); assertEquals("prop", proposals[0].getDisplayString()); } } |
|
From: <ce...@us...> - 2004-01-12 17:27:54
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor.tests
In directory sc8-pr-cvs1:/tmp/cvs-serv27502
Modified Files:
.project plugin.xml .classpath
Log Message:
Add a generic TextEditorTestCase for testing stuff that relies on an actual text editor being present
Index: .project
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor.tests/.project,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** .project 27 Dec 2003 16:38:23 -0000 1.1
--- .project 12 Jan 2004 17:27:50 -0000 1.2
***************
*** 5,15 ****
<projects>
<project>net.sourceforge.csseditor</project>
! <project>org.eclipse.core.runtime.compatibility</project>
<project>org.eclipse.jface</project>
<project>org.eclipse.jface.text</project>
<project>org.eclipse.swt</project>
<project>org.eclipse.text</project>
<project>org.eclipse.ui</project>
<project>org.eclipse.ui.workbench.texteditor</project>
</projects>
<buildSpec>
--- 5,21 ----
<projects>
<project>net.sourceforge.csseditor</project>
! <project>org.eclipse.core.resources</project>
! <project>org.eclipse.core.runtime</project>
<project>org.eclipse.jface</project>
<project>org.eclipse.jface.text</project>
+ <project>org.eclipse.osgi</project>
<project>org.eclipse.swt</project>
<project>org.eclipse.text</project>
<project>org.eclipse.ui</project>
+ <project>org.eclipse.ui.editors</project>
+ <project>org.eclipse.ui.ide</project>
+ <project>org.eclipse.ui.views</project>
<project>org.eclipse.ui.workbench.texteditor</project>
+ <project>org.junit</project>
</projects>
<buildSpec>
Index: plugin.xml
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor.tests/plugin.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** plugin.xml 28 Dec 2003 19:51:01 -0000 1.3
--- plugin.xml 12 Jan 2004 17:27:50 -0000 1.4
***************
*** 13,17 ****
</runtime>
<requires>
- org.eclipse.core.runtime.compatibility
<import plugin="org.eclipse.ui.ide"/>
<import plugin="org.eclipse.ui.views"/>
--- 13,16 ----
***************
*** 25,29 ****
--- 24,32 ----
<import plugin="org.eclipse.ui.workbench.texteditor"/>
<import plugin="org.junit"/>
+ <import plugin="org.eclipse.core.resources"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.eclipse.osgi"/>
</requires>
+
</plugin>
Index: .classpath
===================================================================
RCS file: /cvsroot/csseditor/net.sourceforge.csseditor.tests/.classpath,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** .classpath 28 Dec 2003 17:33:26 -0000 1.2
--- .classpath 12 Jan 2004 17:27:50 -0000 1.3
***************
*** 3,6 ****
--- 3,9 ----
<classpathentry kind="src" path="src"/>
<classpathentry sourcepath="lib/mockobjectssrc.zip" kind="lib" path="lib/mockobjects.jar"/>
+ <classpathentry kind="src" path="/org.eclipse.ui.ide"/>
+ <classpathentry kind="src" path="/org.eclipse.ui.views"/>
+ <classpathentry kind="src" path="/org.eclipse.ui.editors"/>
<classpathentry kind="src" path="/net.sourceforge.csseditor"/>
<classpathentry kind="src" path="/org.eclipse.jface"/>
***************
*** 10,15 ****
<classpathentry kind="src" path="/org.eclipse.ui"/>
<classpathentry kind="src" path="/org.eclipse.ui.workbench.texteditor"/>
! <classpathentry sourcepath="ORG_ECLIPSE_JDT_SOURCE_SRC/org.junit_3.8.1/junitsrc.zip" kind="var" path="ECLIPSE_HOME/plugins/org.junit_3.8.1/junit.jar"/>
! <classpathentry kind="src" path="/org.eclipse.core.runtime.compatibility"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
--- 13,20 ----
<classpathentry kind="src" path="/org.eclipse.ui"/>
<classpathentry kind="src" path="/org.eclipse.ui.workbench.texteditor"/>
! <classpathentry kind="src" path="/org.junit"/>
! <classpathentry kind="src" path="/org.eclipse.core.resources"/>
! <classpathentry kind="src" path="/org.eclipse.core.runtime"/>
! <classpathentry kind="src" path="/org.eclipse.osgi"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
|
|
From: <ce...@us...> - 2004-01-12 17:27:53
|
Update of /cvsroot/csseditor/net.sourceforge.csseditor.tests/src/net/sourceforge/csseditor/tests In directory sc8-pr-cvs1:/tmp/cvs-serv27502/src/net/sourceforge/csseditor/tests Added Files: TextEditorTestCase.java Log Message: Add a generic TextEditorTestCase for testing stuff that relies on an actual text editor being present --- NEW FILE: TextEditorTestCase.java --- /* * Copyright (c) 2003 Christopher Lenz 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: * Christopher Lenz - initial API and implementation * * $Id: TextEditorTestCase.java,v 1.1 2004/01/12 17:27:50 cell Exp $ */ package net.sourceforge.csseditor.tests; import java.io.ByteArrayInputStream; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.text.IDocument; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.part.FileEditorInput; import org.eclipse.ui.texteditor.ITextEditor; import junit.framework.TestCase; /** * A base test case for tests that need the full text editor environment set up * before being able to run. */ public abstract class TextEditorTestCase extends TestCase { // Instance Variables ------------------------------------------------------ private String fileName; private IProject project; private IFile file; private ITextEditor editor; // Constructors ------------------------------------------------------------ /** * Constructor. * * @param fileName The name of the test file to create and edit */ public TextEditorTestCase(String fileName) { this.fileName = fileName; } // TestCase Implementation ------------------------------------------------- /* * @see junit.framework.TestCase#setUp() */ protected void setUp() throws CoreException { // Prepare a test project containing a single empty CSS style sheet IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); project = root.getProject("test"); if (!project.exists()) { project.create(null); } else { project.refreshLocal(IResource.DEPTH_INFINITE, null); } if (!project.isOpen()) { project.open(null); } file = project.getFile(fileName); } /* * @see junit.framework.TestCase#tearDown() */ protected void tearDown() throws CoreException { if (editor != null) { editor.close(false); } project.delete(true, true, null); } // Protected Methods ------------------------------------------------------- /** * Returns the document opened in the editor. * * @return the opened document * @throws IllegalStateException if called before {@link #setUpEditor()} */ protected final IDocument getDocument() { if (editor == null) { throw new IllegalStateException("You must call setUpEditor() " + "before accessing the document"); } return editor.getDocumentProvider().getDocument( editor.getEditorInput()); } /** * Initializes the editor and its input, and returns the initialized editor. * * @param text the contents of the file to create and edit * @return the initialized editor * @throws CoreException if the file couldn't be created, or the editor * failed to open */ protected final ITextEditor setUpEditor(String text) throws CoreException { // Stream the given content into the file ByteArrayInputStream in = new ByteArrayInputStream(text.getBytes()); if (!file.exists()) { file.create(in, true, null); } else { file.setContents(in, true, false, null); } // Open the editor IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage(); editor = (ITextEditor) page.openEditor(new FileEditorInput(file), workbench.getEditorRegistry().getDefaultEditor(fileName).getId()); return editor; } } |