Skip to main content
summaryrefslogtreecommitdiffstats
blob: bb43ca1ec472e71d22b49672b24123301f7d844b (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/*******************************************************************************
 * Copyright (c) 2006, 2008 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
 * yyyymmdd bug      Email and other contact information
 * -------- -------- -----------------------------------------------------------
 * 20060413   135581 rsinha@ca.ibm.com - Rupam Kuehner
 * 20060802   148731 mahutch@ca.ibm.com - Mark Hutchinson
 * 20080603   234251 pmoogk@ca.ibm.com - Peter Moogk, Updated the size of project selection dialog
 *******************************************************************************/
package org.eclipse.jst.ws.internal.consumption.ui.widgets;

import org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ProjectSelectionWidget;
import org.eclipse.jst.ws.internal.data.TypeRuntimeServer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.wst.command.internal.env.ui.widgets.PageInfo;
import org.eclipse.wst.command.internal.env.ui.widgets.SimpleDialog;

public class ProjectSelectionDialog extends SimpleDialog {

	String titleText_="";
	String projectName_="";
	String earProjectName_="";
	String componentType_="";
	TypeRuntimeServer trs_;
	boolean needEAR_;
	
	public ProjectSelectionDialog(Shell shell, PageInfo pageInfo)
	{
		super(shell, pageInfo);
		titleText_ = pageInfo.getPageName();
	}	
	
	protected void callSetters() {
		// TODO Auto-generated method stub
		ProjectSelectionWidget projWidget = (ProjectSelectionWidget)getWidget();		
		projWidget.setEarProjectName(earProjectName_);
		projWidget.setProjectName(projectName_);
		projWidget.setComponentType(componentType_);
		projWidget.setNeedEAR(needEAR_);
		projWidget.setTypeRuntimeServer(trs_);
		
		projWidget.refreshProjectItems();
	}
	
	  protected Point getInitialSize()
	  {
	    return this.getShell().computeSize(325, SWT.DEFAULT, true); 
	  }


	  protected void setShellStyle(int newShellStyle)
	  {
	    super.setShellStyle( newShellStyle | SWT.RESIZE );  
	  }

	  protected void configureShell(Shell newShell)
	  {
	    newShell.setText(titleText_);   
	    super.configureShell(newShell);
	  }	
		
		public void setProjectName(String name)
		  {
				projectName_ = name;
		  }
		
		public String getProjectName()
		  {
				return projectName_;
		  }
		
		 public void setEarProjectName(String name)
		  {			
				earProjectName_ = name;
		  } 
		 
		 public String getEarProjectName()
		 {
			 return earProjectName_;
		 }
		 
		 public void setProjectComponentType( String type )
		  {
			    componentType_ = type;
		  }

		 public String getProjectComponentType()
		  {
			 return componentType_;
		  }
		 
		 public void setNeedEAR(boolean b)
		  {
			    needEAR_ = b;			    
		  }
		 
		 public boolean getNeedEAR()
		  {
			    return needEAR_;				
		  }
		 
		 public void setTypeRuntimeServer(TypeRuntimeServer trs)
		 {
			    trs_ = trs; 
		 }
		 
		 public boolean close() {

			projectName_ = ((ProjectSelectionWidget)getWidget()).getProjectName();
			earProjectName_ = ((ProjectSelectionWidget)getWidget()).getEarProjectName(); 
			needEAR_ = ((ProjectSelectionWidget)getWidget()).getNeedEAR();
			componentType_ = ((ProjectSelectionWidget)getWidget()).getComponentType();
			return super.close();
		}
}

Back to the top