01: /*******************************************************************************
02: * Copyright (c) 2005, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.internal.ui.preferences;
11:
12: import org.eclipse.swt.SWT;
13: import org.eclipse.swt.events.SelectionAdapter;
14: import org.eclipse.swt.events.SelectionEvent;
15: import org.eclipse.swt.layout.GridData;
16: import org.eclipse.swt.layout.GridLayout;
17: import org.eclipse.swt.widgets.Composite;
18: import org.eclipse.swt.widgets.Control;
19: import org.eclipse.swt.widgets.Link;
20:
21: import org.eclipse.ui.IWorkbenchPropertyPage;
22: import org.eclipse.ui.dialogs.PropertyPage;
23: import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
24:
25: public class JavaEditorPropertyPage extends PropertyPage implements
26: IWorkbenchPropertyPage {
27:
28: public JavaEditorPropertyPage() {
29: }
30:
31: protected Control createContents(Composite parent) {
32: final Composite composite = new Composite(parent, SWT.NONE);
33: composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
34: true));
35: composite.setLayout(new GridLayout());
36:
37: Link link = new Link(composite, SWT.WRAP);
38: GridData data = new GridData(SWT.FILL, SWT.BEGINNING, true,
39: false);
40: data.widthHint = 300;
41: link.setLayoutData(data);
42: link
43: .setText(PreferencesMessages.JavaEditorPropertyPage_SaveActionLink_Text);
44: link.addSelectionListener(new SelectionAdapter() {
45: public void widgetSelected(SelectionEvent e) {
46: IWorkbenchPreferenceContainer container = (IWorkbenchPreferenceContainer) getContainer();
47: container.openPage(
48: SaveParticipantPreferencePage.PROPERTY_PAGE_ID,
49: null);
50: }
51: });
52:
53: return composite;
54: }
55:
56: }
|