blob: 11f5bd3ce3bc1472a2f937af0ed934b99c0b37ca [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2012 Laurent CARON
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Laurent CARON (laurent.caron at gmail dot com) - initial API and implementation
*******************************************************************************/
package org.mihalis.opal.obutton;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;
import org.mihalis.opal.utils.SWTGraphicUtil;
/**
* This is the green theme button renderer.
*/
public class GreenButtonRenderer extends AbstractButtonRenderer {
/** The instance. */
private static GreenButtonRenderer instance;
/** The Constant FIRST_BACKGROUND_COLOR. */
private static final Color FIRST_BACKGROUND_COLOR = SWTGraphicUtil.getColorSafely(119, 212, 42);
/** The Constant SECOND_BACKGROUND_COLOR. */
private static final Color SECOND_BACKGROUND_COLOR = SWTGraphicUtil.getColorSafely(38, 138, 22);
/**
* Instantiates a new green button renderer.
*/
private GreenButtonRenderer() {
super();
}
/* (non-Javadoc)
* @see org.mihalis.opal.obutton.AbstractButtonRenderer#getFontColor()
*/
@Override
protected Color getFontColor() {
return Display.getDefault().getSystemColor(SWT.COLOR_WHITE);
}
/* (non-Javadoc)
* @see org.mihalis.opal.obutton.AbstractButtonRenderer#getFirstBackgroundColor()
*/
@Override
protected Color getFirstBackgroundColor() {
return FIRST_BACKGROUND_COLOR;
}
/* (non-Javadoc)
* @see org.mihalis.opal.obutton.AbstractButtonRenderer#getSecondBackgroundColor()
*/
@Override
protected Color getSecondBackgroundColor() {
return SECOND_BACKGROUND_COLOR;
}
/**
* Gets the single instance of GreenButtonRenderer.
*
* @return single instance of GreenButtonRenderer
*/
public static GreenButtonRenderer getInstance() {
if (instance == null) {
instance = new GreenButtonRenderer();
}
return instance;
}
}