public ScrolledPageContent(Composite parent, int style) { super(parent, style); setFont(parent.getFont()); FormColors colors = new FormColors(parent.getDisplay()); colors.setBackground(null); colors.setForeground(null); fToolkit = new FormToolkit(colors); setExpandHorizontal(true); setExpandVertical(true); Composite body = new Composite(this, SWT.NONE); body.setFont(parent.getFont()); setContent(body); }
@Override protected Composite createToolTipContentArea(Event event, Composite parent){ FormToolkit toolkit = new FormToolkit(parent.getDisplay()); FormColors colors = toolkit.getColors(); Form form = toolkit.createForm(parent); GridLayout layout = new GridLayout(); layout.numColumns = 1; form.getBody().setLayout(layout); FormText text = toolkit.createFormText(form.getBody(), true); GridData td = new GridData(); td.heightHint = 200; td.widthHint = 300; text.setLayoutData(td); try { text.setText("<form>"+m_htmlString+"</form>", true, true); } catch (IllegalArgumentException e) { text.setText("<form><p>Fehlerhafter ToolTip Eingabestring</p><br /></form>", true, true); } return parent; }
public ScrolledPageContent(Composite parent, int style) { super(parent, style); setFont(parent.getFont()); FormColors colors= new FormColors(parent.getDisplay()); colors.setBackground(null); colors.setForeground(null); fToolkit= new FormToolkit(colors); setExpandHorizontal(true); setExpandVertical(true); Composite body= new Composite(this, SWT.NONE); body.setFont(parent.getFont()); setContent(body); }
public AppEngineDeployPreferencesPanel(Composite parent, IProject project, IGoogleLoginService loginService, Runnable layoutChangedHandler, boolean requireValues, ProjectRepository projectRepository, DeployPreferences model) { super(parent, SWT.NONE); this.project = project; this.layoutChangedHandler = Preconditions.checkNotNull(layoutChangedHandler); this.requireValues = requireValues; this.projectRepository = projectRepository; this.model = model; FormColors colors = new FormColors(getDisplay()); colors.setBackground(null); colors.setForeground(null); formToolkit = new FormToolkit(colors); createCredentialSection(loginService); createProjectIdSection(); setupAccountEmailDataBinding(); setupProjectSelectorDataBinding(); createCenterArea(); createAdvancedSection(); setupTextFieldDataBinding(bucket, "bucket", new BucketNameValidator()); observables.addObservablesFromContext(bindingContext, true, true); Dialog.applyDialogFont(this); GridLayoutFactory.swtDefaults().numColumns(2).applyTo(this); }
public FormToolkit getDialogsFormToolkit() { if (dialogsFormToolkit == null) { FormColors colors = new FormColors(Display.getCurrent()); colors.setBackground(null); colors.setForeground(null); dialogsFormToolkit = new FormToolkit(colors); } return dialogsFormToolkit; }
public FormToolkit getDialogsFormToolkit() { if (fDialogsFormToolkit == null) { FormColors colors = new FormColors(Display.getCurrent()); colors.setBackground(null); colors.setForeground(null); fDialogsFormToolkit = new FormToolkit(colors); } return fDialogsFormToolkit; }
private static FormToolkit getFormToolkit() { if (toolkit == null) { FormColors colors = new FormColors(Display.getCurrent()); colors.setBackground(null); colors.setForeground(null); toolkit = new FormToolkit(colors); } return toolkit; }
public FormToolkit getDialogsFormToolkit() { if (fDialogsFormToolkit == null) { FormColors colors= new FormColors(Display.getCurrent()); colors.setBackground(null); colors.setForeground(null); fDialogsFormToolkit= new FormToolkit(colors); } return fDialogsFormToolkit; }
private Color createColor(int color1, int color2, int ratio, Display display) { RGB rgb1= display.getSystemColor(color1).getRGB(); RGB rgb2= display.getSystemColor(color2).getRGB(); RGB blend= FormColors.blend(rgb2, rgb1, ratio); return new Color(display, blend); }
private Color createColor( int color1, int color2, int ratio, Display display ) { RGB rgb1 = display.getSystemColor( color1 ).getRGB( ); RGB rgb2 = display.getSystemColor( color2 ).getRGB( ); RGB blend = FormColors.blend( rgb2, rgb1, ratio ); return new Color( display, blend ); }
private void initColors() { if (colors == null) { colors = new Color[COLOR_STEPS]; for (int i = 0; i < COLOR_STEPS; i++) { RGB rgb = FormColors.blend(RED, GREEN, Math.min((int) Math.round(i * (100d / COLOR_STEPS)), 100)); colors[i] = colorRegistry.getColor(rgb); } } }
protected void createFormContent(IManagedForm managedForm) { final ScrolledForm form = managedForm.getForm(); //form.setBackgroundImage(PDEPlugin.getDefault().getLabelProvider().get( // PDEPluginImages.DESC_FORM_BANNER)); FormToolkit toolkit = managedForm.getToolkit(); FormColors colors = toolkit.getColors(); form.getForm().setSeparatorColor(colors.getColor(FormColors.TB_BORDER)); if (newStyleHeader) { colors.initializeSectionToolBarColors(); Color gbg = colors.getColor(FormColors.TB_GBG); Color bg = colors.getBackground(); form.getForm().setTextBackground(new Color[]{bg, gbg}, new int [] {100}, true); form.getForm().setSeparatorVisible(true); } final String href = getHelpResource(); if (href != null) { IToolBarManager manager = form.getToolBarManager(); Action helpAction = new Action("help") { //$NON-NLS-1$ public void run() { BusyIndicator.showWhile(form.getDisplay(), new Runnable() { public void run() { PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(href); } }); } }; helpAction.setToolTipText("Help"); // helpAction.setImageDescriptor(PDEPluginImages.DESC_HELP); manager.add(helpAction); form.updateToolBar(); } }
protected Composite createToolTipContentArea(Event event, Composite parent) { FormToolkit toolkit = new FormToolkit(parent.getDisplay()); FormColors colors = toolkit.getColors(); Color top = colors.getColor(IFormColors.H_GRADIENT_END); Color bot = colors.getColor(IFormColors.H_GRADIENT_START); // create the base form Form form = toolkit.createForm(parent); form.setText(title); form.setTextBackground(new Color[] { top, bot }, new int[] { 100 }, true); FormLayout layout = new FormLayout(); layout.marginTop = 10; layout.marginBottom = 10; layout.marginLeft = 10; layout.marginRight = 10; form.getBody().setLayout(layout); // Scrolled text ScrolledFormText scrolledFormText = new ScrolledFormText(form.getBody(), true); FormText text = toolkit.createFormText(scrolledFormText, true); scrolledFormText.setAlwaysShowScrollBars(false); StringBuilder builder = new StringBuilder(); for (final String currentText : texts) { builder.append("<p>").append(currentText).append("</p>"); } text.setText(String.format("<form>%s</form>", builder.toString()), true, false); FormData data = new FormData(); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(100); scrolledFormText.setLayoutData(data); scrolledFormText.setFormText(text); scrolledFormText.setBackground(ColorConstants.white); return parent; }
public SwtRapCompatibilityFormToolkit(FormColors colors) { super(colors); }
/** * Initialize the colours used. */ private void initColours( ) { /* * Colour 3 COLOR_LIST_BACKGROUND */ listBackground = Display.getCurrent( ) .getSystemColor( SWT.COLOR_LIST_BACKGROUND ); /* * Colour 13 COLOR_WIDGET_BACKGROUND */ widgetBackground = Display.getCurrent( ) .getSystemColor( SWT.COLOR_WIDGET_BACKGROUND ); /* * Colour 16 COLOR_WIDGET_FOREGROUND */ widgetForeground = Display.getCurrent( ) .getSystemColor( SWT.COLOR_WIDGET_FOREGROUND ); /* * Colour 19 COLOR_WIDGET_NORMAL_SHADOW */ widgetNormalShadow = Display.getCurrent( ) .getSystemColor( SWT.COLOR_WIDGET_NORMAL_SHADOW ); RGB white = Display.getCurrent( ) .getSystemColor( SWT.COLOR_WHITE ) .getRGB( ); /* * Mimic palette view look and feel. */ defaultGradientStart = factory.getColors( ) .createColor( "TabbedPropertyList.defaultTabGradientStart", //$NON-NLS-1$ FormColors.blend( ColorConstants.button.getRGB( ), ColorConstants.listBackground.getRGB( ), 85 ) ); defaultGradientEnd = factory.getColors( ) .createColor( "TabbedPropertyList.defaultTabGradientEnd", //$NON-NLS-1$ FormColors.blend( ColorConstants.button.getRGB( ), ColorConstants.buttonDarker.getRGB( ), 45 ) ); /* * gradient in the hover tab: start colour WIDGET_BACKGROUND 100% + * white 20% end colour WIDGET_BACKGROUND 100% + WIDGET_NORMAL_SHADOW * 10% */ hoverGradientStart = factory.getColors( ) .createColor( "TabbedPropertyList.hoverBackgroundGradientStart", //$NON-NLS-1$ FormColors.blend( white, widgetBackground.getRGB( ), 20 ) ); hoverGradientEnd = factory.getColors( ) .createColor( "TabbedPropertyList.hoverBackgroundGradientEnd", //$NON-NLS-1$ FormColors.blend( widgetNormalShadow.getRGB( ), widgetBackground.getRGB( ), 10 ) ); indentedDefaultBackground = factory.getColors( ) .createColor( "TabbedPropertyList.indentedDefaultBackground", //$NON-NLS-1$ FormColors.blend( white, widgetBackground.getRGB( ), 10 ) ); indentedHoverBackground = factory.getColors( ) .createColor( "TabbedPropertyList.indentedHoverBackground", //$NON-NLS-1$ FormColors.blend( white, widgetBackground.getRGB( ), 75 ) ); }