1 /**********************************************************************
2 * Copyright (c) 2012, 2013 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Bernd Hufmann - Initial API and implementation
11 * Simon Delisle - Updated for support of LTTng Tools 2.2
12 **********************************************************************/
13 package org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.dialogs
;
15 import org
.eclipse
.jface
.dialogs
.Dialog
;
16 import org
.eclipse
.jface
.dialogs
.IDialogConstants
;
17 import org
.eclipse
.jface
.dialogs
.MessageDialog
;
18 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.model
.IChannelInfo
;
19 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.model
.impl
.BufferType
;
20 import org
.eclipse
.linuxtools
.internal
.lttng2
.core
.control
.model
.impl
.ChannelInfo
;
21 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.Activator
;
22 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.messages
.Messages
;
23 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.model
.impl
.TargetNodeComponent
;
24 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.model
.impl
.TraceDomainComponent
;
25 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.service
.LTTngControlServiceConstants
;
26 import org
.eclipse
.swt
.SWT
;
27 import org
.eclipse
.swt
.events
.FocusEvent
;
28 import org
.eclipse
.swt
.events
.FocusListener
;
29 import org
.eclipse
.swt
.events
.SelectionAdapter
;
30 import org
.eclipse
.swt
.events
.SelectionEvent
;
31 import org
.eclipse
.swt
.events
.VerifyEvent
;
32 import org
.eclipse
.swt
.events
.VerifyListener
;
33 import org
.eclipse
.swt
.layout
.GridData
;
34 import org
.eclipse
.swt
.layout
.GridLayout
;
35 import org
.eclipse
.swt
.widgets
.Button
;
36 import org
.eclipse
.swt
.widgets
.Composite
;
37 import org
.eclipse
.swt
.widgets
.Control
;
38 import org
.eclipse
.swt
.widgets
.Group
;
39 import org
.eclipse
.swt
.widgets
.Label
;
40 import org
.eclipse
.swt
.widgets
.Shell
;
41 import org
.eclipse
.swt
.widgets
.Text
;
45 * Dialog box for collecting channel information when enabling a channel (which will be created).
48 * @author Bernd Hufmann
50 public class EnableChannelDialog
extends Dialog
implements IEnableChannelDialog
{
52 // ------------------------------------------------------------------------
54 // ------------------------------------------------------------------------
56 * The icon file for this dialog box.
58 public static final String ENABLE_CHANNEL_ICON_FILE
= "icons/elcl16/add_button.gif"; //$NON-NLS-1$
61 * To indicate that the default value will be used for this field
63 private static final String DEFAULT_TEXT
= "<" + Messages
.EnableChannelDialog_DefaultMessage
+ ">"; //$NON-NLS-1$ //$NON-NLS-2$
65 // ------------------------------------------------------------------------
67 // ------------------------------------------------------------------------
69 * The text widget for the channel name
71 private Text fChannelNameText
= null;
73 * The discard mode of the channel.
75 private Button fDiscardModeButton
= null;
77 * The overwrite mode of the channel.
79 private Button fOverwriteModeButton
= null;
81 * The sub-buffer size of the channel.
83 private Text fSubBufferSizeText
= null;
85 * The number of sub-buffers of the channel.
87 private Text fNumberOfSubBuffersText
= null;
89 * The switch timer interval of the channel.
91 private Text fSwitchTimerText
= null;
93 * The read timer interval of the channel.
95 private Text fReadTimerText
= null;
97 * Radio button for selecting kernel domain.
99 private Button fKernelButton
= null;
101 * Radio button for selecting UST domain.
103 private Button fUstButton
= null;
105 * The parent domain component where the channel node should be added.
106 * Null in case of creation on session level.
108 private TraceDomainComponent fDomain
= null;
110 * The target node component
112 private TargetNodeComponent fTargetNodeComponent
= null;
114 * Common verify listener for numeric text input.
116 private VerifyListener fVerifyListener
= null;
118 * Common focus listener
120 private FocusListener fFocusListener
= null;
122 * Output channel information.
124 private IChannelInfo fChannelInfo
= null;
126 * Output domain information. True in case of Kernel domain. False for UST.
128 private boolean fIsKernel
;
130 * Flag which indicates whether Kernel domain is available or not
132 private boolean fHasKernel
;
134 * Maximum size of trace files of the channel.
136 private Text fMaxSizeTraceText
= null;
138 * Maximum number of trace files of the channel.
140 private Text fMaxNumberTraceText
= null;
142 * CheckBox for selecting shared buffers (kernel onlyu).
144 private Button fSharedBuffersButton
= null;
146 * CheckBox for selecting per UID buffers.
148 private Button fPIDBuffersButton
= null;
150 * CheckBox for selecting per UID buffers.
152 private Button fUIDBuffersButton
= null;
154 * CheckBox to configure metadata channel
156 private Button fMetadataChannelButton
= null;
158 * Previous channel name
160 private String fPreviousChannelName
= null;
162 // ------------------------------------------------------------------------
164 // ------------------------------------------------------------------------
168 * @param shell - a shell for the display of the dialog
170 public EnableChannelDialog(Shell shell
) {
174 // Common verify listener
175 fVerifyListener
= new VerifyListener() {
177 public void verifyText(VerifyEvent e
) {
178 // only numbers and default are allowed.
179 e
.doit
= e
.text
.matches("[0-9]*") || e
.text
.matches(DEFAULT_TEXT
); //$NON-NLS-1$
183 // Common focus listener
184 fFocusListener
= new FocusListener() {
187 public void focusLost(FocusEvent e
) {
188 Text focusLostWidget
= (Text
) e
.widget
;
189 if (focusLostWidget
.getText().isEmpty()) {
190 focusLostWidget
.setText(DEFAULT_TEXT
);
191 focusLostWidget
.setForeground(getShell().getDisplay().getSystemColor(SWT
.COLOR_GRAY
));
196 public void focusGained(FocusEvent e
) {
197 Text focusGainedWidget
= (Text
) e
.widget
;
198 if (focusGainedWidget
.getText().equals(DEFAULT_TEXT
)) {
199 focusGainedWidget
.setText(""); //$NON-NLS-1$
200 focusGainedWidget
.setForeground(getShell().getDisplay().getSystemColor(SWT
.COLOR_BLACK
));
205 setShellStyle(SWT
.RESIZE
);
208 // ------------------------------------------------------------------------
210 // ------------------------------------------------------------------------
213 public IChannelInfo
getChannelInfo() {
218 public void setDomainComponent(TraceDomainComponent domain
) {
220 if (fDomain
!= null) {
221 fIsKernel
= fDomain
.isKernel();
228 public boolean isKernel() {
233 public void setHasKernel(boolean hasKernel
) {
234 if (fDomain
!= null) {
235 fIsKernel
= fDomain
.isKernel();
237 fIsKernel
= hasKernel
;
240 fHasKernel
= hasKernel
;
244 public void setTargetNodeComponent(TargetNodeComponent node
) {
245 fTargetNodeComponent
= node
;
248 // ------------------------------------------------------------------------
250 // ------------------------------------------------------------------------
253 protected void configureShell(Shell newShell
) {
254 super.configureShell(newShell
);
255 newShell
.setText(Messages
.TraceControl_EnableChannelDialogTitle
);
256 newShell
.setImage(Activator
.getDefault().loadIcon(ENABLE_CHANNEL_ICON_FILE
));
260 protected Control
createDialogArea(Composite parent
) {
263 if (fTargetNodeComponent
.isBufferTypeConfigSupported()) {
268 Composite dialogComposite
= new Composite(parent
, SWT
.NONE
);
269 GridLayout layout
= new GridLayout(1, true);
270 dialogComposite
.setLayout(layout
);
272 Composite commonModeGroup
= new Composite(dialogComposite
, SWT
.NONE
);
273 layout
= new GridLayout(3, true);
274 commonModeGroup
.setLayout(layout
);
276 Label channelNameLabel
= new Label(commonModeGroup
, SWT
.RIGHT
);
277 channelNameLabel
.setText(Messages
.TraceControl_EnableChannelNameLabel
);
278 fChannelNameText
= new Text(commonModeGroup
, SWT
.NONE
);
279 fChannelNameText
.setToolTipText(Messages
.TraceControl_EnableChannelNameTooltip
);
281 Label subBufferSizeLabel
= new Label(commonModeGroup
, SWT
.RIGHT
);
282 subBufferSizeLabel
.setText(Messages
.TraceControl_SubBufferSizePropertyName
);
283 fSubBufferSizeText
= new Text(commonModeGroup
, SWT
.NONE
);
284 fSubBufferSizeText
.setToolTipText(Messages
.TraceControl_EnableChannelSubBufferSizeTooltip
);
285 fSubBufferSizeText
.addVerifyListener(fVerifyListener
);
286 fSubBufferSizeText
.addFocusListener(fFocusListener
);
287 fSubBufferSizeText
.setForeground(getShell().getDisplay().getSystemColor(SWT
.COLOR_GRAY
));
289 Label numSubBufferLabel
= new Label(commonModeGroup
, SWT
.RIGHT
);
290 numSubBufferLabel
.setText(Messages
.TraceControl_NbSubBuffersPropertyName
);
291 fNumberOfSubBuffersText
= new Text(commonModeGroup
, SWT
.NONE
);
292 fNumberOfSubBuffersText
.setToolTipText(Messages
.TraceControl_EnableChannelNbSubBuffersTooltip
);
293 fNumberOfSubBuffersText
.addVerifyListener(fVerifyListener
);
294 fNumberOfSubBuffersText
.addFocusListener(fFocusListener
);
296 Label switchTimerLabel
= new Label(commonModeGroup
, SWT
.RIGHT
);
297 switchTimerLabel
.setText(Messages
.TraceControl_SwitchTimerPropertyName
);
298 fSwitchTimerText
= new Text(commonModeGroup
, SWT
.NONE
);
299 fSwitchTimerText
.setToolTipText(Messages
.TraceControl_EnableChannelSwitchTimerTooltip
);
300 fSwitchTimerText
.addVerifyListener(fVerifyListener
);
301 fSwitchTimerText
.addFocusListener(fFocusListener
);
303 Label readTimerLabel
= new Label(commonModeGroup
, SWT
.RIGHT
);
304 readTimerLabel
.setText(Messages
.TraceControl_ReadTimerPropertyName
);
305 fReadTimerText
= new Text(commonModeGroup
, SWT
.NONE
);
306 fReadTimerText
.setToolTipText(Messages
.TraceControl_EnableChannelReadTimerTooltip
);
307 fReadTimerText
.addVerifyListener(fVerifyListener
);
308 fReadTimerText
.addFocusListener(fFocusListener
);
310 if (fTargetNodeComponent
.isTraceFileRotationSupported()) {
311 Label maxSizeTraceFilesLabel
= new Label(commonModeGroup
, SWT
.RIGHT
);
312 maxSizeTraceFilesLabel
.setText(Messages
.TraceControl_MaxSizeTraceFilesPropertyName
);
313 fMaxSizeTraceText
= new Text(commonModeGroup
, SWT
.NONE
);
314 fMaxSizeTraceText
.setToolTipText(Messages
.TraceControl_EnbleChannelMaxSizeTraceFilesTooltip
);
315 fMaxSizeTraceText
.addVerifyListener(fVerifyListener
);
316 fMaxSizeTraceText
.addFocusListener(fFocusListener
);
318 Label maxNumTraceFilesLabel
= new Label(commonModeGroup
, SWT
.RIGHT
);
319 maxNumTraceFilesLabel
.setText(Messages
.TraceControl_MaxNumTraceFilesPropertyName
);
320 fMaxNumberTraceText
= new Text(commonModeGroup
, SWT
.NONE
);
321 fMaxNumberTraceText
.setToolTipText(Messages
.TraceControl_EnbleChannelMaxNumTraceFilesTooltip
);
322 fMaxNumberTraceText
.addVerifyListener(fVerifyListener
);
323 fMaxNumberTraceText
.addFocusListener(fFocusListener
);
326 if (fTargetNodeComponent
.isPeriodicalMetadataFlushSupported()) {
327 fMetadataChannelButton
= new Button(commonModeGroup
, SWT
.CHECK
);
328 fMetadataChannelButton
.setText(Messages
.TraceControl_ConfigureMetadataChannelName
);
329 fMetadataChannelButton
.setSelection(false);
331 fMetadataChannelButton
.addSelectionListener(new SelectionAdapter() {
333 public void widgetSelected(SelectionEvent e
) {
334 if (fMetadataChannelButton
.getSelection()) {
335 fPreviousChannelName
= fChannelNameText
.getText();
336 fChannelNameText
.setText("metadata"); //$NON-NLS-1$
337 fChannelNameText
.setEnabled(false);
339 fChannelNameText
.setText(fPreviousChannelName
);
340 fChannelNameText
.setEnabled(true);
345 Group discardModeGroup
= new Group(dialogComposite
, SWT
.SHADOW_NONE
);
346 discardModeGroup
.setText(Messages
.TraceControl_EnableChannelDiscardModeGroupName
);
347 layout
= new GridLayout(numColumn
, true);
348 discardModeGroup
.setLayout(layout
);
350 fDiscardModeButton
= new Button(discardModeGroup
, SWT
.RADIO
);
351 fDiscardModeButton
.setText(Messages
.TraceControl_EnableChannelDiscardModeLabel
);
352 fDiscardModeButton
.setToolTipText(Messages
.TraceControl_EnableChannelDiscardModeTooltip
);
353 fDiscardModeButton
.setSelection(true);
355 fOverwriteModeButton
= new Button(discardModeGroup
, SWT
.RADIO
);
356 fOverwriteModeButton
.setText(Messages
.TraceControl_EnableChannelOverwriteModeLabel
);
357 fOverwriteModeButton
.setToolTipText(Messages
.TraceControl_EnableChannelOverwriteModeTooltip
);
358 fOverwriteModeButton
.setSelection(false);
360 Group domainGroup
= new Group(dialogComposite
, SWT
.SHADOW_NONE
);
361 domainGroup
.setText(Messages
.TraceControl_DomainDisplayName
);
362 layout
= new GridLayout(numColumn
, true);
363 domainGroup
.setLayout(layout
);
365 fKernelButton
= new Button(domainGroup
, SWT
.RADIO
);
366 fKernelButton
.setText(Messages
.TraceControl_KernelDomainDisplayName
);
367 fKernelButton
.setSelection(fIsKernel
);
368 fUstButton
= new Button(domainGroup
, SWT
.RADIO
);
369 fUstButton
.setText(Messages
.TraceControl_UstDisplayName
);
370 fUstButton
.setSelection(!fIsKernel
);
372 if (fTargetNodeComponent
.isBufferTypeConfigSupported()) {
373 Group bufferTypeGroup
= new Group(dialogComposite
, SWT
.SHADOW_NONE
);
374 bufferTypeGroup
.setText(Messages
.TraceControl_BufferTypeDisplayName
);
375 layout
= new GridLayout(numColumn
, true);
376 bufferTypeGroup
.setLayout(layout
);
378 GridData data
= new GridData(GridData
.FILL
, GridData
.BEGINNING
, false, false);
379 data
.horizontalSpan
= 3;
380 bufferTypeGroup
.setLayoutData(data
);
382 fSharedBuffersButton
= new Button(bufferTypeGroup
, SWT
.RADIO
);
383 fSharedBuffersButton
.setText(Messages
.TraceControl_SharedBuffersDisplayName
);
384 fSharedBuffersButton
.setSelection(fIsKernel
);
385 fSharedBuffersButton
.setEnabled(false);
387 fPIDBuffersButton
= new Button(bufferTypeGroup
, SWT
.RADIO
);
388 fPIDBuffersButton
.setText(Messages
.TraceControl_PerPidBuffersDisplayName
);
389 fPIDBuffersButton
.setToolTipText(Messages
.TraceControl_PerPidBuffersTooltip
);
390 fPIDBuffersButton
.setSelection(false);
392 fUIDBuffersButton
= new Button(bufferTypeGroup
, SWT
.RADIO
);
393 fUIDBuffersButton
.setText(Messages
.TraceControl_PerUidBuffersDisplayName
);
394 fUIDBuffersButton
.setToolTipText(Messages
.TraceControl_PerPidBuffersTooltip
);
395 fUIDBuffersButton
.setSelection(false);
397 fUIDBuffersButton
.setEnabled(!fIsKernel
);
398 fPIDBuffersButton
.setEnabled(!fIsKernel
);
400 // Update buffers type buttons depending on UST or Kernel
401 fUstButton
.addSelectionListener(new SelectionAdapter() {
403 public void widgetSelected(SelectionEvent e
) {
404 if (fUstButton
.getSelection()) {
405 fSharedBuffersButton
.setSelection(false);
406 fPIDBuffersButton
.setSelection(false);
407 fUIDBuffersButton
.setSelection(false);
408 fPIDBuffersButton
.setEnabled(true);
409 fUIDBuffersButton
.setEnabled(true);
411 fSharedBuffersButton
.setSelection(true);
412 fPIDBuffersButton
.setSelection(false);
413 fUIDBuffersButton
.setSelection(false);
414 fPIDBuffersButton
.setEnabled(false);
415 fUIDBuffersButton
.setEnabled(false);
421 if ((fDomain
!= null) || (!fHasKernel
)) {
422 fKernelButton
.setEnabled(false);
423 fUstButton
.setEnabled(false);
425 if (fTargetNodeComponent
.isBufferTypeConfigSupported()) {
426 fSharedBuffersButton
.setEnabled(false);
427 fUIDBuffersButton
.setEnabled(!fHasKernel
);
428 fPIDBuffersButton
.setEnabled(!fHasKernel
);
429 setBufferTypeButtonSelection();
434 GridData data
= new GridData(GridData
.FILL
, GridData
.BEGINNING
, false, false);
435 data
.horizontalSpan
= 3;
436 discardModeGroup
.setLayoutData(data
);
437 data
= new GridData(SWT
.BEGINNING
, SWT
.BEGINNING
, true, true);
438 fDiscardModeButton
.setLayoutData(data
);
439 data
= new GridData(SWT
.BEGINNING
, SWT
.BEGINNING
, true, true);
440 fOverwriteModeButton
.setLayoutData(data
);
442 data
= new GridData(GridData
.FILL
, GridData
.BEGINNING
, false, false);
443 data
.horizontalSpan
= 3;
444 domainGroup
.setLayoutData(data
);
446 data
= new GridData(SWT
.BEGINNING
, SWT
.BEGINNING
, true, true);
447 fKernelButton
.setLayoutData(data
);
448 data
= new GridData(SWT
.BEGINNING
, SWT
.BEGINNING
, true, true);
449 fUstButton
.setLayoutData(data
);
450 if (fTargetNodeComponent
.isBufferTypeConfigSupported()) {
451 data
= new GridData(SWT
.BEGINNING
, SWT
.BEGINNING
, true, true);
452 fSharedBuffersButton
.setLayoutData(data
);
453 data
= new GridData(SWT
.BEGINNING
, SWT
.BEGINNING
, true, true);
454 fPIDBuffersButton
.setLayoutData(data
);
455 data
= new GridData(SWT
.BEGINNING
, SWT
.BEGINNING
, true, true);
456 fUIDBuffersButton
.setLayoutData(data
);
459 if (fTargetNodeComponent
.isPeriodicalMetadataFlushSupported()) {
460 data
= new GridData(SWT
.BEGINNING
, SWT
.BEGINNING
, true, true);
461 data
.horizontalSpan
= numColumn
;
462 fMetadataChannelButton
.setLayoutData(data
);
465 data
= new GridData(GridData
.FILL_HORIZONTAL
);
466 data
.horizontalSpan
= 2;
468 fChannelNameText
.setLayoutData(data
);
469 fSubBufferSizeText
.setLayoutData(data
);
470 fNumberOfSubBuffersText
.setLayoutData(data
);
471 fSwitchTimerText
.setLayoutData(data
);
472 fReadTimerText
.setLayoutData(data
);
473 if (fTargetNodeComponent
.isTraceFileRotationSupported()) {
474 fMaxNumberTraceText
.setLayoutData(data
);
475 fMaxSizeTraceText
.setLayoutData(data
);
480 return dialogComposite
;
484 protected void createButtonsForButtonBar(Composite parent
) {
485 createButton(parent
, IDialogConstants
.DETAILS_ID
, "&Default", true); //$NON-NLS-1$
486 createButton(parent
, IDialogConstants
.CANCEL_ID
, "&Cancel", true); //$NON-NLS-1$
487 createButton(parent
, IDialogConstants
.OK_ID
, "&Ok", true); //$NON-NLS-1$
491 protected void okPressed() {
492 // Set channel information
493 ChannelInfo channelInfo
= new ChannelInfo(fChannelNameText
.getText());
494 channelInfo
.setSubBufferSize(fSubBufferSizeText
.getText().equals(DEFAULT_TEXT
) ? LTTngControlServiceConstants
.UNUSED_VALUE
: Long
.parseLong(fSubBufferSizeText
.getText()));
495 channelInfo
.setNumberOfSubBuffers(fNumberOfSubBuffersText
.getText().equals(DEFAULT_TEXT
) ? LTTngControlServiceConstants
.UNUSED_VALUE
: Integer
.parseInt(fNumberOfSubBuffersText
.getText()));
496 channelInfo
.setSwitchTimer(fSwitchTimerText
.getText().equals(DEFAULT_TEXT
) ? LTTngControlServiceConstants
.UNUSED_VALUE
: Long
.parseLong(fSwitchTimerText
.getText()));
497 channelInfo
.setReadTimer(fReadTimerText
.getText().equals(DEFAULT_TEXT
) ? LTTngControlServiceConstants
.UNUSED_VALUE
: Long
.parseLong(fReadTimerText
.getText()));
498 channelInfo
.setOverwriteMode(fOverwriteModeButton
.getSelection());
499 if (fTargetNodeComponent
.isTraceFileRotationSupported()) {
500 channelInfo
.setMaxSizeTraceFiles(fMaxSizeTraceText
.getText().equals(DEFAULT_TEXT
) ? LTTngControlServiceConstants
.UNUSED_VALUE
: Integer
.parseInt(fMaxSizeTraceText
.getText()));
501 channelInfo
.setMaxNumberTraceFiles(fMaxNumberTraceText
.getText().equals(DEFAULT_TEXT
) ? LTTngControlServiceConstants
.UNUSED_VALUE
: Integer
.parseInt(fMaxNumberTraceText
.getText()));
503 if (fTargetNodeComponent
.isBufferTypeConfigSupported()) {
504 if (fSharedBuffersButton
.getSelection()) {
505 channelInfo
.setBufferType(BufferType
.BUFFER_SHARED
);
506 } else if (fPIDBuffersButton
.getSelection()) {
507 channelInfo
.setBufferType(BufferType
.BUFFER_PER_PID
);
508 } else if (fUIDBuffersButton
.getSelection()) {
509 channelInfo
.setBufferType(BufferType
.BUFFER_PER_UID
);
511 channelInfo
.setBufferType(BufferType
.BUFFER_TYPE_UNKNOWN
);
515 fIsKernel
= fKernelButton
.getSelection();
517 // Check for invalid names
518 if (!channelInfo
.getName().matches("^[a-zA-Z0-9\\-\\_]{1,}$")) { //$NON-NLS-1$
519 MessageDialog
.openError(getShell(),
520 Messages
.TraceControl_EnableChannelDialogTitle
,
521 Messages
.TraceControl_InvalidChannelNameError
+ " (" + channelInfo
.getName() + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$
525 // Check for duplicate names
526 if (fDomain
!= null && fDomain
.containsChild(channelInfo
.getName())) {
527 MessageDialog
.openError(getShell(),
528 Messages
.TraceControl_EnableChannelDialogTitle
,
529 Messages
.TraceControl_ChannelAlreadyExistsError
+ " (" + channelInfo
.getName() + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$
533 fChannelInfo
= channelInfo
;
535 // validation successful -> call super.okPressed()
540 protected void buttonPressed(int buttonId
) {
541 if (buttonId
== IDialogConstants
.DETAILS_ID
) {
545 super.buttonPressed(buttonId
);
548 // ------------------------------------------------------------------------
550 // ------------------------------------------------------------------------
553 * Sets default value depending on Kernel or UST
555 private void setDefaults() {
556 fSwitchTimerText
.setText(DEFAULT_TEXT
);
557 fSwitchTimerText
.setForeground(getShell().getDisplay().getSystemColor(SWT
.COLOR_GRAY
));
558 fReadTimerText
.setText(DEFAULT_TEXT
);
559 fReadTimerText
.setForeground(getShell().getDisplay().getSystemColor(SWT
.COLOR_GRAY
));
560 fOverwriteModeButton
.setSelection(IChannelInfo
.DEFAULT_OVERWRITE_MODE
);
561 if (fTargetNodeComponent
.isTraceFileRotationSupported()) {
562 fMaxSizeTraceText
.setText(DEFAULT_TEXT
);
563 fMaxSizeTraceText
.setForeground(getShell().getDisplay().getSystemColor(SWT
.COLOR_GRAY
));
564 fMaxNumberTraceText
.setText(DEFAULT_TEXT
);
565 fMaxNumberTraceText
.setForeground(getShell().getDisplay().getSystemColor(SWT
.COLOR_GRAY
));
567 fSubBufferSizeText
.setText(DEFAULT_TEXT
);
568 fSubBufferSizeText
.setForeground(getShell().getDisplay().getSystemColor(SWT
.COLOR_GRAY
));
569 fNumberOfSubBuffersText
.setText(DEFAULT_TEXT
);
570 fNumberOfSubBuffersText
.setForeground(getShell().getDisplay().getSystemColor(SWT
.COLOR_GRAY
));
571 if (fTargetNodeComponent
.isBufferTypeConfigSupported()) {
572 setBufferTypeButtonSelection();
576 private void setBufferTypeButtonSelection() {
577 if ((fDomain
!= null) && fDomain
.getBufferType() != null) {
578 switch (fDomain
.getBufferType()) {
580 fPIDBuffersButton
.setSelection(true);
583 fUIDBuffersButton
.setSelection(true);
586 fSharedBuffersButton
.setSelection(true);