|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2007, 2011 Innoopract Informationssysteme GmbH. |
2 |
* Copyright (c) 2007, 2011 EclipseSource and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 19-25
Link Here
|
| 19 |
import org.eclipse.swt.events.SelectionEvent; |
19 |
import org.eclipse.swt.events.SelectionEvent; |
| 20 |
import org.eclipse.swt.graphics.Image; |
20 |
import org.eclipse.swt.graphics.Image; |
| 21 |
import org.eclipse.swt.graphics.Point; |
21 |
import org.eclipse.swt.graphics.Point; |
| 22 |
import org.eclipse.swt.layout.*; |
22 |
import org.eclipse.swt.layout.GridData; |
|
|
23 |
import org.eclipse.swt.layout.GridLayout; |
| 23 |
import org.eclipse.swt.widgets.*; |
24 |
import org.eclipse.swt.widgets.*; |
| 24 |
|
25 |
|
| 25 |
public final class InstallTargetDialog extends TitleAreaDialog { |
26 |
public final class InstallTargetDialog extends TitleAreaDialog { |
|
Lines 37-43
Link Here
|
| 37 |
private boolean shouldSwitchTarget = true; |
38 |
private boolean shouldSwitchTarget = true; |
| 38 |
private Image titleImage; |
39 |
private Image titleImage; |
| 39 |
|
40 |
|
| 40 |
public InstallTargetDialog( final Shell parentShell ) { |
41 |
public InstallTargetDialog( Shell parentShell ) { |
| 41 |
super( parentShell ); |
42 |
super( parentShell ); |
| 42 |
setShellStyle( SWT.TITLE | SWT.CLOSE | SWT.RESIZE ); |
43 |
setShellStyle( SWT.TITLE | SWT.CLOSE | SWT.RESIZE ); |
| 43 |
setHelpAvailable( false ); |
44 |
setHelpAvailable( false ); |
|
Lines 63-74
Link Here
|
| 63 |
|
64 |
|
| 64 |
protected Point getInitialSize() { |
65 |
protected Point getInitialSize() { |
| 65 |
Point initialSize = super.getInitialSize(); |
66 |
Point initialSize = super.getInitialSize(); |
| 66 |
return new Point( initialSize.x, initialSize.y - 160 ); |
67 |
return new Point( initialSize.x, initialSize.y - 150 ); |
| 67 |
} |
68 |
} |
| 68 |
|
69 |
|
| 69 |
protected Control createDialogArea( final Composite parent ) { |
70 |
protected Control createDialogArea( Composite parent ) { |
| 70 |
Composite result = ( Composite )super.createDialogArea( parent ); |
71 |
Composite result = ( Composite )super.createDialogArea( parent ); |
| 71 |
configureDialog(); |
72 |
configureDialog(); |
|
|
73 |
createTargetDescription( result ); |
| 72 |
createTargetLocationArea( result ); |
74 |
createTargetLocationArea( result ); |
| 73 |
createSwitchTargetArea( result ); |
75 |
createSwitchTargetArea( result ); |
| 74 |
Dialog.applyDialogFont( result ); |
76 |
Dialog.applyDialogFont( result ); |
|
Lines 96-126
Link Here
|
| 96 |
setMessage( IntroMessages.InstallDialog_Message_selectLocation ); |
98 |
setMessage( IntroMessages.InstallDialog_Message_selectLocation ); |
| 97 |
} |
99 |
} |
| 98 |
|
100 |
|
| 99 |
private void createTargetLocationArea( final Composite parent ) { |
101 |
private void createTargetDescription( Composite parent ) { |
|
|
102 |
Composite container = new Composite( parent, SWT.NONE ); |
| 103 |
container.setLayoutData( new GridData( SWT.FILL, SWT.TOP, true, false ) ); |
| 104 |
container.setLayout( new GridLayout() ); |
| 105 |
Label targetDescriptionLabel = new Label( container, SWT.WRAP ); |
| 106 |
targetDescriptionLabel.setLayoutData( getLayoutDataForDescriptions() ); |
| 107 |
targetDescriptionLabel.setText( IntroMessages.InstallTargetDialog_TargetDescriptionMsg ); |
| 108 |
} |
| 109 |
|
| 110 |
private void createTargetLocationArea( Composite parent ) { |
| 100 |
Composite container = new Composite( parent, SWT.NONE ); |
111 |
Composite container = new Composite( parent, SWT.NONE ); |
| 101 |
container.setLayoutData( new GridData( SWT.FILL, SWT.TOP, true, false ) ); |
112 |
container.setLayoutData( new GridData( SWT.FILL, SWT.TOP, true, false ) ); |
| 102 |
container.setLayout( new GridLayout() ); |
113 |
container.setLayout( new GridLayout() ); |
| 103 |
Group targetSelectionGroup = new Group( container, SWT.NONE ); |
114 |
Group targetSelectionGroup = new Group( container, SWT.NONE ); |
| 104 |
targetSelectionGroup.setLayout( new GridLayout( 1, true ) ); |
115 |
targetSelectionGroup.setLayout( new GridLayout( 1, true ) ); |
| 105 |
targetSelectionGroup.setLayoutData( new GridData( SWT.FILL, |
116 |
targetSelectionGroup.setLayoutData( new GridData( SWT.FILL, SWT.TOP, true, false ) ); |
| 106 |
SWT.TOP, |
117 |
String targetVersionGroupTitle = IntroMessages.InstallTargetDialog_TargetVersionGroupTitle; |
| 107 |
true, |
|
|
| 108 |
false ) ); |
| 109 |
String targetVersionGroupTitle |
| 110 |
= IntroMessages.InstallTargetDialog_TargetVersionGroupTitle; |
| 111 |
targetSelectionGroup.setText( targetVersionGroupTitle ); |
118 |
targetSelectionGroup.setText( targetVersionGroupTitle ); |
| 112 |
createButtons( targetSelectionGroup ); |
119 |
createButtons( targetSelectionGroup ); |
| 113 |
Label warningLabel = new Label( targetSelectionGroup, SWT.NONE ); |
|
|
| 114 |
warningLabel.setText( IntroMessages.InstallTargetDialog_DownloadWarningMsg ); |
| 115 |
} |
120 |
} |
| 116 |
|
121 |
|
| 117 |
private void createButtons( final Group targetSelectionGroup ) { |
122 |
private void createButtons( Group targetSelectionGroup ) { |
| 118 |
Button latestStableBuildBtn = new Button( targetSelectionGroup, SWT.RADIO ); |
123 |
Button latestStableBuildBtn = new Button( targetSelectionGroup, SWT.RADIO ); |
| 119 |
String latestBuildText = IntroMessages.InstallTargetDialog_LatestBuildText; |
124 |
String latestBuildText = IntroMessages.InstallTargetDialog_LatestBuildText; |
| 120 |
latestStableBuildBtn.setText( latestBuildText ); |
125 |
latestStableBuildBtn.setText( latestBuildText ); |
| 121 |
latestStableBuildBtn.setSelection( true ); |
126 |
latestStableBuildBtn.setSelection( true ); |
| 122 |
latestStableBuildBtn.addSelectionListener( new SelectionAdapter() { |
127 |
latestStableBuildBtn.addSelectionListener( new SelectionAdapter() { |
| 123 |
public void widgetSelected( final SelectionEvent e ) { |
128 |
public void widgetSelected( SelectionEvent e ) { |
| 124 |
isLatestBuild = true; |
129 |
isLatestBuild = true; |
| 125 |
} |
130 |
} |
| 126 |
} ); |
131 |
} ); |
|
Lines 129-162
Link Here
|
| 129 |
= IntroMessages.InstallTargetDialog_LatestReleaseText; |
134 |
= IntroMessages.InstallTargetDialog_LatestReleaseText; |
| 130 |
latestReleaseBtn.setText( latestReleaseText ); |
135 |
latestReleaseBtn.setText( latestReleaseText ); |
| 131 |
latestReleaseBtn.addSelectionListener( new SelectionAdapter() { |
136 |
latestReleaseBtn.addSelectionListener( new SelectionAdapter() { |
| 132 |
public void widgetSelected( final SelectionEvent e ) { |
137 |
public void widgetSelected( SelectionEvent e ) { |
| 133 |
isLatestBuild = false; |
138 |
isLatestBuild = false; |
| 134 |
} |
139 |
} |
| 135 |
} ); |
140 |
} ); |
| 136 |
} |
141 |
} |
| 137 |
|
142 |
|
| 138 |
private void createSwitchTargetArea( final Composite parent ) { |
143 |
private void createSwitchTargetArea( Composite parent ) { |
| 139 |
Composite container = new Composite( parent, SWT.NONE ); |
144 |
Composite container = new Composite( parent, SWT.NONE ); |
|
|
145 |
container.setLayout( new GridLayout() ); |
| 140 |
container.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, false ) ); |
146 |
container.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, false ) ); |
| 141 |
FillLayout layout = new FillLayout(); |
|
|
| 142 |
layout.marginWidth = 5; |
| 143 |
layout.marginHeight = 5; |
| 144 |
container.setLayout( layout ); |
| 145 |
Group grgTarget = new Group( container, SWT.NONE ); |
147 |
Group grgTarget = new Group( container, SWT.NONE ); |
| 146 |
grgTarget.setLayout( new GridLayout() ); |
148 |
grgTarget.setLayout( new GridLayout() ); |
|
|
149 |
grgTarget.setLayoutData( new GridData( SWT.FILL, SWT.TOP, true, false ) ); |
| 147 |
grgTarget.setText( IntroMessages.InstallDialog_TargetGroup ); |
150 |
grgTarget.setText( IntroMessages.InstallDialog_TargetGroup ); |
| 148 |
final Button switchTarget = new Button( grgTarget, SWT.CHECK ); |
151 |
final Button switchTarget = new Button( grgTarget, SWT.CHECK ); |
| 149 |
switchTarget.setText( IntroMessages.InstallDialog_switchTarget ); |
152 |
switchTarget.setText( IntroMessages.InstallDialog_switchTarget ); |
| 150 |
switchTarget.setSelection( true ); |
153 |
switchTarget.setSelection( true ); |
| 151 |
switchTarget.addSelectionListener( new SelectionAdapter() { |
154 |
switchTarget.addSelectionListener( new SelectionAdapter() { |
| 152 |
public void widgetSelected( final SelectionEvent e ) { |
155 |
public void widgetSelected( SelectionEvent e ) { |
| 153 |
shouldSwitchTarget = switchTarget.getSelection(); |
156 |
shouldSwitchTarget = switchTarget.getSelection(); |
| 154 |
} |
157 |
} |
| 155 |
} ); |
158 |
} ); |
| 156 |
Label lblDescription = new Label( grgTarget, SWT.WRAP ); |
159 |
Label lblDescription = new Label( grgTarget, SWT.WRAP ); |
|
|
160 |
lblDescription.setLayoutData( getLayoutDataForDescriptions() ); |
| 161 |
lblDescription.setText( IntroMessages.InstallDialog_TargetDescription ); |
| 162 |
} |
| 163 |
|
| 164 |
private GridData getLayoutDataForDescriptions() { |
| 157 |
GridData gridData = new GridData( GridData.FILL_HORIZONTAL ); |
165 |
GridData gridData = new GridData( GridData.FILL_HORIZONTAL ); |
| 158 |
gridData.widthHint = 120; |
166 |
gridData.widthHint = 120; |
| 159 |
lblDescription.setLayoutData( gridData ); |
167 |
return gridData; |
| 160 |
lblDescription.setText( IntroMessages.InstallDialog_TargetDescription ); |
|
|
| 161 |
} |
168 |
} |
|
|
169 |
|
| 162 |
} |
170 |
} |