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
;
47 // ------------------------------------------------------------------------
49 // ------------------------------------------------------------------------
52 * Constructor for R4EUIDialogFactory.
54 private TraceControlDialogFactory() {
57 // ------------------------------------------------------------------------
59 // ------------------------------------------------------------------------
62 * @return TraceControlDialogFactory instance
64 public synchronized static TraceControlDialogFactory
getInstance() {
65 if (fInstance
== null) {
66 fInstance
= new TraceControlDialogFactory();
72 * @return new connection dialog
74 public INewConnectionDialog
getNewConnectionDialog() {
75 if (fNewConnectionDialog
== null) {
76 fNewConnectionDialog
= new NewConnectionDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
78 return fNewConnectionDialog
;
82 * Sets a new connection dialog implementation.
83 * @param newConnectionDialog - new connection dialog implementation
85 public void setNewConnectionDialog(INewConnectionDialog newConnectionDialog
) {
86 fNewConnectionDialog
= newConnectionDialog
;
90 * @return create channel dialog (on domain level)
92 public ICreateChannelDialog
getCreateChannelDialog() {
93 if (fCreateChannelDialog
== null) {
94 fCreateChannelDialog
= new CreateChannelDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
96 return fCreateChannelDialog
;
100 * Sets a create channel dialog implementation (on domain level).
101 * @param createChannelDialog - a create channel dialog implementation
103 public void setCreateChannelDialog(ICreateChannelDialog createChannelDialog
) {
104 fCreateChannelDialog
= createChannelDialog
;
108 * @return create session dialog implementation
110 public ICreateSessionDialog
getCreateSessionDialog() {
111 if (fCreateSessionDialog
== null) {
112 fCreateSessionDialog
= new CreateSessionDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
114 return fCreateSessionDialog
;
118 * Sets a create session dialog implementation.
119 * @param createSessionDialog - a create session implementation.
121 public void setCreateSessionDialog(ICreateSessionDialog createSessionDialog
) {
122 fCreateSessionDialog
= createSessionDialog
;
126 * @return enable events dialog implementation.
128 public IEnableEventsDialog
getEnableEventsDialog() {
129 if (fEnableEventsDialog
== null) {
130 fEnableEventsDialog
= new EnableEventsDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
132 return fEnableEventsDialog
;
136 * Sets a enable events dialog implementation.
137 * @param enableEventsDialog - a enable events dialog implementation.
139 public void setEnableEventsDialog(IEnableEventsDialog enableEventsDialog
) {
140 fEnableEventsDialog
= enableEventsDialog
;
144 * @return get events info dialog implementation.
146 public IGetEventInfoDialog
getGetEventInfoDialog() {
147 if (fGetEventInfoDialog
== null) {
148 fGetEventInfoDialog
= new GetEventInfoDialog(PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getShell());
150 return fGetEventInfoDialog
;
154 * Sets a get events info dialog implementation.
155 * @param getEventInfoDialog - a get events info dialog implementation
157 public void setGetEventInfoDialog(IGetEventInfoDialog getEventInfoDialog
) {
158 fGetEventInfoDialog
= getEventInfoDialog
;
162 * @return the confirmation dialog implementation
164 public IConfirmDialog
getConfirmDialog() {
165 if (fConfirmDialog
== null) {
166 fConfirmDialog
= new ConfirmDialog();
168 return fConfirmDialog
;
172 * Sets the confirmation dialog implementation
173 * @param confirmDialog
175 public void setConfirmDialog(IConfirmDialog confirmDialog
) {
176 fConfirmDialog
= confirmDialog
;