View | Details | Raw Unified | Return to bug 193680
Collapse All | Expand All

(-)src/org/eclipse/swt/examples/controlexample/Tab.java (-2 / +11 lines)
Lines 664-670 Link Here
664
		final Shell dialog = new Shell(shell, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MODELESS);
664
		final Shell dialog = new Shell(shell, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MODELESS);
665
		dialog.setLayout(new GridLayout(2, false));
665
		dialog.setLayout(new GridLayout(2, false));
666
		dialog.setText(getTabText() + " " + ControlExample.getResourceString ("Set_Get"));
666
		dialog.setText(getTabText() + " " + ControlExample.getResourceString ("Set_Get"));
667
		nameCombo = new Combo(dialog, SWT.READ_ONLY);
667
		nameCombo = new Combo(dialog, SWT.NONE);
668
		nameCombo.setItems(methodNames);
668
		nameCombo.setItems(methodNames);
669
		nameCombo.setText(methodNames[0]);
669
		nameCombo.setText(methodNames[0]);
670
		nameCombo.setVisibleItemCount(methodNames.length);
670
		nameCombo.setVisibleItemCount(methodNames.length);
Lines 672-677 Link Here
672
		nameCombo.addSelectionListener(new SelectionAdapter() {
672
		nameCombo.addSelectionListener(new SelectionAdapter() {
673
			public void widgetSelected(SelectionEvent e) {
673
			public void widgetSelected(SelectionEvent e) {
674
				resetLabels();
674
				resetLabels();
675
				setText.setFocus();
676
			}
677
		});
678
		nameCombo.addModifyListener(new ModifyListener() {
679
			public void modifyText(ModifyEvent e) {
680
				resetLabels();
675
			}
681
			}
676
		});
682
		});
677
		returnTypeLabel = new Label(dialog, SWT.NONE);
683
		returnTypeLabel = new Label(dialog, SWT.NONE);
Lines 700-705 Link Here
700
		data.heightHint = 200;
706
		data.heightHint = 200;
701
		getText.setLayoutData(data);
707
		getText.setLayoutData(data);
702
		resetLabels();
708
		resetLabels();
709
		setText.setFocus();
703
		dialog.setDefaultButton(setButton);
710
		dialog.setDefaultButton(setButton);
704
		dialog.pack();
711
		dialog.pack();
705
		dialog.setLocation(x, y);
712
		dialog.setLocation(x, y);
Lines 714-720 Link Here
714
		setText.setText("");
721
		setText.setText("");
715
		getText.setText("");
722
		getText.setText("");
716
		getValue();
723
		getValue();
717
		setText.setFocus();
718
	}
724
	}
719
725
720
	String setMethodName(String methodRoot) {
726
	String setMethodName(String methodRoot) {
Lines 724-729 Link Here
724
	String parameterInfo(String methodRoot) {
730
	String parameterInfo(String methodRoot) {
725
		String typeName = null;
731
		String typeName = null;
726
		Class returnType = getReturnType(methodRoot);
732
		Class returnType = getReturnType(methodRoot);
733
		if (returnType == null)
734
			return "";
727
		boolean isArray = returnType.isArray();
735
		boolean isArray = returnType.isArray();
728
		if (isArray) {
736
		if (isArray) {
729
			typeName = returnType.getComponentType().getName();
737
			typeName = returnType.getComponentType().getName();
Lines 820-825 Link Here
820
					parameter = parameterForType(typeName, value, widgets[i]);
828
					parameter = parameterForType(typeName, value, widgets[i]);
821
				}
829
				}
822
				method.invoke(widgets[i], parameter);
830
				method.invoke(widgets[i], parameter);
831
				getValue();
823
			} catch (Exception e) {
832
			} catch (Exception e) {
824
				getText.setText(e.toString());
833
				getText.setText(e.toString());
825
			}
834
			}

Return to bug 193680