]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.document.swt.core/src/org/simantics/document/swt/core/SWTDocument.java
Improvements to modelled SWT documents
[simantics/platform.git] / bundles / org.simantics.document.swt.core / src / org / simantics / document / swt / core / SWTDocument.java
1 /*******************************************************************************
2  * Copyright (c) 2019 Association for Decentralized Information Management
3  * in Industry THTH ry.
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
8  *
9  * Contributors:
10  *     Semantum Oy - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.document.swt.core;
13
14 import java.util.Collections;
15 import java.util.List;
16 import java.util.Map;
17
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;
29
30 public interface SWTDocument extends Document {
31
32     public static final Map<String,String> NO_PARAMETERS = Collections.emptyMap();
33
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);
40         void layout();
41
42     void displayError(String error);
43
44 }