1 /*******************************************************************************
\r
2 * Copyright (c) 2012, 2013 Association for Decentralized Information Management in
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.g3d.property;
\r
15 public class IntegerPropertyManipulator implements PropertyManipulator {
\r
17 ValueProvider provider;
\r
21 String editValue = null;
\r
23 public IntegerPropertyManipulator(ValueProvider provider, Object input) {
\r
24 this.provider = provider;
\r
29 public int getValueCount() {
\r
34 public String getDescription(int i) {
\r
41 public String getValue(int i) {
\r
45 return provider.getValue(input).toString();
\r
46 } catch (Exception e) {
\r
52 public String setValue(String value, int i) {
\r
55 provider.setValue(input, Integer.parseInt(value));
\r
56 } catch (Exception e) {
\r
57 return e.getMessage();
\r
63 public boolean getEditMode() {
\r
68 public void setEditMode(boolean b) {
\r
72 editValue = provider.getValue(input).toString();
\r
73 } catch (Exception e) {
\r