*** empty log message ***
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/TextUtil.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/TextUtil.java
index faf5d80..34bc1f0 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/TextUtil.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/TextUtil.java
@@ -10,89 +10,103 @@
*******************************************************************************/
package org.eclipse.pde.internal.ui.editor.text;
-
-
public abstract class TextUtil {
-public static String createMultiLine(String text, int limit) {
- return createMultiLine(text, limit, false);
-}
-public static String createMultiLine(
- String text,
- int limit,
- boolean ignoreNewLine) {
- StringBuffer buffer = new StringBuffer();
- int counter = 0;
- boolean preformatted = false;
+ public static String createMultiLine(String text, int limit) {
+ return createMultiLine(text, limit, false);
+ }
- for (int i = 0; i < text.length(); i++) {
- char c = text.charAt(i);
- counter++;
- if (c == '<') {
- if (isPreStart(text, i)) {
- preformatted = true;
- } else
- if (isPreEnd(text, i)) {
+ public static String createMultiLine(String text, int limit, boolean ignoreNewLine) {
+ StringBuffer buffer = new StringBuffer();
+ int counter = 0;
+ boolean preformatted = false;
+
+ for (int i = 0; i < text.length(); i++) {
+ char c = text.charAt(i);
+ counter++;
+ if (c == '<') {
+ if (isPreStart(text, i)) {
+ preformatted = true;
+ } else if (isPreEnd(text, i)) {
preformatted = false;
- }
- else if (isParagraph(text, i)) {
+ } else if (isParagraph(text, i)) {
buffer.append("\n<p>\n"); //$NON-NLS-1$
- counter=0;
- i+=2;
+ counter = 0;
+ i += 2;
continue;
}
- }
- if (preformatted) {
- if (c=='\n') counter=0;
- buffer.append(c);
- continue;
- }
- if (Character.isWhitespace(c)) {
- if (counter == 1) {
- counter = 0;
- continue; // skip
- } else
- if (counter > limit) {
+ }
+ if (preformatted) {
+ if (c == '\n')
+ counter = 0;
+ buffer.append(c);
+ continue;
+ }
+ if (Character.isWhitespace(c)) {
+ if (counter == 1) {
+ counter = 0;
+ continue; // skip
+ } else if (counter > limit) {
buffer.append('\n');
counter = 0;
i--;
continue;
}
+ }
+ if (c == '\n') {
+ if (ignoreNewLine)
+ c = ' ';
+ else
+ counter = 0;
+ }
+ buffer.append(c);
}
- if (c == '\n') {
- if (ignoreNewLine)
- c = ' ';
- else
- counter = 0;
- }
- buffer.append(c);
+ return buffer.toString();
}
- return buffer.toString();
-}
-private static boolean isParagraph(String text, int loc) {
- if (text.charAt(loc)!='<') return false;
- if (loc+2 >= text.length()) return false;
- if (text.charAt(loc+1)!='p') return false;
- if (text.charAt(loc+2)!='>') return false;
- return true;
-}
-private static boolean isPreEnd(String text, int loc) {
- if (text.charAt(loc)!='<') return false;
- if (loc+5 >= text.length()) return false;
- if (text.charAt(loc+1)!='/') return false;
- if (text.charAt(loc+2)!='p') return false;
- if (text.charAt(loc+3)!='r') return false;
- if (text.charAt(loc+4)!='e') return false;
- if (text.charAt(loc+5)!='>') return false;
- return true;
-}
-private static boolean isPreStart(String text, int loc) {
- if (text.charAt(loc)!='<') return false;
- if (loc+4 >= text.length()) return false;
- if (text.charAt(loc+1)!='p') return false;
- if (text.charAt(loc+2)!='r') return false;
- if (text.charAt(loc+3)!='e') return false;
- if (text.charAt(loc+4)!='>') return false;
- return true;
-}
+
+ private static boolean isParagraph(String text, int loc) {
+ if (text.charAt(loc) != '<')
+ return false;
+ if (loc + 2 >= text.length())
+ return false;
+ if (text.charAt(loc + 1) != 'p')
+ return false;
+ if (text.charAt(loc + 2) != '>')
+ return false;
+ return true;
+ }
+
+ private static boolean isPreEnd(String text, int loc) {
+ if (text.charAt(loc) != '<')
+ return false;
+ if (loc + 5 >= text.length())
+ return false;
+ if (text.charAt(loc + 1) != '/')
+ return false;
+ if (text.charAt(loc + 2) != 'p')
+ return false;
+ if (text.charAt(loc + 3) != 'r')
+ return false;
+ if (text.charAt(loc + 4) != 'e')
+ return false;
+ if (text.charAt(loc + 5) != '>')
+ return false;
+ return true;
+ }
+
+ private static boolean isPreStart(String text, int loc) {
+ if (text.charAt(loc) != '<')
+ return false;
+ if (loc + 4 >= text.length())
+ return false;
+ if (text.charAt(loc + 1) != 'p')
+ return false;
+ if (text.charAt(loc + 2) != 'r')
+ return false;
+ if (text.charAt(loc + 3) != 'e')
+ return false;
+ if (text.charAt(loc + 4) != '>')
+ return false;
+ return true;
+ }
}
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/EditorPreferencePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/EditorPreferencePage.java
index 8c232a2..8d2170d 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/EditorPreferencePage.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/EditorPreferencePage.java
@@ -21,12 +21,9 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.PlatformUI;
@@ -37,7 +34,7 @@
implements IWorkbenchPreferencePage, IPreferenceConstants {
private XMLSyntaxColorTab fXMLTab;
- private ManifestSyntaxColorTab fManifestTab;
+ //private ManifestSyntaxColorTab fManifestTab;
private IColorManager fColorManager;
public EditorPreferencePage() {
@@ -47,7 +44,7 @@
public boolean performOk() {
fXMLTab.performOk();
- fManifestTab.performOk();
+ //fManifestTab.performOk();
PDEPlugin.getDefault().savePluginPreferences();
return super.performOk();
}
@@ -55,13 +52,13 @@
public void dispose() {
fColorManager.dispose();
fXMLTab.dispose();
- fManifestTab.dispose();
+ //fManifestTab.dispose();
super.dispose();
}
protected void performDefaults() {
fXMLTab.performDefaults();
- fManifestTab.performDefaults();
+ //fManifestTab.performDefaults();
super.performDefaults();
}
@@ -78,12 +75,15 @@
}
});
- TabFolder folder = new TabFolder(parent, SWT.NONE);
+ fXMLTab = new XMLSyntaxColorTab(fColorManager);
+ fXMLTab.createContents(parent);
+
+ /*TabFolder folder = new TabFolder(parent, SWT.NONE);
folder.setLayout(new TabFolderLayout());
folder.setLayoutData(new GridData(GridData.FILL_BOTH));
createXMLTab(folder);
- createManifestTab(folder);
+ createManifestTab(folder);*/
Dialog.applyDialogFont(getControl());
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.EDITOR_PREFERENCE_PAGE);
@@ -91,18 +91,18 @@
return parent;
}
- private void createXMLTab(TabFolder folder) {
+ /*private void createXMLTab(TabFolder folder) {
fXMLTab = new XMLSyntaxColorTab(fColorManager);
TabItem item = new TabItem(folder, SWT.NONE);
item.setText("&XML Highlighting");
item.setControl(fXMLTab.createContents(folder));
- }
+ }*/
- private void createManifestTab(TabFolder folder) {
+ /*private void createManifestTab(TabFolder folder) {
fManifestTab = new ManifestSyntaxColorTab(fColorManager);
TabItem item = new TabItem(folder, SWT.NONE);
item.setText("&Manifest Highlighting");
item.setControl(fManifestTab.createContents(folder));
- }
+ }*/
}