Skip to main content
summaryrefslogtreecommitdiffstats
blob: 84e467e87400c4e0dfd4d626014d1070bdbc874b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*******************************************************************************
 * Copyright (c) 2001, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.wst.xsd.ui.internal.wizards;

import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
import org.eclipse.wst.xsd.ui.internal.util.ViewUtility;


public class XSDLocationChoicePage extends WizardPage 
{
  protected Button radioButton1;
  protected Button radioButton2;
    
  public XSDLocationChoicePage()
  {
    super("XSDLocationChoicePage");

    this.setTitle(XSDEditorPlugin.getXSDString("_UI_WIZARD_INCLUDE_FILE_TITLE"));
    this.setDescription(XSDEditorPlugin.getXSDString("_UI_WIZARD_INCLUDE_FILE_DESC"));
  }
    
  public boolean isPageComplete()
  {
    return true;
  }
    
  public void createControl(Composite parent)
  {
    Composite base = new Composite(parent, SWT.NONE);
    base.setLayout(new GridLayout());
      
    ViewUtility.createLabel(base, XSDEditorPlugin.getXSDString("_UI_LABEL_INCLUDE_URL_FILE"));
    Composite radioButtonsGroup = ViewUtility.createComposite(base, 1, true);

    radioButton1 = ViewUtility.createRadioButton(radioButtonsGroup, 
                                                 XSDEditorPlugin.getXSDString("_UI_RADIO_FILE"));
      
    radioButton2 = ViewUtility.createRadioButton(radioButtonsGroup,
                                                 XSDEditorPlugin.getXSDString("_UI_RADIO_URL"));

    radioButton1.setSelection(true);

    setControl(base);
  }

  // actions on finish
  public boolean performFinish()
  {
    return true;
  }

  public boolean isURL()
  {
    return radioButton2.getSelection();
  }
}

Back to the top