1 /*******************************************************************************
2 * Copyright (c) 2007, 2012 Association for Decentralized Information Management in
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.browsing.ui.swt;
14 import java.util.function.Consumer;
16 import org.simantics.db.procedure.Procedure;
17 import org.simantics.utils.ui.ErrorLogger;
20 * @author Tuukka Lehtonen
22 public class PartNameProcedure implements Procedure<String> {
24 protected final Consumer<String> updateCallback;
26 public PartNameProcedure(Consumer<String> updateCallback) {
27 assert updateCallback != null;
28 this.updateCallback = updateCallback;
32 public void execute(String result) {
33 // System.out.println("part name changed: " + result);
34 updateCallback.accept(result);
38 public void exception(Throwable t) {
39 ErrorLogger.defaultLogError(t);