@Override protected void createFieldEditors() { Group group = SWTUtil.createGroup(getFieldEditorParent(), "FreeMarker Debugger", 1); // $NON-NLS-1$ GridData gd = new GridData(GridData.FILL_HORIZONTAL); group.setLayoutData(gd); Composite composite = SWTUtil.createComposite(group, 2, 2, GridData.FILL_HORIZONTAL); StringFieldEditor passwordEditor = new StringFieldEditor( LiferayDebugCore.PREF_FM_DEBUG_PASSWORD, "Password:"******"Password is invalid."); passwordEditor.setPreferenceStore(getPreferenceStore()); addField(passwordEditor); IntegerFieldEditor portEditor = new IntegerFieldEditor( LiferayDebugCore.PREF_FM_DEBUG_PORT, "Port:", composite); // $NON-NLS-1$ portEditor.setValidRange(1025, 65535); portEditor.setEmptyStringAllowed(false); portEditor.setPreferenceStore(getPreferenceStore()); portEditor.setErrorMessage("Port value ranges from integer 1025 to 65535."); // $NON-NLS-1$ portEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); addField(portEditor); }
@Override protected Control createContents(Composite parent) { Composite top = SWTUtil.createTopComposite(parent, 2); createInfoGroup(top); return top; }
@Override protected Composite createTopLevelComposite(Composite parent) { Composite topComposite = SWTUtil.createTopComposite(parent, 3); createContentFolderGroup(topComposite); createLanguagePropertiesGroup(topComposite); return topComposite; }
protected void createContentFolderGroup(Composite topComposite) { Composite composite = SWTUtil.createTopComposite(topComposite, 3); GridLayout gl = new GridLayout(3, false); gl.marginLeft = 5; composite.setLayout(gl); composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1)); SWTUtil.createLabel(composite, SWT.LEAD, Msgs.contentFolder, 1); contentFolder = SWTUtil.createText(composite, 1); this.synchHelper.synchText(contentFolder, CONTENT_FOLDER, null); Button iconFileBrowse = SWTUtil.createPushButton(composite, Msgs.browse, null); iconFileBrowse.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleFileBrowseButton(NewLanguagePropertiesHookWizardPage.this.contentFolder); } }); }
protected void createSpeedFiltersEntry( Composite parent, FormToolkit toolkit, IActionBars actionBars) { SWTUtil.createLabel(parent, StringPool.EMPTY, 1); GridData td = new GridData(); td.horizontalSpan = 5; speedFilters = toolkit.createButton(parent, Msgs.speedFilters, SWT.CHECK); speedFilters.setLayoutData(td); speedFilters.setEnabled(isEditable()); speedFilters.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { if (!speedFilterEnabledModifying) { getModel().setSpeedFiltersEnabled(speedFilters.getSelection()); } } }); }
protected void createLanguagePropertiesGroup(Composite parent) { Composite composite = SWTUtil.createTopComposite(parent, 2); composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1)); languagePropertiesSection = new StringArrayTableWizardSection( composite, Msgs.languagePropertyFiles, Msgs.languagePropertyFileTitle, Msgs.add, Msgs.edit, Msgs.remove, new String[] {Msgs.add}, new String[] {Msgs.languagePropertyFileLabel}, null, getDataModel(), LANGUAGE_PROPERTIES_ITEMS); GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, true, 1, 1); gd.heightHint = 175; languagePropertiesSection.setLayoutData(gd); languagePropertiesSection.setCallback(new StringArrayTableWizardSectionCallback()); }
protected void createControl() { setLayout(new GridLayout(1, false)); disableValidation = true; Group connectionGroup = SWTUtil.createGroup(this, Msgs.connectionSettings, 2); connectionGroup.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); Label labelHostname = new Label(connectionGroup, SWT.NONE); labelHostname.setText(Msgs.hostname); textHostname = new Text(connectionGroup, SWT.BORDER); textHostname.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); textHostname.addModifyListener(this); labelHttpPort = new Label(connectionGroup, SWT.NONE); labelHttpPort.setText(Msgs.httpPortLabel); textHTTP = new Text(connectionGroup, SWT.BORDER); textHTTP.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1)); textHTTP.addModifyListener(this); labelUsername = new Label(connectionGroup, SWT.NONE); labelUsername.setText(Msgs.username); textUsername = new Text(connectionGroup, SWT.BORDER); textUsername.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1)); textUsername.addModifyListener(this); labelPassword = new Label(connectionGroup, SWT.NONE); labelPassword.setText(Msgs.password); textPassword = new Text(connectionGroup, SWT.BORDER | SWT.PASSWORD); textPassword.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); textPassword.addModifyListener(this); labelLiferayPortalContextPath = new Label(connectionGroup, SWT.NONE); labelLiferayPortalContextPath.setText(Msgs.liferayPortalContextPath); labelLiferayPortalContextPath.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); textLiferayPortalContextPath = new Text(connectionGroup, SWT.BORDER); textLiferayPortalContextPath.setLayoutData( new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); textLiferayPortalContextPath.addModifyListener(this); labelServerManagerContextPath = new Label(connectionGroup, SWT.NONE); labelServerManagerContextPath.setText(Msgs.serverManagerContextPath); labelServerManagerContextPath.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); textServerManagerContextPath = new Text(connectionGroup, SWT.BORDER); textServerManagerContextPath.setLayoutData( new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); textServerManagerContextPath.addModifyListener(this); final String marketplaceLinkLabel = Msgs.installRemoteIDEConnector; final String appUrl = "http://www.liferay.com/marketplace/-/mp/application/15193785"; //$NON-NLS-1$ SWTUtil.createHyperLink(this, SWT.NONE, marketplaceLinkLabel, 1, appUrl); final String installLabel = NLS.bind("<a>{0}</a>", Msgs.clickHereLink); // $NON-NLS-1$ final String installUrl = "{0}/group/control_panel/manage?p_p_id=1_WAR_marketplaceportlet&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&appId=15193785"; //$NON-NLS-1$ final Link installLink = SWTUtil.createLink(this, SWT.NONE, installLabel, 1); installLink.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { try { final String url = MessageFormat.format( installUrl, "http://" + textHostname.getText() + ":" + textHTTP.getText()); // $NON-NLS-1$ //$NON-NLS-2$ PlatformUI.getWorkbench() .getBrowserSupport() .getExternalBrowser() .openURL(new URL(url)); } catch (Exception e1) { LiferayUIPlugin.logError("Could not open external browser.", e1); // $NON-NLS-1$ } }; }); Composite validateComposite = new Composite(this, SWT.NONE); validateComposite.setLayoutData(new GridData(SWT.LEFT, SWT.BOTTOM, false, true)); validateComposite.setLayout(new GridLayout(1, false)); Button validateButton = new Button(validateComposite, SWT.PUSH); validateButton.setText(Msgs.validateConnection); validateButton.setLayoutData(new GridData(SWT.LEFT, SWT.BOTTOM, false, false)); validateButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { validate(); } }); // initDataBindings(); disableValidation = false; validate(); }