Index: src/org/eclipse/help/ui/internal/AppserverPreferencePage.java =================================================================== RCS file: /home/eclipse/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/AppserverPreferencePage.java,v retrieving revision 1.16 diff -u -r1.16 AppserverPreferencePage.java --- src/org/eclipse/help/ui/internal/AppserverPreferencePage.java 1 Jun 2005 20:27:19 -0000 1.16 +++ src/org/eclipse/help/ui/internal/AppserverPreferencePage.java 14 Jun 2005 20:09:03 -0000 @@ -18,6 +18,8 @@ import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; import org.eclipse.ui.*; +import org.eclipse.ui.forms.HyperlinkSettings; +import org.eclipse.ui.forms.widgets.FormText; /** * Preference page for Tomcat network interface and port. @@ -38,23 +40,24 @@ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpUIConstants.PREF_PAGE_APPSERVER); - Composite mainComposite = new Composite(parent, SWT.NULL); + final Composite mainComposite = new Composite(parent, SWT.NULL); mainComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); - GridLayout layout = new GridLayout(); + final GridLayout layout = new GridLayout(); layout.marginHeight = 0; layout.marginWidth = 0; layout.numColumns = 2; mainComposite.setLayout(layout); - Label label = new Label(mainComposite, SWT.NONE); - label.setText(Messages.AppserverPreferencePage_description); //$NON-NLS-1$ + final Label descLabel = new Label(mainComposite, SWT.WRAP); + descLabel.setText(Messages.AppserverPreferencePage_description); //$NON-NLS-1$ GridData data = new GridData(); data.horizontalSpan = 2; - label.setLayoutData(data); - label.setFont(font); + data.widthHint = 100; + descLabel.setLayoutData(data); + descLabel.setFont(font); // Spacer - label = new Label(mainComposite, SWT.NONE); + Label label = new Label(mainComposite, SWT.NONE); data = new GridData(); data.horizontalSpan = 2; label.setLayoutData(data); @@ -63,55 +66,22 @@ label = new Label(mainComposite, SWT.NONE); label.setFont(font); label.setText(Messages.AppserverPreferencePage_hostDescription); //$NON-NLS-1$ - data = new GridData(); - data.horizontalSpan = 2; - label.setLayoutData(data); - - //Label labelHost = new Label(mainComposite, SWT.LEFT); - //labelHost.setText( - // WorkbenchResources.getString("AppserverPreferencePage.host")); - //data = new GridData(); - //labelHost.setLayoutData(data); - //labelHost.setFont(font); textServerAddr = new Text(mainComposite, SWT.SINGLE | SWT.BORDER); //text.addListener(SWT.Modify, this); - data = new GridData(); - data.horizontalAlignment = GridData.FILL; - data.grabExcessHorizontalSpace = true; - data.horizontalSpan = 2; + data = new GridData(GridData.FILL_HORIZONTAL); + data.widthHint = convertWidthInCharsToPixels(8); textServerAddr.setLayoutData(data); textServerAddr.setFont(font); - // Spacer - label = new Label(mainComposite, SWT.NONE); - data = new GridData(); - data.horizontalSpan = 2; - label.setLayoutData(data); - label.setFont(font); - label = new Label(mainComposite, SWT.NONE); label.setFont(font); label.setText(Messages.AppserverPreferencePage_portDescription); //$NON-NLS-1$ - data = new GridData(); - data.horizontalSpan = 2; - label.setLayoutData(data); - label.setFont(font); - - //Label labelPort = new Label(mainComposite, SWT.LEFT); - //labelPort.setText( - // WorkbenchResources.getString("AppserverPreferencePage.port")); - //data = new GridData(); - //labelPort.setLayoutData(data); - //labelPort.setFont(font); textServerPort = new Text(mainComposite, SWT.SINGLE | SWT.BORDER); textServerPort.setTextLimit(5); - data = new GridData(); + data = new GridData(GridData.FILL_HORIZONTAL); data.widthHint = convertWidthInCharsToPixels(8); - data.horizontalAlignment = GridData.FILL; - data.grabExcessHorizontalSpace = true; - data.horizontalSpan = 2; textServerPort.setLayoutData(data); textServerPort.setFont(font); @@ -147,33 +117,25 @@ data.horizontalSpan = 2; label.setLayoutData(data); label.setFont(font); - - label = new Label(mainComposite, SWT.NONE); - label - .setText(Messages.AppserverPreferencePage_Note); //$NON-NLS-1$ - // Make this bold - FontData[] fontData = font.getFontData(); - for (int i = 0; i < fontData.length; i++) { - fontData[i].setStyle(fontData[i].getStyle() | SWT.BOLD); - } - final Font boldFont = new Font(label.getDisplay(), fontData); - label.setFont(boldFont); - label.addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent e) { - boldFont.dispose(); + + FormText ftext = new FormText(mainComposite, SWT.WRAP); + ftext.setText(Messages.AppserverPreferencePage_requireRestart, true, false); + data = new GridData(GridData.GRAB_HORIZONTAL); + ftext.setHyperlinkSettings(new HyperlinkSettings(mainComposite.getDisplay())); + data.horizontalSpan = 2; + data.widthHint = 100; + ftext.setLayoutData(data); + ftext.setFont(font); + final GridData fdata = data; + mainComposite.addControlListener(new ControlAdapter() { + public void controlResized(ControlEvent e) { + GridData ddata = (GridData)descLabel.getLayoutData(); + int width = mainComposite.getSize().x-layout.marginWidth*2; + fdata.widthHint = width; + ddata.widthHint = width; + mainComposite.layout(); } }); - // - data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING); - //data.horizontalSpan = 2; - label.setLayoutData(data); - - label = new Label(mainComposite, SWT.NONE); - label.setText(Messages.AppserverPreferencePage_requireRestart); //$NON-NLS-1$ - data = new GridData(); - //data.horizontalSpan = 2; - label.setLayoutData(data); - label.setFont(font); Preferences pref = AppserverPlugin.getDefault().getPluginPreferences(); textServerAddr.setText(pref.getString(AppserverPlugin.HOST_KEY)); Index: src/org/eclipse/help/ui/internal/Messages.java =================================================================== RCS file: /home/eclipse/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/Messages.java,v retrieving revision 1.6 diff -u -r1.6 Messages.java --- src/org/eclipse/help/ui/internal/Messages.java 16 May 2005 22:28:45 -0000 1.6 +++ src/org/eclipse/help/ui/internal/Messages.java 14 Jun 2005 20:09:03 -0000 @@ -35,7 +35,6 @@ public static String AppserverPreferencePage_description; public static String AppserverPreferencePage_hostDescription; public static String AppserverPreferencePage_portDescription; - public static String AppserverPreferencePage_Note; public static String AppserverPreferencePage_requireRestart; public static String AppserverPreferencePage_invalidPort; public static String WW002; Index: src/org/eclipse/help/ui/internal/Messages.properties =================================================================== RCS file: /home/eclipse/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/Messages.properties,v retrieving revision 1.11 diff -u -r1.11 Messages.properties --- src/org/eclipse/help/ui/internal/Messages.properties 2 Jun 2005 17:12:47 -0000 1.11 +++ src/org/eclipse/help/ui/internal/Messages.properties 14 Jun 2005 20:09:03 -0000 @@ -33,16 +33,15 @@ CustomBrowserPreferencePage_Details = Select a browser program # AppserverPreferencePage -AppserverPreferencePage_description = Internal Application Server configuration. The server is used internally\n\ +AppserverPreferencePage_description = Internal Application Server configuration. The server is used internally \ by help system. -AppserverPreferencePage_hostDescription = &Host name or IP address of local machine. Leave blank to automatically\n\ -determine +AppserverPreferencePage_hostDescription = &Host name or IP address: #AppserverPreferencePage.host = &Host: -AppserverPreferencePage_portDescription = &Port for server to listen on. Leave blank to dynamically assign +AppserverPreferencePage_portDescription = Server &port: #AppserverPreferencePage.port = &Port: -AppserverPreferencePage_Note = Note: -AppserverPreferencePage_requireRestart = If the server is already running, these preferences will only take effect\n\ -after restarting. +AppserverPreferencePage_requireRestart =

Note: Leave the above fields empty to have the IP address and port number \ +dynamically computed by the help system. If the server is already running, these preferences will only take effect\ +after restarting.

AppserverPreferencePage_invalidPort = Port must be a number in the range 0-65535 # ContextHelpDialog