protected void createServerSelectionControl(Composite parent) { Group group = new Group(parent, SWT.NONE); group.setText(PHPServerUIMessages.getString("ServerTab.server")); // $NON-NLS-1$ GridLayout ly = new GridLayout(1, false); ly.marginHeight = 0; ly.marginWidth = 0; group.setLayout(ly); group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Composite phpServerComp = new Composite(group, SWT.NONE); phpServerComp.setLayout(new GridLayout(4, false)); phpServerComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); phpServerComp.setFont(parent.getFont()); Label label = new Label(phpServerComp, SWT.WRAP); GridData data = new GridData(GridData.BEGINNING); data.widthHint = 100; label.setLayoutData(data); label.setFont(parent.getFont()); label.setText(PHPServerUIMessages.getString("ServerLaunchConfigurationTab.0")); // $NON-NLS-1$ serverCombo = new Combo(phpServerComp, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY); serverCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); serverCombo.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { handleServerSelection(); } }); createNewServer = createPushButton( phpServerComp, PHPServerUIMessages.getString("ServerTab.new"), null); // $NON-NLS-1$ createNewServer.addSelectionListener(fListener); configureServers = createPushButton( phpServerComp, PHPServerUIMessages.getString("ServerTab.configure"), null); //$NON-NLS-1$ configureServers.addSelectionListener(fListener); servers = new ArrayList<Server>(); populateServerList(servers); // initialize the servers list if (!servers.isEmpty()) { for (int i = 0; i < servers.size(); i++) { Server svr = servers.get(i); serverCombo.add(svr.getName()); } } // select first item in list if (serverCombo.getItemCount() > 0) { serverCombo.select(0); } serverCombo.forceFocus(); }
private void createLabels(Composite pageContent) { Label label = new Label(pageContent, SWT.LEFT); label.setText(Messages._UI_LABEL_SOURCE_FILES); GridData data = new GridData(); data.horizontalAlignment = GridData.FILL; data.horizontalSpan = 2; label.setLayoutData(data); label = new Label(pageContent, SWT.LEFT); label.setText(Messages._UI_LABEL_SELECTED_FILES); }
public void createURLControl(Composite composite) { Group group = new Group(composite, SWT.NONE); String projectLabel = PHPServerUIMessages.getString("ServerTab.url"); // $NON-NLS-1$ group.setText(projectLabel); group.setLayout(new GridLayout(2, false)); group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); autoGeneratedURL = new Button(group, SWT.CHECK); autoGeneratedURL.setText( PHPServerUIMessages.getString("ServerTab.autoGenerate")); // $NON-NLS-1$ autoGeneratedURL.setSelection(true); autoGeneratedURL.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 2, 1)); autoGeneratedURL.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { initializeURLControl(); updateLaunchConfigurationDialog(); } }); fURLLabel = new Label(group, SWT.NONE); fURLLabel.setText(PHPServerUIMessages.getString("ServerTab.urlLabel")); // $NON-NLS-1$ GridData gridData = new GridData(); gridData.horizontalIndent = 20; gridData.horizontalSpan = 1; fURLLabel.setLayoutData(gridData); Composite urlComposite = new Composite(group, SWT.NONE); urlComposite.setLayout(new GridLayout(2, false)); urlComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fURLHost = new Text(urlComposite, SWT.SINGLE | SWT.BORDER); fURLHost.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fURLHost.setEnabled(false); fURLPath = new Text(urlComposite, SWT.SINGLE | SWT.BORDER); fURLPath.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fURLPath.addModifyListener( new ModifyListener() { public void modifyText(ModifyEvent e) { updateLaunchConfigurationDialog(); } }); }