1 package org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.dialogs
;
3 import org
.eclipse
.ui
.PlatformUI
;
6 final public class TraceControlDialogFactory
{
8 // ------------------------------------------------------------------------
10 // ------------------------------------------------------------------------
13 * The factory instance.
15 private static TraceControlDialogFactory fInstance
;
18 * The new connection dialog reference.
20 private INewConnectionDialog fNewConnectionDialog
;
23 * The create channel dialog (on domain level)
25 private ICreateChannelDialog fCreateChannelDialog
;
28 * The create session dialog.
30 private ICreateSessionDialog fCreateSessionDialog
;
33 * The enable events dialog.
35 private IEnableEventsDialog fEnableEventsDialog
;
38 * The get event info dialog.
40 private IGetEventInfoDialog fGetEventInfoDialog
;
43 * The confirmation dialog implementation.
45 private IConfirmDialog fConfirmDialog
;
48 * The add context dialog implementation.
50 private IAddContextDialog fAddContextDialog
;
53 * The import dialog implementation.
55 private IImportDialog fImportDialog
;
58 * The import confirmation dialog.
60 private IImportConfirmationDialog fImportConfirmationDialog
;
62 // ------------------------------------------------------------------------
64 // ------------------------------------------------------------------------
67 * Constructor for R4EUIDialogFactory.
69 private TraceControlDialogFactory() {
72 // ------------------------------------------------------------------------
74 // ------------------------------------------------------------------------
77 * @return TraceControlDialogFactory instance
79 public synchronized static TraceControlDialogFactory
getInstance() {
80 if (fInstance
== null) {
81 fInstance
= new TraceControlDialogFactory();
87 * @return new connection dialog
89 public INewConnectionDialog
getNewConnectionDialog() {
90 if (fNewConnectionDialog
== null) {
91 fNewConnectionDialog
= new NewConnectionDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
93 return fNewConnectionDialog
;
97 * Sets a new connection dialog implementation.
98 * @param newConnectionDialog - new connection dialog implementation
100 public void setNewConnectionDialog(INewConnectionDialog newConnectionDialog
) {
101 fNewConnectionDialog
= newConnectionDialog
;
105 * @return create channel dialog (on domain level)
107 public ICreateChannelDialog
getCreateChannelDialog() {
108 if (fCreateChannelDialog
== null) {
109 fCreateChannelDialog
= new CreateChannelDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
111 return fCreateChannelDialog
;
115 * Sets a create channel dialog implementation (on domain level).
116 * @param createChannelDialog - a create channel dialog implementation
118 public void setCreateChannelDialog(ICreateChannelDialog createChannelDialog
) {
119 fCreateChannelDialog
= createChannelDialog
;
123 * @return create session dialog implementation
125 public ICreateSessionDialog
getCreateSessionDialog() {
126 if (fCreateSessionDialog
== null) {
127 fCreateSessionDialog
= new CreateSessionDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
129 return fCreateSessionDialog
;
133 * Sets a create session dialog implementation.
134 * @param createSessionDialog - a create session implementation.
136 public void setCreateSessionDialog(ICreateSessionDialog createSessionDialog
) {
137 fCreateSessionDialog
= createSessionDialog
;
141 * @return enable events dialog implementation.
143 public IEnableEventsDialog
getEnableEventsDialog() {
144 if (fEnableEventsDialog
== null) {
145 fEnableEventsDialog
= new EnableEventsDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
147 return fEnableEventsDialog
;
151 * Sets a enable events dialog implementation.
152 * @param enableEventsDialog - a enable events dialog implementation.
154 public void setEnableEventsDialog(IEnableEventsDialog enableEventsDialog
) {
155 fEnableEventsDialog
= enableEventsDialog
;
159 * @return get events info dialog implementation.
161 public IGetEventInfoDialog
getGetEventInfoDialog() {
162 if (fGetEventInfoDialog
== null) {
163 fGetEventInfoDialog
= new GetEventInfoDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
165 return fGetEventInfoDialog
;
169 * Sets a get events info dialog implementation.
170 * @param getEventInfoDialog - a get events info dialog implementation
172 public void setGetEventInfoDialog(IGetEventInfoDialog getEventInfoDialog
) {
173 fGetEventInfoDialog
= getEventInfoDialog
;
177 * @return the confirmation dialog implementation
179 public IConfirmDialog
getConfirmDialog() {
180 if (fConfirmDialog
== null) {
181 fConfirmDialog
= new ConfirmDialog();
183 return fConfirmDialog
;
187 * Sets the confirmation dialog implementation
188 * @param confirmDialog - a confirmation dialog implementation
190 public void setConfirmDialog(IConfirmDialog confirmDialog
) {
191 fConfirmDialog
= confirmDialog
;
195 * @return the add context dialog implementation
197 public IAddContextDialog
getAddContextDialog() {
198 if (fAddContextDialog
== null) {
199 fAddContextDialog
= new AddContextDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
201 return fAddContextDialog
;
205 * Sets the add context dialog information
206 * @param addContextDialog - a add context dialog implementation
208 public void setAddContextDialog(IAddContextDialog addContextDialog
) {
209 fAddContextDialog
= addContextDialog
;
213 * @return the import dialog implementation
215 public IImportDialog
getImportDialog() {
216 if (fImportDialog
== null) {
217 fImportDialog
= new ImportDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
219 return fImportDialog
;
223 * Sets the import dialog implementation.
224 * @param importDialog - a import dialog implementation
226 public void setImportDialog(IImportDialog importDialog
) {
227 fImportDialog
= importDialog
;
231 * @return the import confirmation dialog implementation.
233 public IImportConfirmationDialog
getImportConfirmationDialog() {
234 if (fImportConfirmationDialog
== null) {
235 fImportConfirmationDialog
= new ImportConfirmationDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
237 return fImportConfirmationDialog
;
241 * Sets the import confirmation dialog implementation.
242 * @param confirmDialog - a import confirmation dialog implementation.
244 public void setImportConfirmationDialog(IImportConfirmationDialog confirmDialog
) {
245 fImportConfirmationDialog
= confirmDialog
;