1 package org
.eclipse
.linuxtools
.internal
.lttng
.ui
.views
.control
.dialogs
;
3 import org
.eclipse
.ui
.PlatformUI
;
6 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 channel dialog (on session level)
30 private ICreateChannelOnSessionDialog fCreateChannelOnSessionDialog
;
33 * The create session dialog.
35 private ICreateSessionDialog fCreateSessionDialog
;
38 * The enable events dialog.
40 private IEnableEventsDialog fEnableEventsDialog
;
43 * The get event info dialog.
45 private IGetEventInfoDialog fGetEventInfoDialog
;
48 * The confirmation dialog implementation
50 private IConfirmDialog fConfirmDialog
;
52 // ------------------------------------------------------------------------
54 // ------------------------------------------------------------------------
57 * Constructor for R4EUIDialogFactory.
59 private TraceControlDialogFactory() {
62 // ------------------------------------------------------------------------
64 // ------------------------------------------------------------------------
67 * @return TraceControlDialogFactory instance
69 public static TraceControlDialogFactory
getInstance() {
70 if (null == fInstance
) {
71 fInstance
= new TraceControlDialogFactory();
77 * @return new connection dialog
79 public INewConnectionDialog
getNewConnectionDialog() {
80 if (null == fNewConnectionDialog
) {
81 fNewConnectionDialog
= new NewConnectionDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
83 return fNewConnectionDialog
;
87 * Sets a new connection dialog implementation.
88 * @param newConnectionDialog - new connection dialog implementation
90 public void setNewConnectionDialog(INewConnectionDialog newConnectionDialog
) {
91 fNewConnectionDialog
= newConnectionDialog
;
95 * @return create channel dialog (on domain level)
97 public ICreateChannelDialog
getCreateChannelDialog() {
98 if (null == fCreateChannelDialog
) {
99 fCreateChannelDialog
= new CreateChannelDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
101 return fCreateChannelDialog
;
105 * Sets a create channel dialog implementation (on domain level).
106 * @param createChannelDialog - a create channel dialog implementation
108 public void setCreateChannelDialog(ICreateChannelDialog createChannelDialog
) {
109 fCreateChannelDialog
= createChannelDialog
;
113 * @return create channel dialog (on session level)
115 public ICreateChannelOnSessionDialog
getCreateChannelOnSessionDialog() {
116 if (null == fCreateChannelOnSessionDialog
) {
117 fCreateChannelOnSessionDialog
= new CreateChannelDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
119 return fCreateChannelOnSessionDialog
;
123 * Sets a create channel dialog implementation (on domain level).
124 * @param createChannelDialog - a create channel dialog implementation
126 public void setCreateChannelOnSessionDialog(ICreateChannelOnSessionDialog createChannelDialog
) {
127 fCreateChannelOnSessionDialog
= createChannelDialog
;
131 * @return create session dialog implementation
133 public ICreateSessionDialog
getCreateSessionDialog() {
134 if (null == fCreateSessionDialog
) {
135 fCreateSessionDialog
= new CreateSessionDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
137 return fCreateSessionDialog
;
141 * Sets a create session dialog implementation.
142 * @param createSessionDialog - a create session implementation.
144 public void setCreateSessionDialog(ICreateSessionDialog createSessionDialog
) {
145 fCreateSessionDialog
= createSessionDialog
;
149 * @return enable events dialog implementation.
151 public IEnableEventsDialog
getEnableEventsDialog() {
152 if (null == fEnableEventsDialog
) {
153 fEnableEventsDialog
= new EnableEventsDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
155 return fEnableEventsDialog
;
159 * Sets a enable events dialog implementation.
160 * @param enableEventsDialog - a enable events dialog implementation.
162 public void setEnableEventsDialog(IEnableEventsDialog enableEventsDialog
) {
163 fEnableEventsDialog
= enableEventsDialog
;
167 * @return get events info dialog implementation.
169 public IGetEventInfoDialog
getGetEventInfoDialog() {
170 if (null == fGetEventInfoDialog
) {
171 fGetEventInfoDialog
= new GetEventInfoDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
173 return fGetEventInfoDialog
;
177 * Sets a get events info dialog implementation.
178 * @param getEventInfoDialog - a get events info dialog implementation
180 public void setGetEventInfoDialog(IGetEventInfoDialog getEventInfoDialog
) {
181 fGetEventInfoDialog
= getEventInfoDialog
;
185 * @return the confirmation dialog implementation
187 public IConfirmDialog
getConfirmDialog() {
188 if (null == fConfirmDialog
) {
189 fConfirmDialog
= new ConfirmDialog();
191 return fConfirmDialog
;
195 * Sets the confirmation dialog implementation
196 * @param confirmDialog
198 public void setConfirmDialog(IConfirmDialog confirmDialog
) {
199 fConfirmDialog
= confirmDialog
;