Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JBDS-3489] : 1st iteration => use tabs for template selection
Signed-off-by: Fred Bricon <fbricon@gmail.com>
- Loading branch information
Showing
2 changed files
with
124 additions
and
59 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
.../org/jboss/tools/openshift/internal/common/ui/databinding/TabFolderSelectionProperty.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2015 Red Hat, Inc. | ||
* Distributed under license by Red Hat, Inc. All rights reserved. | ||
* This program is 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: | ||
* Red Hat, Inc. - initial API and implementation | ||
******************************************************************************/ | ||
package org.jboss.tools.openshift.internal.common.ui.databinding; | ||
|
||
import org.eclipse.jface.databinding.swt.WidgetValueProperty; | ||
import org.eclipse.swt.SWT; | ||
import org.eclipse.swt.widgets.TabFolder; | ||
|
||
/** | ||
* Value property implementation for {@link TabFolder} selected tab. | ||
* | ||
* @author Fred Bricon | ||
*/ | ||
public class TabFolderSelectionProperty extends WidgetValueProperty { | ||
|
||
public TabFolderSelectionProperty() { | ||
super(SWT.Selection); | ||
} | ||
|
||
@Override | ||
public Object getValueType() { | ||
return Integer.TYPE; | ||
} | ||
|
||
@Override | ||
protected Object doGetValue(Object source) { | ||
return Integer.valueOf(((TabFolder)source).getSelectionIndex()); | ||
} | ||
|
||
@Override | ||
protected void doSetValue(Object source, Object value) { | ||
((TabFolder)source).setSelection((Integer) value); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters