diff options
Diffstat (limited to 'propertysheet/src/org/eclipse/wb/internal/core/model/property/editor/presentation/ButtonPropertyEditorPresentationImplMac.java')
-rw-r--r-- | propertysheet/src/org/eclipse/wb/internal/core/model/property/editor/presentation/ButtonPropertyEditorPresentationImplMac.java | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/propertysheet/src/org/eclipse/wb/internal/core/model/property/editor/presentation/ButtonPropertyEditorPresentationImplMac.java b/propertysheet/src/org/eclipse/wb/internal/core/model/property/editor/presentation/ButtonPropertyEditorPresentationImplMac.java new file mode 100644 index 0000000..d61a606 --- /dev/null +++ b/propertysheet/src/org/eclipse/wb/internal/core/model/property/editor/presentation/ButtonPropertyEditorPresentationImplMac.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright (c) 2011 Google, Inc. + * 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: + * Google, Inc. - initial API and implementation + *******************************************************************************/ +package org.eclipse.wb.internal.core.model.property.editor.presentation; + +import org.eclipse.wb.core.controls.CFlatButton; +import org.eclipse.wb.internal.core.model.property.Property; +import org.eclipse.wb.internal.core.model.property.table.PropertyTable; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Control; + +/** + * Internal implementation of {@link PropertyEditorPresentation} for displaying special owner-draw + * button for Mac OSX. + * + * @author mitin_aa + * @coverage core.model.property.editor + */ +final class ButtonPropertyEditorPresentationImplMac extends ButtonPropertyEditorPresentationImpl { + //////////////////////////////////////////////////////////////////////////// + // + // Constructor + // + //////////////////////////////////////////////////////////////////////////// + public ButtonPropertyEditorPresentationImplMac(ButtonPropertyEditorPresentation presentation) { + super(presentation); + } + + //////////////////////////////////////////////////////////////////////////// + // + // Control + // + //////////////////////////////////////////////////////////////////////////// + @Override + protected final Control createControlImpl(final PropertyTable propertyTable, Property property) { + CFlatButton button = new CFlatButton(propertyTable, SWT.NONE); + button.setImage(getPresentation().getImage()); + button.setToolTipText(getPresentation().getTooltip()); + return button; + } + + @Override + public final void setSelection(PropertyTable propertyTable, Property property, boolean selected) { + CFlatButton button = (CFlatButton) m_propertyToControl.get(propertyTable, property); + if (button != null) { + button.setSelected(selected); + } + } +} |