/* * Created on Apr 12, 2003 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package net.raepple.plugin; import java.net.MalformedURLException; import java.net.URL; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; /** * @author raepple * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class XMLElementCountPage extends WizardPage { private Text elementName; /** * @param pageName */ public XMLElementCountPage() { super("XML Element Count","XML Element Count Plugin", null); setImageDescriptor(getImageDescriptor("icons/xml_icon.gif")); setDescription("Please provide the necessary information for the XML Element count."); } /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ public void createControl(Composite parent) { // create the Control Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); composite.setLayout(layout); GridData data = new GridData(GridData.FILL); data.grabExcessHorizontalSpace = true; composite.setLayoutData(data); // create the intput arguments panel createInputGroup(composite); setControl(composite); } private void createInputGroup(Composite parent) { Label elementLabel = new Label(parent, SWT.NONE); elementLabel.setText("Element Name:"); GridData gd = new GridData(); gd = new GridData(); elementLabel.setLayoutData(gd); //The input text for the file location elementName = new Text(parent, SWT.WRAP | SWT.BORDER); elementName.setEditable(true); gd = new GridData(); gd.widthHint = 100; gd.heightHint = 15; elementName.setLayoutData(gd); } public String getElementName() { return this.elementName.getText(); } protected ImageDescriptor getImageDescriptor(String relativePath) { try { URL installURL = XMLProcessing.getDefault().getDescriptor().getInstallURL(); URL url = new URL(installURL, relativePath); return ImageDescriptor.createFromURL(url); } catch (MalformedURLException e) { return null; } } }