KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > plugin > rows > TranslatableAttributeRow


1 /*******************************************************************************
2  * Copyright (c) 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
12 package org.eclipse.pde.internal.ui.editor.plugin.rows;
13
14 import org.eclipse.pde.core.plugin.IPluginModelBase;
15 import org.eclipse.pde.internal.core.ischema.ISchemaAttribute;
16 import org.eclipse.pde.internal.ui.editor.IContextPart;
17 import org.eclipse.pde.internal.ui.editor.text.TranslationHyperlink;
18 import org.eclipse.swt.widgets.Display;
19
20 /**
21  * TranslatableAttributeRow
22  *
23  */

24 public class TranslatableAttributeRow extends ReferenceAttributeRow {
25
26     /**
27      * @param part
28      * @param att
29      */

30     public TranslatableAttributeRow(IContextPart part, ISchemaAttribute att) {
31         super(part, att);
32     }
33
34     protected boolean isReferenceModel() {
35         return !part.getPage().getModel().isEditable();
36     }
37
38     protected void openReference() {
39         TranslationHyperlink link = new TranslationHyperlink(null, text.getText(),
40                 (IPluginModelBase)part.getPage().getModel());
41         link.open();
42         if (!link.getOpened()) {
43             Display.getCurrent().beep();
44         }
45     }
46     
47 }
48
Popular Tags