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); }
private void createDefaultLabel(Composite composite, int h_span) { final ICommandService commandSvc= 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); }
private void createDefaultLabel(Composite composite, int h_span) { final ICommandService commandSvc= 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); }
@Override protected Control createContents(Composite parent) { ScrolledPageContent scrolled= new ScrolledPageContent(parent, SWT.H_SCROLL | SWT.V_SCROLL); scrolled.setExpandHorizontal(true); scrolled.setExpandVertical(true); Composite composite= new Composite(scrolled, SWT.NONE); int columns= 2; GridLayout layout= new GridLayout(columns, false); layout.marginWidth= 0; layout.marginHeight= 0; composite.setLayout(layout); createDefaultLabel(composite, columns); createDefaultViewer(composite, columns); createKeysLink(composite, columns); createFiller(composite, columns); createSeparateLabel(composite, columns); createSeparateSection(composite); createFiller(composite, columns); createParameterTimeoutControl(composite, columns); updateControls(); if (fModel.elements.size() > 0) { fDefaultViewer.getTable().select(0); fSeparateViewer.getTable().select(0); handleTableSelection(); } scrolled.setContent(composite); scrolled.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT)); return scrolled; }
createKeysLink(composite, columns); createFiller(composite, columns); createFiller(composite, columns);
@Override protected Control createContents(Composite parent) { ScrolledPageContent scrolled= new ScrolledPageContent(parent, SWT.H_SCROLL | SWT.V_SCROLL); scrolled.setExpandHorizontal(true); scrolled.setExpandVertical(true); Composite composite= new Composite(scrolled, SWT.NONE); int columns= 2; GridLayout layout= new GridLayout(columns, false); layout.marginWidth= 0; layout.marginHeight= 0; composite.setLayout(layout); createDefaultLabel(composite, columns); createDefaultViewer(composite, columns); createKeysLink(composite, columns); createFiller(composite, columns); createSeparateLabel(composite, columns); createSeparateSection(composite); createFiller(composite, columns); createParameterTimeoutControl(composite, columns); updateControls(); if (fModel.elements.size() > 0) { fDefaultViewer.getTable().select(0); fSeparateViewer.getTable().select(0); handleTableSelection(); } scrolled.setContent(composite); scrolled.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT)); return scrolled; }