KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > text > ManifestElementHyperlink


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.ui.editor.text;
12
13 import org.eclipse.jface.text.IRegion;
14
15 public abstract class ManifestElementHyperlink extends AbstractHyperlink {
16
17     public ManifestElementHyperlink(IRegion region, String JavaDoc element) {
18         super(region, element);
19     }
20
21     protected abstract void open2();
22     
23     public void open() {
24         // remove whitespace inbetween chars
25
int len = fElement.length();
26         StringBuffer JavaDoc sb = new StringBuffer JavaDoc(len);
27         for (int i = 0; i < len; i++) {
28             char c = fElement.charAt(i);
29             if (!Character.isWhitespace(c))
30                 sb.append(c);
31         }
32         fElement = sb.toString();
33         open2();
34     }
35 }
36
Popular Tags