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; 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 data delimiter 145 if (delimiterChoice != null) 146 ViewProperties.setDataDelimiter(delimiterChoice.getItem(delimiterChoice.getSelectionIndex())); 147 if (imageOriginChoice != null) 148 ViewProperties.setImageOrigin(imageOriginChoice.getItem(imageOriginChoice.getSelectionIndex())); 149 150 if (checkReadAll != null) { 151 if (checkReadAll.getSelection()) { 152 ViewProperties.setStartMembers(0); 153 ViewProperties.setMaxMembers(-1); 154 } 155 else { 156 try { 157 int maxsize = Integer.parseInt(maxMemberField.getText()); 158 ViewProperties.setMaxMembers(maxsize); 159 } 160 catch (Exception ex) { 161 } 162 163 try { 164 int startsize = Integer.parseInt(startMemberField.getText()); 165 ViewProperties.setStartMembers(startsize); 166 } 167 catch (Exception ex) { 168 } 169 } 170 } 171 172 if (checkAutoContrast != null) 173 ViewProperties.setAutoContrast(checkAutoContrast.getSelection()); 174 if (checkShowValues != null) 175 ViewProperties.setShowImageValue(checkShowValues.getSelection()); 176 177 if (indexBaseChoice != null) { 178 if (indexBaseChoice.getSelectionIndex() == 0) 179 ViewProperties.setIndexBase1(false); 180 else 181 ViewProperties.setIndexBase1(true); 182 } 183 184 return true; 185 } 186 187 /** 188 * Checks if the Font setting changed. 189 * 190 * @return true if the font changed. 191 */ 192 public boolean isFontChanged() { 193 return isFontChanged; 194 } 195 196 /** 197 * Checks if the location for the UserGuide changed. 198 * 199 * @return true if the location of the UserGuide changed. 200 */ 201 public boolean isUserGuideChanged() { 202 return isUserGuideChanged; 203 } 204 205 /** 206 * Checks if the location of the WorkDir changed. 207 * 208 * @return true if the working directory changed. 209 */ 210 public boolean isWorkDirChanged() { 211 return isWorkDirChanged; 212 } 213 214 /** 215 * Loads all stored values in the <code>FieldEditor</code>s. 216 */ 217 protected void load() { 218 getPreferenceStore(); 219 220 try { 221 curFont = new Font( 222 Display.getCurrent(), 223 ViewProperties.getFontType(), 224 ViewProperties.getFontSize(), 225 SWT.NORMAL); 226 } 227 catch (Exception ex) { 228 curFont = null; 229 } 230 231 workDir = ViewProperties.getWorkDir(); 232 if (workDir == null) 233 workDir = rootDir; 234 235 workField.setText(workDir); 236 237 if (workDir.equals(System.getProperty("user.dir"))) { 238 checkCurrentUserDir.setSelection(true); 239 checkUserHomeDir.setSelection(false); 240 workField.setEnabled(false); 241 } 242 else if (workDir.equals(System.getProperty("user.home"))) { 243 checkCurrentUserDir.setSelection(false); 244 checkUserHomeDir.setSelection(true); 245 workField.setEnabled(false); 246 } 247 else { 248 checkCurrentUserDir.setSelection(false); 249 checkUserHomeDir.setSelection(false); 250 workField.setEnabled(true); 251 } 252 253 log.trace("UserOptionsGeneralPage: workDir={}", workDir); 254 255 UGField.setText(ViewProperties.getUsersGuide()); 256 257 checkReadOnly.setSelection(ViewProperties.isReadOnly()); 258 259 rwButton.setSelection(!ViewProperties.isReadOnly()); 260 261 String fontsize = String.valueOf(ViewProperties.getFontSize()); 262 log.trace("performOk: load General options fontsize={}", fontsize); 263 try { 264 int selectionIndex = fontSizeChoice.indexOf(fontsize); 265 fontSizeChoice.select(selectionIndex); 266 } 267 catch (Exception ex) { 268 fontSizeChoice.select(0); 269 } 270 271 fontname = ViewProperties.getFontType(); 272 log.trace("performOk: load General options fontname={}", fontname); 273 try { 274 int selectionIndex = fontTypeChoice.indexOf(fontname); 275 fontTypeChoice.select(selectionIndex); 276 } 277 catch (Exception ex) { 278 String sysFontName = Display.getDefault().getSystemFont().getFontData()[0].getName(); 279 280 try { 281 int selectionIndex = fontTypeChoice.indexOf(sysFontName); 282 fontTypeChoice.select(selectionIndex); 283 } 284 catch (Exception ex2) { 285 fontTypeChoice.select(0); 286 } 287 } 288 289 checkAutoContrast.setSelection(ViewProperties.isAutoContrast()); 290 291 checkShowValues.setSelection(ViewProperties.showImageValues()); 292 293 String[] imageOriginChoices = { ViewProperties.ORIGIN_UL, ViewProperties.ORIGIN_LL, ViewProperties.ORIGIN_UR, 294 ViewProperties.ORIGIN_LR }; 295 imageOriginChoice.setItems(imageOriginChoices); 296 297 try { 298 int selectionIndex = imageOriginChoice.indexOf(ViewProperties.getImageOrigin()); 299 imageOriginChoice.select(selectionIndex); 300 } 301 catch (Exception ex) { 302 imageOriginChoice.select(0); 303 } 304 305 // helpButton.setImage(ViewProperties.getHelpIcon()); 306 307 if (ViewProperties.isIndexBase1()) 308 indexBaseChoice.select(1); 309 else 310 indexBaseChoice.select(0); 311 312 String[] delimiterChoices = { ViewProperties.DELIMITER_TAB, ViewProperties.DELIMITER_COMMA, 313 ViewProperties.DELIMITER_SPACE, ViewProperties.DELIMITER_COLON, ViewProperties.DELIMITER_SEMI_COLON }; 314 delimiterChoice.setItems(delimiterChoices); 315 316 try { 317 int selectionIndex = delimiterChoice.indexOf(ViewProperties.getDataDelimiter()); 318 delimiterChoice.select(selectionIndex); 319 } 320 catch (Exception ex) { 321 delimiterChoice.select(0); 322 } 323 324 int nMax = ViewProperties.getMaxMembers(); 325 checkReadAll.setSelection((nMax<=0) || (nMax==Integer.MAX_VALUE)); 326 327 startMemberField.setText(String.valueOf(ViewProperties.getStartMembers())); 328 329 maxMemberField.setText(String.valueOf(ViewProperties.getMaxMembers())); 330 } 331 332 /** 333 * Creates and returns the SWT control for the customized body of this 334 * preference page under the given parent composite. 335 * 336 * @param parent 337 * the parent composite 338 * 339 * @return the new control 340 */ 341 @Override 342 protected Control createContents(Composite parent) { 343 shell = parent.getShell(); 344 Composite composite = new Composite(parent, SWT.NONE); 345 composite.setLayout(new GridLayout()); 346 347 org.eclipse.swt.widgets.Group workingDirectoryGroup = new org.eclipse.swt.widgets.Group(composite, SWT.NONE); 348 workingDirectoryGroup.setLayout(new GridLayout(3, false)); 349 workingDirectoryGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); 350 workingDirectoryGroup.setFont(curFont); 351 workingDirectoryGroup.setText("Default Working Directory"); 352 353 checkCurrentUserDir = new Button(workingDirectoryGroup, SWT.CHECK); 354 checkCurrentUserDir.setFont(curFont); 355 checkCurrentUserDir.setText("\"User Work\" or"); 356 checkCurrentUserDir.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 357 checkCurrentUserDir.addSelectionListener(new SelectionAdapter() { 358 @Override 359 public void widgetSelected(SelectionEvent e) { 360 boolean isCheckCurrentUserDirSelected = checkCurrentUserDir.getSelection(); 361 if (isCheckCurrentUserDirSelected) 362 checkUserHomeDir.setSelection(false); 363 workField.setEnabled(!isCheckCurrentUserDirSelected); 364 currentDirButton.setEnabled(!isCheckCurrentUserDirSelected); 365 } 366 }); 367 368 checkUserHomeDir = new Button(workingDirectoryGroup, SWT.CHECK); 369 checkUserHomeDir.setFont(curFont); 370 checkUserHomeDir.setText("\"User Home\" or"); 371 checkUserHomeDir.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 372 checkUserHomeDir.addSelectionListener(new SelectionAdapter() { 373 @Override 374 public void widgetSelected(SelectionEvent e) { 375 boolean isCheckUserHomeDirSelected = checkUserHomeDir.getSelection(); 376 if (isCheckUserHomeDirSelected) 377 checkCurrentUserDir.setSelection(false); 378 workField.setEnabled(!isCheckUserHomeDirSelected); 379 currentDirButton.setEnabled(!isCheckUserHomeDirSelected); 380 } 381 }); 382 383 workField = new Text(workingDirectoryGroup, SWT.SINGLE | SWT.BORDER); 384 workField.setFont(curFont); 385 workField.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); 386 387 currentDirButton = new Button(workingDirectoryGroup, SWT.PUSH); 388 currentDirButton.setFont(curFont); 389 currentDirButton.setText("Browse..."); 390 currentDirButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 391 currentDirButton.addSelectionListener(new SelectionAdapter() { 392 @Override 393 public void widgetSelected(SelectionEvent e) { 394 final DirectoryDialog dChooser = new DirectoryDialog(shell); 395 dChooser.setFilterPath(workDir); 396 dChooser.setText("Select a Directory"); 397 398 String dir = dChooser.open(); 399 400 if(dir == null) return; 401 402 workField.setText(dir); 403 } 404 }); 405 406 org.eclipse.swt.widgets.Group helpDocumentGroup = new org.eclipse.swt.widgets.Group(composite, SWT.NONE); 407 helpDocumentGroup.setLayout(new GridLayout(3, false)); 408 helpDocumentGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); 409 helpDocumentGroup.setFont(curFont); 410 helpDocumentGroup.setText("Help Document"); 411 412 Label label = new Label(helpDocumentGroup, SWT.RIGHT); 413 label.setFont(curFont); 414 label.setText("User's Guide: "); 415 416 UGField = new Text(helpDocumentGroup, SWT.SINGLE | SWT.BORDER); 417 UGField.setFont(curFont); 418 UGField.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); 419 420 Button browseButton = new Button(helpDocumentGroup, SWT.PUSH); 421 browseButton.setFont(curFont); 422 browseButton.setText("Browse..."); 423 browseButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 424 browseButton.addSelectionListener(new SelectionAdapter() { 425 @Override 426 public void widgetSelected(SelectionEvent e) { 427 final FileDialog fChooser = new FileDialog(shell, SWT.OPEN); 428 fChooser.setFilterPath(rootDir); 429 fChooser.setFilterExtensions(new String[] {"*"}); 430 fChooser.setFilterNames(new String[] {"All Files"}); 431 fChooser.setFilterIndex(0); 432 433 if(fChooser.open() == null) { 434 return; 435 } 436 437 File chosenFile = new File(fChooser.getFilterPath() + File.separator + fChooser.getFileName()); 438 439 if(!chosenFile.exists()) { 440 // Give an error 441 return; 442 } 443 444 UGField.setText(chosenFile.getAbsolutePath()); 445 } 446 }); 447 448 org.eclipse.swt.widgets.Group fileAccessModeGroup = new org.eclipse.swt.widgets.Group(composite, SWT.NONE); 449 fileAccessModeGroup.setLayout(new GridLayout(2, true)); 450 fileAccessModeGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 451 fileAccessModeGroup.setFont(curFont); 452 fileAccessModeGroup.setText("Default File Access Mode"); 453 454 checkReadOnly = new Button(fileAccessModeGroup, SWT.RADIO); 455 checkReadOnly.setFont(curFont); 456 checkReadOnly.setText("Read Only"); 457 checkReadOnly.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, false, false)); 458 459 rwButton = new Button(fileAccessModeGroup, SWT.RADIO); 460 rwButton.setFont(curFont); 461 rwButton.setText("Read/Write"); 462 rwButton.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, false, false)); 463 464 org.eclipse.swt.widgets.Group textFontGroup = new org.eclipse.swt.widgets.Group(composite, SWT.NONE); 465 textFontGroup.setLayout(new GridLayout(4, false)); 466 textFontGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 467 textFontGroup.setFont(curFont); 468 textFontGroup.setText("Text Font"); 469 470 label = new Label(textFontGroup, SWT.RIGHT); 471 label.setFont(curFont); 472 label.setText("Font Size: "); 473 474 String[] fontSizeChoices = { "8", "10", "12", "14", "16", "18", "20", "22", "24", "26", "28", "30", "32", "34", "36", "48" }; 475 fontSizeChoice = new Combo(textFontGroup, SWT.SINGLE | SWT.READ_ONLY); 476 fontSizeChoice.setFont(curFont); 477 fontSizeChoice.setItems(fontSizeChoices); 478 fontSizeChoice.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 479 480 label = new Label(textFontGroup, SWT.RIGHT); 481 label.setFont(curFont); 482 label.setText("Font Type: "); 483 484 String[] fontNames = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); 485 486 fontTypeChoice = new Combo(textFontGroup, SWT.SINGLE | SWT.READ_ONLY); 487 fontTypeChoice.setFont(curFont); 488 fontTypeChoice.setItems(fontNames); 489 fontTypeChoice.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 490 491 org.eclipse.swt.widgets.Group imageGroup = new org.eclipse.swt.widgets.Group(composite, SWT.NONE); 492 imageGroup.setLayout(new GridLayout(5, false)); 493 imageGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 494 imageGroup.setFont(curFont); 495 imageGroup.setText("Image"); 496 497 helpButton = new Button(imageGroup, SWT.PUSH); 498 helpButton.setImage(ViewProperties.getHelpIcon()); 499 helpButton.setToolTipText("Help on Auto Contrast"); 500 helpButton.addSelectionListener(new SelectionAdapter() { 501 @Override 502 public void widgetSelected(SelectionEvent e) { 503 final String msg = "Auto Contrast does the following to compute a gain/bias \n" 504 + "that will stretch the pixels in the image to fit the pixel \n" 505 + "values of the graphics system. For example, it stretches unsigned\n" 506 + "short data to fit the full range of an unsigned short. Later \n" 507 + "code simply takes the high order byte and passes it to the graphics\n" 508 + "system (which expects 0-255). It uses some statistics on the pixels \n" 509 + "to prevent outliers from throwing off the gain/bias calculations much.\n\n" 510 + "To compute the gain/bias we... \n" 511 + "Find the mean and std. deviation of the pixels in the image \n" + "min = mean - 3 * std.dev. \n" 512 + "max = mean + 3 * std.dev. \n" + "small fudge factor because this tends to overshoot a bit \n" 513 + "Stretch to 0-USHRT_MAX \n" + " gain = USHRT_MAX / (max-min) \n" 514 + " bias = -min \n" + "\n" + "To apply the gain/bias to a pixel, use the formula \n" 515 + "data[i] = (data[i] + bias) * gain \n" + "\n" 516 // + 517 // "Finally, for auto-ranging the sliders for gain/bias, we do the following \n" 518 // + "gain_min = 0 \n" 519 // + "gain_max = gain * 3.0 \n" 520 // + "bias_min = -fabs(bias) * 3.0 \n" 521 // + "bias_max = fabs(bias) * 3.0 \n" 522 + "\n\n"; 523 524 Tools.showInformation(getShell(), "Help", msg); 525 } 526 }); 527 528 checkAutoContrast = new Button(imageGroup, SWT.CHECK); 529 checkAutoContrast.setFont(curFont); 530 checkAutoContrast.setText("Autogain Image Contrast"); 531 checkAutoContrast.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 532 533 checkShowValues = new Button(imageGroup, SWT.CHECK); 534 checkShowValues.setFont(curFont); 535 checkShowValues.setText("Show Values"); 536 checkShowValues.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 537 538 label = new Label(imageGroup, SWT.RIGHT); 539 label.setFont(curFont); 540 label.setText("Image Origin: "); 541 542 imageOriginChoice = new Combo(imageGroup, SWT.SINGLE | SWT.READ_ONLY); 543 imageOriginChoice.setFont(curFont); 544 imageOriginChoice.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 545 546 org.eclipse.swt.widgets.Group dataGroup = new org.eclipse.swt.widgets.Group(composite, SWT.NONE); 547 dataGroup.setLayout(new GridLayout(4, false)); 548 dataGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 549 dataGroup.setFont(curFont); 550 dataGroup.setText("Data"); 551 552 label = new Label(dataGroup, SWT.RIGHT); 553 label.setFont(curFont); 554 label.setText("Index Base: "); 555 556 String[] indexBaseChoices = { "0-based", "1-based" }; 557 indexBaseChoice = new Combo(dataGroup, SWT.SINGLE | SWT.READ_ONLY); 558 indexBaseChoice.setFont(curFont); 559 indexBaseChoice.setItems(indexBaseChoices); 560 indexBaseChoice.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 561 562 Label delimLabel = new Label(dataGroup, SWT.RIGHT); 563 delimLabel.setFont(curFont); 564 delimLabel.setText("Data Delimiter: "); 565 delimLabel.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false)); 566 567 delimiterChoice = new Combo(dataGroup, SWT.SINGLE | SWT.READ_ONLY); 568 delimiterChoice.setFont(curFont); 569 delimiterChoice.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 570 571 org.eclipse.swt.widgets.Group objectsGroup = new org.eclipse.swt.widgets.Group(composite, SWT.NONE); 572 objectsGroup.setLayout(new GridLayout(5, true)); 573 objectsGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 574 objectsGroup.setFont(curFont); 575 objectsGroup.setText("Objects to Open"); 576 577 checkReadAll = new Button(objectsGroup, SWT.CHECK); 578 checkReadAll.setFont(curFont); 579 checkReadAll.setText("Open All"); 580 checkReadAll.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 581 checkReadAll.addSelectionListener(new SelectionAdapter() { 582 @Override 583 public void widgetSelected(SelectionEvent e) { 584 startMemberField.setEnabled(!checkReadAll.getSelection()); 585 maxMemberField.setEnabled(!checkReadAll.getSelection()); 586 } 587 }); 588 589 label = new Label(objectsGroup, SWT.RIGHT); 590 label.setFont(curFont); 591 label.setText("Start Member: "); 592 593 startMemberField = new Text(objectsGroup, SWT.SINGLE | SWT.BORDER); 594 startMemberField.setFont(curFont); 595 startMemberField.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 596 597 label = new Label(objectsGroup, SWT.RIGHT); 598 label.setFont(curFont); 599 label.setText("Member Count: "); 600 601 maxMemberField = new Text(objectsGroup, SWT.SINGLE | SWT.BORDER); 602 maxMemberField.setFont(curFont); 603 maxMemberField.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); 604 605 startMemberField.setEnabled(!checkReadAll.getSelection()); 606 maxMemberField.setEnabled(!checkReadAll.getSelection()); 607 608 load(); 609 // return scroller; 610 return composite; 611 } 612}