1 11 package org.eclipse.pde.internal.ui.util; 12 13 import org.eclipse.core.resources.IFile; 14 import org.eclipse.core.runtime.IStatus; 15 import org.eclipse.core.runtime.Status; 16 import org.eclipse.pde.internal.ui.PDEPlugin; 17 import org.eclipse.ui.dialogs.ISelectionStatusValidator; 18 19 public class FileValidator implements ISelectionStatusValidator { 20 21 public IStatus validate(Object [] selection) { 22 if (selection.length > 0 && selection[0] instanceof IFile) { 23 return new Status( 24 IStatus.OK, 25 PDEPlugin.getPluginId(), 26 IStatus.OK, 27 "", null); 29 } 30 return new Status( 31 IStatus.ERROR, 32 PDEPlugin.getPluginId(), 33 IStatus.ERROR, 34 "", null); 36 } 37 38 } 39 | Popular Tags |