|
Added
Link Here
|
| 1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2009 EclipseSource and others. All rights reserved. This |
| 3 |
* program and the accompanying materials are made available under the terms of |
| 4 |
* the Eclipse Public License v1.0 which accompanies this distribution, and is |
| 5 |
* available at http://www.eclipse.org/legal/epl-v10.html |
| 6 |
* |
| 7 |
* Contributors: |
| 8 |
* EclipseSource - initial API and implementation |
| 9 |
*******************************************************************************/ |
| 10 |
package org.eclipse.rap.examples.internal.design; |
| 11 |
|
| 12 |
import org.eclipse.rap.ui.interactiondesign.layout.model.ILayoutSetInitializer; |
| 13 |
import org.eclipse.rap.ui.interactiondesign.layout.model.LayoutSet; |
| 14 |
import org.eclipse.swt.layout.FormAttachment; |
| 15 |
import org.eclipse.swt.layout.FormData; |
| 16 |
|
| 17 |
|
| 18 |
public class LogoInitializer implements ILayoutSetInitializer { |
| 19 |
|
| 20 |
public static final String SET_ID |
| 21 |
= "org.eclipse.rap.design.example.business.layoutset.logo"; |
| 22 |
|
| 23 |
public static final String LOGO = "header.logo"; |
| 24 |
public static final String LOGO_POSITION = "header.logo.position"; |
| 25 |
|
| 26 |
public LogoInitializer() { |
| 27 |
} |
| 28 |
|
| 29 |
public void initializeLayoutSet( LayoutSet layoutSet ) { |
| 30 |
layoutSet.addImagePath( LOGO, "icons/logo.png" ); |
| 31 |
|
| 32 |
// positions |
| 33 |
FormData fdLogo = new FormData(); |
| 34 |
fdLogo.right = new FormAttachment( 100, -75 ); |
| 35 |
fdLogo.top = new FormAttachment( 0, 32 ); |
| 36 |
layoutSet.addPosition( LOGO_POSITION, fdLogo ); |
| 37 |
} |
| 38 |
} |