1 /*******************************************************************************
2 * Copyright (c) 2019 Association for Decentralized Information Management
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 * Semantum Oy - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.document.swt.core;
14 import java.util.Collections;
15 import java.util.List;
18 import org.eclipse.jface.viewers.ISelectionProvider;
19 import org.eclipse.swt.graphics.Color;
20 import org.eclipse.swt.graphics.Font;
21 import org.eclipse.ui.IWorkbenchSite;
22 import org.simantics.document.server.client.Document;
23 import org.simantics.document.server.client.WidgetData;
24 import org.simantics.document.server.io.AbstractEventHandler;
25 import org.simantics.document.server.io.CommandContext;
26 import org.simantics.document.server.io.CommandContextMutable;
27 import org.simantics.document.server.io.ICommand;
28 import org.simantics.utils.datastructures.Pair;
30 public interface SWTDocument extends Document {
32 public static final Map<String,String> NO_PARAMETERS = Collections.emptyMap();
34 IWorkbenchSite getSite();
35 ISelectionProvider getSelectionProvider();
36 Color getColor(org.simantics.datatypes.literal.RGB.Integer bean);
37 Font getFont(org.simantics.datatypes.literal.Font bean);
38 void post(AbstractEventHandler handler, CommandContextMutable context);
39 CommandContext handleCommands(List<Pair<WidgetData, ICommand>> data, CommandContextMutable context, Object component);
42 void displayError(String error);