| /******************************************************************************* |
| * Copyright (c) 2003, 2005 IBM Corporation and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ |
| /* |
| * Created on Feb 27, 2004 |
| * |
| * To change the template for this generated file go to |
| * Window - Preferences - Java - Code Generation - Code and Comments |
| */ |
| package org.eclipse.pde.internal.ui.editor; |
| |
| import org.eclipse.jface.action.*; |
| import org.eclipse.jface.text.*; |
| import org.eclipse.pde.internal.ui.parts.*; |
| import org.eclipse.ui.*; |
| import org.eclipse.ui.forms.events.*; |
| |
| public class FormEntryAdapter implements IFormEntryListener { |
| private IContextPart contextPart; |
| protected IActionBars actionBars; |
| |
| public FormEntryAdapter(IContextPart contextPart) { |
| this(contextPart, null); |
| } |
| public FormEntryAdapter(IContextPart contextPart, IActionBars actionBars) { |
| this.contextPart = contextPart; |
| this.actionBars = actionBars; |
| } |
| public void focusGained(FormEntry entry) { |
| ITextSelection selection = new TextSelection(1,1); |
| contextPart.getPage().getPDEEditor().getContributor().updateSelectableActions(selection); |
| } |
| /* (non-Javadoc) |
| * @see org.eclipse.pde.internal.ui.newparts.IFormEntryListener#textDirty(org.eclipse.pde.internal.ui.newparts.FormEntry) |
| */ |
| public void textDirty(FormEntry entry) { |
| contextPart.fireSaveNeeded(); |
| } |
| /* (non-Javadoc) |
| * @see org.eclipse.pde.internal.ui.newparts.IFormEntryListener#textValueChanged(org.eclipse.pde.internal.ui.newparts.FormEntry) |
| */ |
| public void textValueChanged(FormEntry entry) { |
| } |
| /* (non-Javadoc) |
| * @see org.eclipse.pde.internal.ui.newparts.IFormEntryListener#browseButtonSelected(org.eclipse.pde.internal.ui.newparts.FormEntry) |
| */ |
| public void browseButtonSelected(FormEntry entry) { |
| } |
| /* (non-Javadoc) |
| * @see org.eclipse.ui.forms.events.HyperlinkListener#linkEntered(org.eclipse.ui.forms.events.HyperlinkEvent) |
| */ |
| public void linkEntered(HyperlinkEvent e) { |
| if (actionBars==null) return; |
| IStatusLineManager mng = actionBars.getStatusLineManager(); |
| mng.setMessage(e.getLabel()); |
| } |
| /* (non-Javadoc) |
| * @see org.eclipse.ui.forms.events.HyperlinkListener#linkExited(org.eclipse.ui.forms.events.HyperlinkEvent) |
| */ |
| public void linkExited(HyperlinkEvent e) { |
| if (actionBars==null) return; |
| IStatusLineManager mng = actionBars.getStatusLineManager(); |
| mng.setMessage(null); |
| } |
| /* (non-Javadoc) |
| * @see org.eclipse.ui.forms.events.HyperlinkListener#linkActivated(org.eclipse.ui.forms.events.HyperlinkEvent) |
| */ |
| public void linkActivated(HyperlinkEvent e) { |
| } |
| public void selectionChanged(FormEntry entry) { |
| ITextSelection selection = new TextSelection(1,1); |
| contextPart.getPage().getPDEEditor().getContributor().updateSelectableActions(selection); |
| } |
| } |