001/***************************************************************************** 002 * Copyright by The HDF Group. * 003 * Copyright by the Board of Trustees of the University of Illinois. * 004 * All rights reserved. * 005 * * 006 * This file is part of the HDF Java Products distribution. * 007 * The full copyright notice, including terms governing use, modification, * 008 * and redistribution, is contained in the files COPYING and Copyright.html. * 009 * COPYING can be found at the root of the source code distribution tree. * 010 * Or, see https://support.hdfgroup.org/products/licenses.html * 011 * If you do not have access to either file, you may request a copy from * 012 * help@hdfgroup.org. * 013 ****************************************************************************/ 014 015package hdf.view.dialog; 016 017import java.awt.GraphicsEnvironment; 018import java.io.File; 019 020import org.eclipse.swt.SWT; 021import org.eclipse.swt.events.SelectionAdapter; 022import org.eclipse.swt.events.SelectionEvent; 023import org.eclipse.swt.graphics.Font; 024import org.eclipse.swt.layout.GridData; 025import org.eclipse.swt.layout.GridLayout; 026import org.eclipse.swt.widgets.Button; 027import org.eclipse.swt.widgets.Combo; 028import org.eclipse.swt.widgets.Composite; 029import org.eclipse.swt.widgets.Control; 030import org.eclipse.swt.widgets.DirectoryDialog; 031import org.eclipse.swt.widgets.Display; 032import org.eclipse.swt.widgets.FileDialog; 033import org.eclipse.swt.widgets.Label; 034import org.eclipse.swt.widgets.Text; 035 036import hdf.view.Tools; 037import hdf.view.ViewProperties; 038 039/** 040 * UserOptionsGeneralPage.java - Configuration page for general application settings. 041 */ 042public class UserOptionsGeneralPage extends UserOptionsDefaultPage { 043 private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(UserOptionsGeneralPage.class); 044 045 private Text UGField, workField, maxMemberField, startMemberField, timerRefreshField; 046 047 private Combo fontSizeChoice, fontTypeChoice, delimiterChoice, imageOriginChoice, indexBaseChoice; 048 049 private Button checkCurrentUserDir, checkUserHomeDir, checkAutoContrast, checkShowValues; 050 private Button currentDirButton, userHomeButton, rwButton, helpButton; 051 private Button checkReadOnly, checkReadAll; 052 053 private boolean isFontChanged; 054 private boolean isUserGuideChanged; 055 private boolean isWorkDirChanged; 056 057 private String workDir; 058 059 private static String fontname; 060 061 /** 062 * Configuration page for general application settings. 063 */ 064 public UserOptionsGeneralPage() { 065 super("General Settings"); 066 isFontChanged = false; 067 isUserGuideChanged = false; 068 isWorkDirChanged = false; 069 } 070 071 /** 072 * Performs special processing when this page's Defaults button has been pressed. 073 */ 074 @Override 075 public void performDefaults() { 076 super.performDefaults(); 077 } 078 079 /** 080 * Notifies that the OK button of this page's container has been pressed. 081 * 082 * @return <code>false</code> to abort the container's OK processing and 083 * <code>true</code> to allow the OK to happen 084 */ 085 @Override 086 public boolean performOk() { 087 getPreferenceStore(); 088 089 if (UGField != null) { 090 String UGPath = UGField.getText(); 091 if ((UGPath != null) && (UGPath.length() > 0)) { 092 UGPath = UGPath.trim(); 093 isUserGuideChanged = !UGPath.equals(ViewProperties.getUsersGuide()); 094 ViewProperties.setUsersGuide(UGPath); 095 } 096 } 097 098 if (workField != null) { 099 String workPath = workField.getText(); 100 if (checkCurrentUserDir.getSelection()) 101 workPath = System.getProperty("user.dir"); 102 else if (checkUserHomeDir.getSelection()) 103 workPath = System.getProperty("user.home"); 104 105 if ((workPath != null) && (workPath.length() > 0)) { 106 workPath = workPath.trim(); 107 isWorkDirChanged = !workPath.equals(ViewProperties.getWorkDir()); 108 ViewProperties.setWorkDir(workPath); 109 } 110 } 111 112 // set font size and type 113 try { 114 if (fontTypeChoice != null) { 115 String ftype = fontTypeChoice.getItem(fontTypeChoice.getSelectionIndex()); 116 int fsize = Integer.parseInt(fontSizeChoice.getItem(fontSizeChoice.getSelectionIndex())); 117 log.trace("performOk: save font options {} - {}", ftype, fsize); 118 119 if (ViewProperties.getFontSize() != fsize) { 120 ViewProperties.setFontSize(fsize); 121 isFontChanged = true; 122 log.trace("performOk: props font size {}", ViewProperties.getFontSize()); 123 } 124 125 if (!ftype.equalsIgnoreCase(ViewProperties.getFontType())) { 126 ViewProperties.setFontType(ftype); 127 isFontChanged = true; 128 log.trace("performOk: props font {}", ViewProperties.getFontType()); 129 } 130 } 131 } 132 catch (Exception ex) { 133 isFontChanged = false; 134 } 135 136 // set file access 137 if (checkReadOnly != null) { 138 if (checkReadOnly.getSelection()) 139 ViewProperties.setReadOnly(true); 140 else 141 ViewProperties.setReadOnly(false); 142 } 143 144 // set timer refresh value (msec) 145 try { 146 int timermsec = Integer.parseInt(timerRefreshField.getText()); 147 ViewProperties.setTimerRefresh(timermsec); 148 } 149 catch (Exception ex) { 150 } 151 152 // set data delimiter 153 if (delimiterChoice != null) 154 ViewProperties.setDataDelimiter(delimiterChoice.getItem(delimiterChoice.getSelectionIndex())); 155 if (imageOriginChoice != null) 156 ViewProperties.setImageOrigin(imageOriginChoice.getItem(imageOriginChoice.getSelectionIndex())); 157 158 if (checkReadAll != null) { 159 if (checkReadAll.getSelection()) { 160 ViewProperties.setStartMembers(0); 161 ViewProperties.setMaxMembers(-1); 162 } 163 else { 164 try { 165 int maxsize = Integer.parseInt(maxMemberField.getText()); 166 ViewProperties.setMaxMembers(maxsize); 167 } 168 catch (Exception ex) { 169 } 170 171 try { 172 int startsize = Integer.parseInt(startMemberField.getText()); 173 ViewProperties.setStartMembers(startsize); 174 } 175 catch (Exception ex) { 176 } 177 } 178 } 179 180 if (checkAutoContrast != null) 181 ViewProperties.setAutoContrast(checkAutoContrast.getSelection()); 182 if (checkShowValues != null) 183 ViewProperties.setShowImageValue(checkShowValues.getSelection()); 184 185 if (indexBaseChoice != null) { 186 if (indexBaseChoice.getSelectionIndex() == 0) 187 ViewProperties.setIndexBase1(false); 188 else 189 ViewProperties.setIndexBase1(true); 190 } 191 192 return true; 193 } 194 195 /** 196 * Checks if the Font setting changed. 197 * 198 * @return true if the font changed. 199 */ 200 public boolean isFontChanged() { 201 return isFontChanged; 202 } 203 204 /** 205 * Checks if the location for the UserGuide changed. 206 * 207 * @return true if the location of the UserGuide changed. 208 */ 209 public boolean isUserGuideChanged() { 210 return isUserGuideChanged; 211 } 212 213 /** 214 * Checks if the location of the WorkDir changed. 215 * 216 * @return true if the working directory changed. 217 */ 218 public boolean isWorkDirChanged() { 219 return isWorkDirChanged; 220 } 221 222 /** 223 * Loads all stored values in the <code>FieldEditor</code>s. 224 */ 225 protected void load() { 226 getPreferenceStore(); 227 228 try { 229 curFont = new Font( 230 Display.getCurrent(), 231 ViewProperties.getFontType(), 232 ViewProperties.getFontSize(), 233 SWT.NORMAL); 234 } 235 catch (Exception ex) { 236 curFont = null; 237 } 238 239 workDir = ViewProperties.getWorkDir(); 240 if (workDir == null) 241 workDir = rootDir; 242 243 workField.setText(workDir); 244 245 if (workDir.equals(System.getProperty("user.dir"))) { 246 checkCurrentUserDir.setSelection(true); 247 checkUserHomeDir.setSelection(false); 248 workField.setEnabled(false); 249 } 250 else if (workDir.equals(System.getProperty("user.home"))) { 251 checkCurrentUserDir.setSelection(false); 252 checkUserHomeDir.setSelection(true); 253 workField.setEnabled(false); 254 } 255 else { 256 checkCurrentUserDir.setSelection(false); 257 checkUserHomeDir.setSelection(false); 258 workField.setEnabled(true); 259 } 260 261 log.trace("UserOptionsGeneralPage: workDir={}", workDir); 262 263 UGField.setText(ViewProperties.getUsersGuide()); 264 265 checkReadOnly.setSelection(ViewProperties.isReadOnly()); 266 267 rwButton.setSelection(!ViewProperties.isReadOnly()); 268 269 String fontsize = String.valueOf(ViewProperties.getFontSize()); 270 log.trace("performOk: load General options fontsize={}", fontsize); 271 try { 272 int selectionIndex = fontSizeChoice.indexOf(fontsize); 273 fontSizeChoice.select(selectionIndex); 274 } 275 catch (Exception ex) { 276 fontSizeChoice.select(0); 277 } 278 279 fontname = ViewProperties.getFontType(); 280 log.trace("performOk: load General options fontname={}", fontname); 281 try { 282 int selectionIndex = fontTypeChoice.indexOf(fontname); 283 fontTypeChoice.select(selectionIndex); 284 } 285 catch (Exception ex) { 286 String sysFontName = Display.getDefault().getSystemFont().getFontData()[0].getName(); 287 288 try { 289 int selectionIndex = fontTypeChoice.indexOf(sysFontName); 290 fontTypeChoice.select(selectionIndex); 291 } 292 catch (Exception ex2) { 293 fontTypeChoice.select(0); 294 } 295 } 296 297 checkAutoContrast.setSelection(ViewProperties.isAutoContrast()); 298 299 checkShowValues.setSelection(ViewProperties.showImageValues()); 300 301 String[] imageOriginChoices = { ViewProperties.ORIGIN_UL, ViewProperties.ORIGIN_LL, ViewProperties.ORIGIN_UR, 302 ViewProperties.ORIGIN_LR }; 303 imageOriginChoice.setItems(imageOriginChoices); 304 305 try { 306 int selectionIndex = imageOriginChoice.indexOf(ViewProperties.getImageOrigin()); 307 imageOriginChoice.select(selectionIndex); 308 } 309 catch (Exception ex) { 310 imageOriginChoice.select(0); 311 } 312 313 // helpButton.setImage(ViewProperties.getHelpIcon()); 314 315 if (ViewProperties.isIndexBase1()) 316 indexBaseChoice.select(1); 317 else 318 indexBaseChoice.select(0); 319 320 String[] delimiterChoices = { ViewProperties.DELIMITER_TAB, ViewProperties.DELIMITER_COMMA, 321 ViewProperties.DELIMITER_SPACE, ViewProperties.DELIMITER_COLON, ViewProperties.DELIMITER_SEMI_COLON }; 322 delimiterChoice.setItems(delimiterChoices); 323 324 try { 325 int selectionIndex = delimiterChoice.indexOf(ViewProperties.getDataDelimiter()); 326 delimiterChoice.select(selectionIndex); 327 } 328 catch (Exception ex) { 329 delimiterChoice.select(0); 330 } 331 332 timerRefreshField.setText(String.valueOf(ViewProperties.getTimerRefresh())); 333 334 int nMax = ViewProperties.getMaxMembers(); 335 checkReadAll.setSelection((nMax<=0) || (nMax==Integer.MAX_VALUE)); 336 337 startMemberField.setText(String.valueOf(ViewProperties.getStartMembers())); 338 339 maxMemberField.setText(String.valueOf(ViewProperties.getMaxMembers())); 340 } 341 342 /** 343 * Creates and returns the SWT control for the customized body of this 344 * preference page under the given parent composite. 345 * 346 * @param parent 347 * the parent composite 348 * 349 * @return the new control 350 */ 351 @Override 352 protected Control createContents(Composite parent) { 353 shell = parent.getShell(); 354 Composite composite = new Composite(parent, SWT.NONE); 355 composite.setLayout(new GridLayout()); 356 357 org.eclipse.swt.widgets.Group workingDirectoryGroup = new org.eclipse.swt.widgets.Group(composite, SWT.NONE); 358 workingDirectoryGroup.setLayout(new GridLayout(3, false)); 359 workingDirectoryGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); 360 workingDirectoryGroup.setFont(curFont); 361 workingDirectoryGroup.setText("Default Working Directory"); 362 363 checkCurrentUserDir = new Button(workingDirectoryGroup, SWT.CHECK); 364 checkCurrentUserDir.setFont(curFont); 365 checkCurrentUserDir.setText("\"User Work\" or"); 366 checkCurrentUserDir.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 367 checkCurrentUserDir.addSelectionListener(new SelectionAdapter() { 368 @Override 369 public void widgetSelected(SelectionEvent e) { 370 boolean isCheckCurrentUserDirSelected = checkCurrentUserDir.getSelection(); 371 if (isCheckCurrentUserDirSelected) 372 checkUserHomeDir.setSelection(false); 373 workField.setEnabled(!isCheckCurrentUserDirSelected); 374 currentDirButton.setEnabled(!isCheckCurrentUserDirSelected); 375 } 376 }); 377 378 checkUserHomeDir = new Button(workingDirectoryGroup, SWT.CHECK); 379 checkUserHomeDir.setFont(curFont); 380 checkUserHomeDir.setText("\"User Home\" or"); 381 checkUserHomeDir.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 382 checkUserHomeDir.addSelectionListener(new SelectionAdapter() { 383 @Override 384 public void widgetSelected(SelectionEvent e) { 385 boolean isCheckUserHomeDirSelected = checkUserHomeDir.getSelection(); 386 if (isCheckUserHomeDirSelected) 387 checkCurrentUserDir.setSelection(false); 388 workField.setEnabled(!isCheckUserHomeDirSelected); 389 currentDirButton.setEnabled(!isCheckUserHomeDirSelected); 390 } 391 }); 392 393 workField = new Text(workingDirectoryGroup, SWT.SINGLE | SWT.BORDER); 394 workField.setFont(curFont); 395 workField.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); 396 397 currentDirButton = new Button(workingDirectoryGroup, SWT.PUSH); 398 currentDirButton.setFont(curFont); 399 currentDirButton.setText("Browse..."); 400 currentDirButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 401 currentDirButton.addSelectionListener(new SelectionAdapter() { 402 @Override 403 public void widgetSelected(SelectionEvent e) { 404 final DirectoryDialog dChooser = new DirectoryDialog(shell); 405 dChooser.setFilterPath(workDir); 406 dChooser.setText("Select a Directory"); 407 408 String dir = dChooser.open(); 409 410 if(dir == null) return; 411 412 workField.setText(dir); 413 } 414 }); 415 416 org.eclipse.swt.widgets.Group helpDocumentGroup = new org.eclipse.swt.widgets.Group(composite, SWT.NONE); 417 helpDocumentGroup.setLayout(new GridLayout(3, false)); 418 helpDocumentGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); 419 helpDocumentGroup.setFont(curFont); 420 helpDocumentGroup.setText("Help Document"); 421 422 Label label = new Label(helpDocumentGroup, SWT.RIGHT); 423 label.setFont(curFont); 424 label.setText("User's Guide: "); 425 426 UGField = new Text(helpDocumentGroup, SWT.SINGLE | SWT.BORDER); 427 UGField.setFont(curFont); 428 UGField.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); 429 430 Button browseButton = new Button(helpDocumentGroup, SWT.PUSH); 431 browseButton.setFont(curFont); 432 browseButton.setText("Browse..."); 433 browseButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 434 browseButton.addSelectionListener(new SelectionAdapter() { 435 @Override 436 public void widgetSelected(SelectionEvent e) { 437 final FileDialog fChooser = new FileDialog(shell, SWT.OPEN); 438 fChooser.setFilterPath(rootDir); 439 fChooser.setFilterExtensions(new String[] {"*"}); 440 fChooser.setFilterNames(new String[] {"All Files"}); 441 fChooser.setFilterIndex(0); 442 443 if(fChooser.open() == null) { 444 return; 445 } 446 447 File chosenFile = new File(fChooser.getFilterPath() + File.separator + fChooser.getFileName()); 448 449 if(!chosenFile.exists()) { 450 // Give an error 451 return; 452 } 453 454 UGField.setText(chosenFile.getAbsolutePath()); 455 } 456 }); 457 458 org.eclipse.swt.widgets.Group fileAccessModeGroup = new org.eclipse.swt.widgets.Group(composite, SWT.NONE); 459 fileAccessModeGroup.setLayout(new GridLayout(2, true)); 460 fileAccessModeGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 461 fileAccessModeGroup.setFont(curFont); 462 fileAccessModeGroup.setText("Default File Access Mode"); 463 464 checkReadOnly = new Button(fileAccessModeGroup, SWT.RADIO); 465 checkReadOnly.setFont(curFont); 466 checkReadOnly.setText("Read Only"); 467 checkReadOnly.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, false, false)); 468 469 rwButton = new Button(fileAccessModeGroup, SWT.RADIO); 470 rwButton.setFont(curFont); 471 rwButton.setText("Read/Write"); 472 rwButton.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, false, false)); 473 474 org.eclipse.swt.widgets.Group textFontGroup = new org.eclipse.swt.widgets.Group(composite, SWT.NONE); 475 textFontGroup.setLayout(new GridLayout(4, false)); 476 textFontGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 477 textFontGroup.setFont(curFont); 478 textFontGroup.setText("Text Font"); 479 480 label = new Label(textFontGroup, SWT.RIGHT); 481 label.setFont(curFont); 482 label.setText("Font Size: "); 483 484 String[] fontSizeChoices = { "8", "10", "12", "14", "16", "18", "20", "22", "24", "26", "28", "30", "32", "34", "36", "48" }; 485 fontSizeChoice = new Combo(textFontGroup, SWT.SINGLE | SWT.READ_ONLY); 486 fontSizeChoice.setFont(curFont); 487 fontSizeChoice.setItems(fontSizeChoices); 488 fontSizeChoice.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 489 490 label = new Label(textFontGroup, SWT.RIGHT); 491 label.setFont(curFont); 492 label.setText("Font Type: "); 493 494 String[] fontNames = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); 495 496 fontTypeChoice = new Combo(textFontGroup, SWT.SINGLE | SWT.READ_ONLY); 497 fontTypeChoice.setFont(curFont); 498 fontTypeChoice.setItems(fontNames); 499 fontTypeChoice.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 500 501 org.eclipse.swt.widgets.Group imageGroup = new org.eclipse.swt.widgets.Group(composite, SWT.NONE); 502 imageGroup.setLayout(new GridLayout(5, false)); 503 imageGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 504 imageGroup.setFont(curFont); 505 imageGroup.setText("Image"); 506 507 helpButton = new Button(imageGroup, SWT.PUSH); 508 helpButton.setImage(ViewProperties.getHelpIcon()); 509 helpButton.setToolTipText("Help on Auto Contrast"); 510 helpButton.addSelectionListener(new SelectionAdapter() { 511 @Override 512 public void widgetSelected(SelectionEvent e) { 513 final String msg = "Auto Contrast does the following to compute a gain/bias \n" 514 + "that will stretch the pixels in the image to fit the pixel \n" 515 + "values of the graphics system. For example, it stretches unsigned\n" 516 + "short data to fit the full range of an unsigned short. Later \n" 517 + "code simply takes the high order byte and passes it to the graphics\n" 518 + "system (which expects 0-255). It uses some statistics on the pixels \n" 519 + "to prevent outliers from throwing off the gain/bias calculations much.\n\n" 520 + "To compute the gain/bias we... \n" 521 + "Find the mean and std. deviation of the pixels in the image \n" + "min = mean - 3 * std.dev. \n" 522 + "max = mean + 3 * std.dev. \n" + "small fudge factor because this tends to overshoot a bit \n" 523 + "Stretch to 0-USHRT_MAX \n" + " gain = USHRT_MAX / (max-min) \n" 524 + " bias = -min \n" + "\n" + "To apply the gain/bias to a pixel, use the formula \n" 525 + "data[i] = (data[i] + bias) * gain \n" + "\n" 526 // + 527 // "Finally, for auto-ranging the sliders for gain/bias, we do the following \n" 528 // + "gain_min = 0 \n" 529 // + "gain_max = gain * 3.0 \n" 530 // + "bias_min = -fabs(bias) * 3.0 \n" 531 // + "bias_max = fabs(bias) * 3.0 \n" 532 + "\n\n"; 533 534 Tools.showInformation(getShell(), "Help", msg); 535 } 536 }); 537 538 checkAutoContrast = new Button(imageGroup, SWT.CHECK); 539 checkAutoContrast.setFont(curFont); 540 checkAutoContrast.setText("Autogain Image Contrast"); 541 checkAutoContrast.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 542 543 checkShowValues = new Button(imageGroup, SWT.CHECK); 544 checkShowValues.setFont(curFont); 545 checkShowValues.setText("Show Values"); 546 checkShowValues.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 547 548 label = new Label(imageGroup, SWT.RIGHT); 549 label.setFont(curFont); 550 label.setText("Image Origin: "); 551 552 imageOriginChoice = new Combo(imageGroup, SWT.SINGLE | SWT.READ_ONLY); 553 imageOriginChoice.setFont(curFont); 554 imageOriginChoice.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 555 556 org.eclipse.swt.widgets.Group dataGroup = new org.eclipse.swt.widgets.Group(composite, SWT.NONE); 557 dataGroup.setLayout(new GridLayout(4, false)); 558 dataGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 559 dataGroup.setFont(curFont); 560 dataGroup.setText("Data"); 561 562 label = new Label(dataGroup, SWT.RIGHT); 563 label.setFont(curFont); 564 label.setText("Index Base: "); 565 566 String[] indexBaseChoices = { "0-based", "1-based" }; 567 indexBaseChoice = new Combo(dataGroup, SWT.SINGLE | SWT.READ_ONLY); 568 indexBaseChoice.setFont(curFont); 569 indexBaseChoice.setItems(indexBaseChoices); 570 indexBaseChoice.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 571 572 Label delimLabel = new Label(dataGroup, SWT.RIGHT); 573 delimLabel.setFont(curFont); 574 delimLabel.setText("Data Delimiter: "); 575 delimLabel.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false)); 576 577 delimiterChoice = new Combo(dataGroup, SWT.SINGLE | SWT.READ_ONLY); 578 delimiterChoice.setFont(curFont); 579 delimiterChoice.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 580 581 Label timerRefreshLabel = new Label(dataGroup, SWT.RIGHT); 582 timerRefreshLabel.setFont(curFont); 583 timerRefreshLabel.setText("Timer Refresh (ms): "); 584 585 timerRefreshField = new Text(dataGroup, SWT.SINGLE | SWT.BORDER); 586 timerRefreshField.setFont(curFont); 587 timerRefreshField.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 588 589 org.eclipse.swt.widgets.Group objectsGroup = new org.eclipse.swt.widgets.Group(composite, SWT.NONE); 590 objectsGroup.setLayout(new GridLayout(5, true)); 591 objectsGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 592 objectsGroup.setFont(curFont); 593 objectsGroup.setText("Objects to Open"); 594 595 checkReadAll = new Button(objectsGroup, SWT.CHECK); 596 checkReadAll.setFont(curFont); 597 checkReadAll.setText("Open All"); 598 checkReadAll.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 599 checkReadAll.addSelectionListener(new SelectionAdapter() { 600 @Override 601 public void widgetSelected(SelectionEvent e) { 602 startMemberField.setEnabled(!checkReadAll.getSelection()); 603 maxMemberField.setEnabled(!checkReadAll.getSelection()); 604 } 605 }); 606 607 label = new Label(objectsGroup, SWT.RIGHT); 608 label.setFont(curFont); 609 label.setText("Start Member: "); 610 611 startMemberField = new Text(objectsGroup, SWT.SINGLE | SWT.BORDER); 612 startMemberField.setFont(curFont); 613 startMemberField.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 614 615 label = new Label(objectsGroup, SWT.RIGHT); 616 label.setFont(curFont); 617 label.setText("Member Count: "); 618 619 maxMemberField = new Text(objectsGroup, SWT.SINGLE | SWT.BORDER); 620 maxMemberField.setFont(curFont); 621 maxMemberField.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 622 623 startMemberField.setEnabled(!checkReadAll.getSelection()); 624 maxMemberField.setEnabled(!checkReadAll.getSelection()); 625 626 load(); 627 // return scroller; 628 return composite; 629 } 630}