blob: 4e99d0f8387c93c335493aefe2f1dc585dab1488 [file] [log] [blame]
/**
* Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* All rights reserved. This program and the accompanying materials
* are 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:
* Florian Pirchner - Initial implementation
*/
package org.eclipse.osbp.runtime.designer.api;
/**
* This service is used by ECView components like layouts to deal with designer
* features. There is one instance per ECView context.
*
* <code>@Scope(Session-Scope)</code> If running in a web session, all ECViews in the session
* may share this instance.
* <code>@Scope(View-Scope)</code> But also each ECView-Context may use its own service.
* @NoImplementByClients use AbstractImplementation
*/
public interface IDesignerService {
/**
* Returns true, if the design mode is active.
*
* @return true, if is design mode
*/
boolean isDesignMode();
/**
* If true, the design mode for the related ECView is activate. Deactivated
* otherwise.
*
* @param value
* the new design mode
*/
void setDesignMode(boolean value);
/**
* Adds a design listener.
*
* @param listener
* the listener
*/
void addListener(IDesignListener listener);
/**
* Removes the given design listener.
*
* @param listener
* the listener
*/
void removeListener(IDesignListener listener);
/**
* Listeners may deal with design events.
*
* @see DesignEvent
*/
public interface IDesignListener {
/**
* The design event to be processed.
*
* @param event
* the event
*/
void notify(DesignEvent event);
}
/**
* The Class DesignEvent.
*/
public class DesignEvent {
/** The type. */
private final EventType type;
/**
* Instantiates a new design event.
*
* @param type
* the type
*/
public DesignEvent(EventType type) {
super();
this.type = type;
}
/**
* Gets the type.
*
* @return the type
*/
public EventType getType() {
return type;
}
}
/**
* The Enum EventType.
*/
public enum EventType {
/** The enabled. */
ENABLED,
/** The disabled. */
DISABLED
}
}