1 11 package org.eclipse.jdt.internal.ui.preferences; 12 13 import org.eclipse.swt.SWT; 14 import org.eclipse.swt.events.SelectionAdapter; 15 import org.eclipse.swt.events.SelectionEvent; 16 import org.eclipse.swt.layout.GridData; 17 import org.eclipse.swt.layout.GridLayout; 18 import org.eclipse.swt.widgets.Composite; 19 import org.eclipse.swt.widgets.Control; 20 import org.eclipse.swt.widgets.Link; 21 22 import org.eclipse.ui.IWorkbenchPropertyPage; 23 import org.eclipse.ui.dialogs.PropertyPage; 24 import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer; 25 26 public class JavaEditorPropertyPage extends PropertyPage implements IWorkbenchPropertyPage { 27 28 public JavaEditorPropertyPage() {} 29 30 protected Control createContents(Composite parent) { 31 final Composite composite= new Composite(parent, SWT.NONE); 32 composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); 33 composite.setLayout(new GridLayout()); 34 35 Link link= new Link(composite, SWT.WRAP); 36 GridData data= new GridData(SWT.FILL, SWT.BEGINNING, true, false); 37 data.widthHint= 300; 38 link.setLayoutData(data); 39 link.setText(PreferencesMessages.JavaEditorPropertyPage_SaveActionLink_Text); 40 link.addSelectionListener(new SelectionAdapter() { 41 public void widgetSelected(SelectionEvent e) { 42 IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer)getContainer(); 43 container.openPage(SaveParticipantPreferencePage.PROPERTY_PAGE_ID, null); 44 } 45 }); 46 47 return composite; 48 } 49 50 } 51 | Popular Tags |