1 11 package org.eclipse.jdt.internal.ui.wizards.buildpaths; 12 13 import java.util.List ; 14 15 import org.eclipse.swt.SWT; 16 import org.eclipse.swt.widgets.Composite; 17 import org.eclipse.swt.widgets.Control; 18 19 import org.eclipse.jface.viewers.StructuredSelection; 20 21 import org.eclipse.jdt.core.IJavaProject; 22 23 import org.eclipse.jdt.internal.ui.util.PixelConverter; 24 import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; 25 import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; 26 import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; 27 28 29 public class ClasspathOrderingWorkbookPage extends BuildPathBasePage { 30 31 private ListDialogField fClassPathList; 32 33 public ClasspathOrderingWorkbookPage(ListDialogField classPathList) { 34 fClassPathList= classPathList; 35 } 36 37 public Control getControl(Composite parent) { 38 PixelConverter converter= new PixelConverter(parent); 39 40 Composite composite= new Composite(parent, SWT.NONE); 41 composite.setFont(parent.getFont()); 42 43 LayoutUtil.doDefaultLayout(composite, new DialogField[] { fClassPathList }, true, SWT.DEFAULT, SWT.DEFAULT); 44 LayoutUtil.setHorizontalGrabbing(fClassPathList.getListControl(null)); 45 46 int buttonBarWidth= converter.convertWidthInCharsToPixels(24); 47 fClassPathList.setButtonsMinWidth(buttonBarWidth); 48 49 return composite; 50 } 51 52 55 public List getSelection() { 56 return fClassPathList.getSelectedElements(); 57 } 58 59 62 public void setSelection(List selElements, boolean expand) { 63 fClassPathList.selectElements(new StructuredSelection(selElements)); 64 } 65 66 69 public boolean isEntryKind(int kind) { 70 return true; 71 } 72 73 76 public void init(IJavaProject javaProject) { 77 } 78 79 82 public void setFocus() { 83 fClassPathList.setFocus(); 84 } 85 86 } 87 | Popular Tags |