protected void intent(Composite group) { Label l= new Label(group, SWT.NONE); GridData gd= new GridData(); gd.widthHint= fPixelConverter.convertWidthInCharsToPixels(4); l.setLayoutData(gd); }
private void createSeparateLabel(Composite composite, int h_span) { PixelConverter pixelConverter= new PixelConverter(composite); int width= pixelConverter.convertWidthInCharsToPixels(40); Label label= new Label(composite, SWT.NONE | SWT.WRAP); label.setText(PreferencesMessages.CodeAssistAdvancedConfigurationBlock_separate_table_description); GridData gd= new GridData(GridData.FILL, GridData.FILL, false, false, h_span, 1); gd.widthHint= width; label.setLayoutData(gd); }
private void createParameterTimeoutControl(Composite composite, int h_span) { Composite timeoutComposite= new Composite(composite, SWT.NONE); GridLayout layout= new GridLayout(4, false); layout.marginWidth= 0; layout.marginHeight= 0; timeoutComposite.setLayout(layout); GridData gd= new GridData(GridData.FILL, GridData.FILL, true, false, h_span, 1); timeoutComposite.setLayoutData(gd); PixelConverter pixelConverter= new PixelConverter(composite); String str= PreferencesMessages.CodeAssistAdvancedConfigurationBlock_parameterNameFromAttachedJavadoc_timeout; addTextField(timeoutComposite, str, PREF_CODEASSIST_TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC, 0, pixelConverter.convertWidthInCharsToPixels(7)); Label ms= new Label(timeoutComposite, SWT.NONE); gd= new GridData(); ms.setLayoutData(gd); ms.setText(PreferencesMessages.CodeAssistAdvancedConfigurationBlock_parameterNameFromAttachedJavadoc_timeout_ms); }
private CheckboxPreference createIndentedCheckboxPref(Composite composite, int numColumns, String message, String key, String [] values) { CheckboxPreference pref= createCheckboxPref(composite, numColumns, message, key, values); GridData data= (GridData) pref.getControl().getLayoutData(); data.horizontalIndent= fPixelConverter.convertWidthInCharsToPixels(1); return pref; }
private void createDefaultLabel(Composite composite, int h_span) { final ICommandService commandSvc= (ICommandService) PlatformUI.getWorkbench().getAdapter(ICommandService.class); final Command command= commandSvc.getCommand(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); ParameterizedCommand pCmd= new ParameterizedCommand(command, null); String key= getKeyboardShortcut(pCmd); if (key == null) key= PreferencesMessages.CodeAssistAdvancedConfigurationBlock_no_shortcut; PixelConverter pixelConverter= new PixelConverter(composite); int width= pixelConverter.convertWidthInCharsToPixels(40); Label label= new Label(composite, SWT.NONE | SWT.WRAP); label.setText(Messages.format(PreferencesMessages.CodeAssistAdvancedConfigurationBlock_page_description, new Object[] { key })); GridData gd= new GridData(GridData.FILL, GridData.FILL, true, false, h_span, 1); gd.widthHint= width; label.setLayoutData(gd); createFiller(composite, h_span); label= new Label(composite, SWT.NONE | SWT.WRAP); label.setText(PreferencesMessages.CodeAssistAdvancedConfigurationBlock_default_table_description); gd= new GridData(GridData.FILL, GridData.FILL, true, false, h_span, 1); gd.widthHint= width; label.setLayoutData(gd); }
public Control getControl(Composite parent) { PixelConverter converter= new PixelConverter(parent); Composite composite= new Composite(parent, SWT.NONE); LayoutUtil.doDefaultLayout(composite, new DialogField[] { fProjectsList }, true, SWT.DEFAULT, SWT.DEFAULT); LayoutUtil.setHorizontalGrabbing(fProjectsList.getTreeControl(null)); int buttonBarWidth= converter.convertWidthInCharsToPixels(24); fProjectsList.setButtonsMinWidth(buttonBarWidth); fSWTControl= composite; return composite; }
public void createControl(Composite parent, int nOfColumns, int textWidth) { fShell= parent.getShell(); PixelConverter converter= new PixelConverter(parent); fSourceFolderSelection.doFillIntoGrid(parent, nOfColumns, textWidth); LayoutUtil.setWidthHint(fSourceFolderSelection.getTextControl(null), converter.convertWidthInCharsToPixels(60)); fPackageSelection.doFillIntoGrid(parent, nOfColumns, textWidth); LayoutUtil.setWidthHint(fPackageSelection.getTextControl(null), converter.convertWidthInCharsToPixels(60)); }
private Composite createMarkersTabContent(Composite folder) { GridLayout layout= new GridLayout(); layout.marginHeight= 0; layout.marginWidth= 0; layout.numColumns= 2; PixelConverter conv= new PixelConverter(folder); Composite markersComposite= new Composite(folder, SWT.NULL); markersComposite.setLayout(layout); markersComposite.setFont(folder.getFont()); GridData data= new GridData(GridData.FILL_BOTH); data.widthHint= conv.convertWidthInCharsToPixels(50); Control listControl= fTodoTasksList.getListControl(markersComposite); listControl.setLayoutData(data); Control buttonsControl= fTodoTasksList.getButtonBox(markersComposite); buttonsControl.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING)); fCaseSensitiveCheckBox.doFillIntoGrid(markersComposite, 2); return markersComposite; }
private void createKeysLink(Composite composite, int h_span) { Link link= new Link(composite, SWT.NONE | SWT.WRAP); link.setText(PreferencesMessages.CodeAssistAdvancedConfigurationBlock_key_binding_hint); link.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { PreferencesUtil.createPreferenceDialogOn(getShell(), e.text, null, null); } }); PixelConverter pixelConverter= new PixelConverter(composite); int width= pixelConverter.convertWidthInCharsToPixels(40); // limit the size of the Link as it would take all it can get GridData gd= new GridData(GridData.FILL, GridData.FILL, false, false, h_span, 1); gd.widthHint= width; link.setLayoutData(gd); }
public Control getControl(Composite parent) { PixelConverter converter= new PixelConverter(parent); Composite composite= new Composite(parent, SWT.NONE); LayoutUtil.doDefaultLayout(composite, new DialogField[] { fLibrariesList }, true, SWT.DEFAULT, SWT.DEFAULT); LayoutUtil.setHorizontalGrabbing(fLibrariesList.getTreeControl(null)); int buttonBarWidth= converter.convertWidthInCharsToPixels(24); fLibrariesList.setButtonsMinWidth(buttonBarWidth); fLibrariesList.setViewerComparator(new CPListElementSorter()); fSWTControl= composite; return composite; }
public Control getControl(Composite parent) { PixelConverter converter= new PixelConverter(parent); Composite composite= new Composite(parent, SWT.NONE); composite.setFont(parent.getFont()); LayoutUtil.doDefaultLayout(composite, new DialogField[] { fClassPathList }, true, SWT.DEFAULT, SWT.DEFAULT); LayoutUtil.setHorizontalGrabbing(fClassPathList.getListControl(null)); int buttonBarWidth= converter.convertWidthInCharsToPixels(24); fClassPathList.setButtonsMinWidth(buttonBarWidth); return composite; }
public Control getControl(Composite parent) { PixelConverter converter= new PixelConverter(parent); Composite composite= new Composite(parent, SWT.NONE); LayoutUtil.doDefaultLayout(composite, new DialogField[] { fLibrariesList }, true); LayoutUtil.setHorizontalGrabbing(fLibrariesList.getTreeControl(null)); int buttonBarWidth= converter.convertWidthInCharsToPixels(24); fLibrariesList.setButtonsMinWidth(buttonBarWidth); fLibrariesList.getTreeViewer().setComparator(new CPListElementSorter()); fSWTControl= composite; return composite; }
public Control getControl(Composite parent) { PixelConverter converter= new PixelConverter(parent); Composite composite= new Composite(parent, SWT.NONE); LayoutUtil.doDefaultLayout(composite, new DialogField[] { fLibrariesList }, true); LayoutUtil.setHorizontalGrabbing(fLibrariesList.getTreeControl(null)); int buttonBarWidth= converter.convertWidthInCharsToPixels(24); fLibrariesList.setButtonsMinWidth(buttonBarWidth); fLibrariesList.getTreeViewer().setComparator(new CPListElementSorter()); fSWTControl= composite; return composite; }
public static int openWizard(Shell shell, ClasspathContainerWizard wizard) { WizardDialog dialog= new WizardDialog(shell, wizard); PixelConverter converter= new PixelConverter(JFaceResources.getDialogFont()); dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(70), converter.convertHeightInCharsToPixels(20)); dialog.create(); return dialog.open(); }
public static void openJavadocWizard(AJdocWizard wizard, Shell shell, IStructuredSelection selection) { wizard.init(PlatformUI.getWorkbench(), selection); PixelConverter converter = new PixelConverter(shell); WizardDialog dialog = new WizardDialog(shell, wizard); dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(100), converter.convertHeightInCharsToPixels(20)); dialog.open(); }
public static void openJavadocWizard(JavadocWizard wizard, Shell shell, IStructuredSelection selection ) { wizard.init(PlatformUI.getWorkbench(), selection); WizardDialog dialog= new WizardDialog(shell, wizard); PixelConverter converter= new PixelConverter(JFaceResources.getDialogFont()); dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(100), converter.convertHeightInCharsToPixels(20)); dialog.open(); }
private void createSignaturePreview(Composite composite) { Label previewLabel= new Label(composite, SWT.NONE); previewLabel.setText(RefactoringMessages.ChangeSignatureInputPage_method_Signature_Preview); IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore(); fSignaturePreview= new JavaSourceViewer(composite, null, null, false, SWT.READ_ONLY | SWT.V_SCROLL | SWT.WRAP /*| SWT.BORDER*/, store); fSignaturePreview.configure(new JavaSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, null)); fSignaturePreview.getTextWidget().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT)); fSignaturePreview.getTextWidget().setBackground(composite.getBackground()); fSignaturePreview.setDocument(fSignaturePreviewDocument); fSignaturePreview.setEditable(false); //Layouting problems with wrapped text: see https://bugs.eclipse.org/bugs/show_bug.cgi?id=9866 Control signaturePreviewControl= fSignaturePreview.getControl(); PixelConverter pixelConverter= new PixelConverter(signaturePreviewControl); GridData gdata= new GridData(GridData.FILL_BOTH); gdata.widthHint= pixelConverter.convertWidthInCharsToPixels(50); gdata.heightHint= pixelConverter.convertHeightInCharsToPixels(2); signaturePreviewControl.setLayoutData(gdata); }
private IWizardPage[] openNewElementWizard(IWorkbenchWizard wizard, Shell shell, Object selection) { wizard.init(JavaPlugin.getDefault().getWorkbench(), new StructuredSelection(selection)); WizardDialog dialog= new WizardDialog(shell, wizard); PixelConverter converter= new PixelConverter(JFaceResources.getDialogFont()); dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(70), converter.convertHeightInCharsToPixels(20)); dialog.create(); dialog.open(); IWizardPage[] pages= wizard.getPages(); return pages; } }
private void createSignaturePreview(Composite composite, RowLayouter layouter) { Label previewLabel= new Label(composite, SWT.NONE); previewLabel.setText(RefactoringMessages.ExtractMethodInputPage_signature_preview); layouter.perform(previewLabel); IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore(); fSignaturePreview= new JavaSourceViewer(composite, null, null, false, SWT.READ_ONLY | SWT.V_SCROLL | SWT.WRAP /*| SWT.BORDER*/, store); fSignaturePreview.configure(new JavaSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, null)); fSignaturePreview.getTextWidget().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT)); fSignaturePreview.getTextWidget().setBackground(composite.getBackground()); fSignaturePreview.setDocument(fSignaturePreviewDocument); fSignaturePreview.setEditable(false); //Layouting problems with wrapped text: see https://bugs.eclipse.org/bugs/show_bug.cgi?id=9866 Control signaturePreviewControl= fSignaturePreview.getControl(); PixelConverter pixelConverter= new PixelConverter(signaturePreviewControl); GridData gdata= new GridData(GridData.FILL_BOTH); gdata.widthHint= pixelConverter.convertWidthInCharsToPixels(50); gdata.heightHint= pixelConverter.convertHeightInCharsToPixels(2); signaturePreviewControl.setLayoutData(gdata); layouter.perform(signaturePreviewControl); }
private void createMethodSignature(Composite parent) { IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore(); JavaSourceViewer signatureViewer= new JavaSourceViewer(parent, null, null, false, SWT.READ_ONLY | SWT.WRAP /*| SWT.BORDER*/, store); signatureViewer.configure(new JavaSourceViewerConfiguration(JavaPlugin.getDefault().getJavaTextTools().getColorManager(), store, null, null)); signatureViewer.getTextWidget().setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT)); signatureViewer.getTextWidget().setBackground(parent.getBackground()); String signatureLabel= JavaElementLabels.getElementLabel(fRefactoring.getMethod(), LABEL_FLAGS); signatureViewer.setDocument(new Document(signatureLabel)); signatureViewer.setEditable(false); Control signatureControl= signatureViewer.getControl(); PixelConverter pixelConverter= new PixelConverter(signatureControl); GridData gdata= new GridData(GridData.FILL_HORIZONTAL); gdata.widthHint= pixelConverter.convertWidthInCharsToPixels(50); signatureControl.setLayoutData(gdata); }