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
;
52 // ------------------------------------------------------------------------
54 // ------------------------------------------------------------------------
57 * Constructor for R4EUIDialogFactory.
59 private TraceControlDialogFactory() {
62 // ------------------------------------------------------------------------
64 // ------------------------------------------------------------------------
67 * @return TraceControlDialogFactory instance
69 public synchronized static TraceControlDialogFactory
getInstance() {
70 if (fInstance
== null) {
71 fInstance
= new TraceControlDialogFactory();
77 * @return new connection dialog
79 public INewConnectionDialog
getNewConnectionDialog() {
80 if (fNewConnectionDialog
== null) {
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 (fCreateChannelDialog
== null) {
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 session dialog implementation
115 public ICreateSessionDialog
getCreateSessionDialog() {
116 if (fCreateSessionDialog
== null) {
117 fCreateSessionDialog
= new CreateSessionDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
119 return fCreateSessionDialog
;
123 * Sets a create session dialog implementation.
124 * @param createSessionDialog - a create session implementation.
126 public void setCreateSessionDialog(ICreateSessionDialog createSessionDialog
) {
127 fCreateSessionDialog
= createSessionDialog
;
131 * @return enable events dialog implementation.
133 public IEnableEventsDialog
getEnableEventsDialog() {
134 if (fEnableEventsDialog
== null) {
135 fEnableEventsDialog
= new EnableEventsDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
137 return fEnableEventsDialog
;
141 * Sets a enable events dialog implementation.
142 * @param enableEventsDialog - a enable events dialog implementation.
144 public void setEnableEventsDialog(IEnableEventsDialog enableEventsDialog
) {
145 fEnableEventsDialog
= enableEventsDialog
;
149 * @return get events info dialog implementation.
151 public IGetEventInfoDialog
getGetEventInfoDialog() {
152 if (fGetEventInfoDialog
== null) {
153 fGetEventInfoDialog
= new GetEventInfoDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
155 return fGetEventInfoDialog
;
159 * Sets a get events info dialog implementation.
160 * @param getEventInfoDialog - a get events info dialog implementation
162 public void setGetEventInfoDialog(IGetEventInfoDialog getEventInfoDialog
) {
163 fGetEventInfoDialog
= getEventInfoDialog
;
167 * @return the confirmation dialog implementation
169 public IConfirmDialog
getConfirmDialog() {
170 if (fConfirmDialog
== null) {
171 fConfirmDialog
= new ConfirmDialog();
173 return fConfirmDialog
;
177 * Sets the confirmation dialog implementation
178 * @param confirmDialog
180 public void setConfirmDialog(IConfirmDialog confirmDialog
) {
181 fConfirmDialog
= confirmDialog
;
185 * @return the add context dialog implementation
187 public IAddContextDialog
getAddContextDialog() {
188 if (fAddContextDialog
== null) {
189 fAddContextDialog
= new AddContextDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
191 return fAddContextDialog
;
195 * Sets the add context dialog information
196 * @param addContextDialog
198 public void setAddContextDialog(IAddContextDialog addContextDialog
) {
199 fAddContextDialog
= addContextDialog
;