toolkit.createLabel( sectionClient, "Applet Width*:" );
Text t = toolkit.createText( sectionClient, "", SWT.BORDER );
GridData gd = new GridData( GridData.FILL_HORIZONTAL );
gd.horizontalSpan = COLUMN_COUNT - 1;
t.setLayoutData( gd );
IEMFValueProperty prop = EMFEditProperties.value( editingDomain, FeaturePath.fromList( ANT_TASK__DEPLOY, DEPLOY__WIDTH ) );
dbc.bindValue( textModify.observeDelayed( DELAY, t ), prop.observeDetail( bean ) );
}
{
toolkit.createLabel( sectionClient, "Applet Height*:" );
Text t = toolkit.createText( sectionClient, "", SWT.BORDER );
GridData gd = new GridData( GridData.FILL_HORIZONTAL );
gd.horizontalSpan = COLUMN_COUNT - 1;
t.setLayoutData( gd );
IEMFValueProperty prop = EMFEditProperties.value( editingDomain, FeaturePath.fromList( ANT_TASK__DEPLOY, DEPLOY__HEIGHT ) );
dbc.bindValue( textModify.observeDelayed( DELAY, t ), prop.observeDetail( bean ) );
}
{
Button b = toolkit.createButton( sectionClient, "Embed JNLP", SWT.CHECK );
b.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, COLUMN_COUNT, 1 ) );
IEMFValueProperty prop = EMFEditProperties.value( editingDomain, FeaturePath.fromList( ANT_TASK__DEPLOY, DEPLOY__EMBEDJNLP ) );
dbc.bindValue( selChange.observe( b ), prop.observeDetail( bean ) );
}
{
Button b = toolkit.createButton( sectionClient, "Treat files as extensions", SWT.CHECK );
b.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, COLUMN_COUNT, 1 ) );
IEMFValueProperty prop = EMFEditProperties.value( editingDomain, FeaturePath.fromList( ANT_TASK__DEPLOY, DEPLOY__EXTENSION ) );
dbc.bindValue( selChange.observe( b ), prop.observeDetail( bean ) );
}
{
Button b = toolkit.createButton( sectionClient, "Include deployment toolkit", SWT.CHECK );
b.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, COLUMN_COUNT, 1 ) );
IEMFValueProperty prop = EMFEditProperties.value( editingDomain, FeaturePath.fromList( ANT_TASK__DEPLOY, DEPLOY__INCLUDE_DT ) );
dbc.bindValue( selChange.observe( b ), prop.observeDetail( bean ) );
}
{
Button b = toolkit.createButton( sectionClient, "Offline allowed", SWT.CHECK );
b.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, COLUMN_COUNT, 1 ) );
IEMFValueProperty prop = EMFEditProperties.value( editingDomain, FeaturePath.fromList( ANT_TASK__DEPLOY, DEPLOY__OFFLINE_ALLOWED ) );
dbc.bindValue( selChange.observe( b ), prop.observeDetail( bean ) );
}
{
toolkit.createLabel( sectionClient, "Placeholder Ref.*:" );
Text t = toolkit.createText( sectionClient, "", SWT.BORDER );
GridData gd = new GridData( GridData.FILL_HORIZONTAL );
gd.horizontalSpan = COLUMN_COUNT - 1;
t.setLayoutData( gd );
IEMFValueProperty prop = EMFEditProperties.value( editingDomain, FeaturePath.fromList( ANT_TASK__DEPLOY, DEPLOY__PLACEHOLDERREF ) );
dbc.bindValue( textModify.observeDelayed( DELAY, t ), prop.observeDetail( bean ) );
}
{
toolkit.createLabel( sectionClient, "Placeholder ID*:" );
Text t = toolkit.createText( sectionClient, "", SWT.BORDER );
GridData gd = new GridData( GridData.FILL_HORIZONTAL );
gd.horizontalSpan = COLUMN_COUNT - 1;
t.setLayoutData( gd );
IEMFValueProperty prop = EMFEditProperties.value( editingDomain, FeaturePath.fromList( ANT_TASK__DEPLOY, DEPLOY__PLACEHOLDERID ) );
dbc.bindValue( textModify.observeDelayed( DELAY, t ), prop.observeDetail( bean ) );
}
{
toolkit.createLabel( sectionClient, "HTML Template:" );
Text t = toolkit.createText( sectionClient, "", SWT.BORDER );
t.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
IEMFValueProperty prop = EMFEditProperties.value( editingDomain, FeaturePath.fromList( ANT_TASK__DEPLOY, DEPLOY__TEMPLATE, TEMPLATE__FILE ) );
dbc.bindValue( textModify.observeDelayed( DELAY, t ), prop.observeDetail( bean ) );
Button b = toolkit.createButton( sectionClient, "Workspace ...", SWT.NONE );
b.addSelectionListener( new SelectionAdapter() {
@Override
public void widgetSelected( final SelectionEvent e ) {
FilteredResourcesSelectionDialog d = new FilteredResourcesSelectionDialog( getSite().getShell(), false,
( (IFileEditorInput) getEditorInput() ).getFile().getProject(), IResource.FILE ) {
@Override
protected IStatus validateItem( final Object item ) {
IFile f = (IFile) item;
if ( f.getParent() instanceof IProject ) {
return new Status( IStatus.ERROR, JavaFXUIPlugin.PLUGIN_ID, "The selected resource has to be part of the source folder" );
}
if ( !f.getName().endsWith( JavaFXUIPlugin.FILEEXTENSION_HTML_TEMPLATE ) ) {
return new Status( IStatus.ERROR, JavaFXUIPlugin.PLUGIN_ID, "The selected resource does not seem to be a html file" );
}
return super.validateItem( item );
}
};
if ( d.open() == ResourceSelectionDialog.OK ) {
Object[] rv = d.getResult();
if ( rv.length == 1 ) {
IFile f = (IFile) rv[0];
IJavaElement j = JavaCore.create( f.getParent() );
String template = null;
if ( j instanceof IPackageFragment ) {
IPackageFragment p = (IPackageFragment) j;
template = p.getElementName().replace( '.', '/' ) + "/" + f.getName();
}
else if ( j instanceof IPackageFragmentRoot ) {
IPackageFragmentRoot p = (IPackageFragmentRoot) j;
template = f.getName();
}
else {
MessageDialog.openInformation( getSite().getShell(), "Not valid",
"The selected resource has to be part of the source folder" );
}
if ( template != null ) {
if ( getTask().getDeploy().getTemplate() == null ) {
Command cmd = new SetCommand( editingDomain, getTask().getDeploy(), DEPLOY__TEMPLATE, ParametersFactory.eINSTANCE
.createTemplate() );
if ( cmd.canExecute() ) {
cmd.execute();
}
}
Command cmd = new SetCommand( editingDomain, getTask().getDeploy().getTemplate(), TEMPLATE__FILE, template );
if ( cmd.canExecute() ) {
cmd.execute();
}
}
}
}
}
} );
}
{
toolkit.createLabel( sectionClient, "Template Output File:" );
Text t = toolkit.createText( sectionClient, "", SWT.BORDER );
GridData gd = new GridData( GridData.FILL_HORIZONTAL );
gd.horizontalSpan = COLUMN_COUNT - 1;
t.setLayoutData( gd );
IEMFValueProperty prop = EMFEditProperties.value( editingDomain, FeaturePath.fromList( ANT_TASK__DEPLOY, DEPLOY__TEMPLATE, TEMPLATE__TO_FILE ) );
dbc.bindValue( textModify.observeDelayed( DELAY, t ), prop.observeDetail( bean ) );
}
{
toolkit.createLabel( sectionClient, "Webstart Splash:" ).setLayoutData( new GridData( GridData.BEGINNING, GridData.BEGINNING, false, false ) );
Composite container = toolkit.createComposite( sectionClient );
GridLayout gl = new GridLayout( 2, false );
gl.marginBottom = gl.marginHeight = gl.marginLeft = gl.marginRight = gl.marginTop = gl.marginWidth = 0;
container.setLayout( gl );
GridData gdContainer = new GridData( GridData.FILL_HORIZONTAL );
gdContainer.horizontalSpan = COLUMN_COUNT - 1;
container.setLayoutData( gdContainer );
Composite tableContainer = toolkit.createComposite( container );
Table t = toolkit.createTable( tableContainer, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER );
t.setHeaderVisible( true );
t.setLinesVisible( true );
GridData gdTable = new GridData( GridData.FILL_HORIZONTAL );
gdTable.heightHint = t.getItemHeight() * 5;
tableContainer.setLayoutData( gdTable );
TableColumnLayout tablelayout = new TableColumnLayout();
final TableViewer v = new TableViewer( t );
GridData gd = new GridData( GridData.FILL_HORIZONTAL );
gd.heightHint = t.getItemHeight() * 5;
v.getControl().setLayoutData( gd );
v.setContentProvider( ArrayContentProvider.getInstance() );
{
TableViewerColumn c = new TableViewerColumn( v, SWT.NONE );
c.setLabelProvider( new ColumnLabelProvider() {
@Override
public String getText( final Object element ) {
return ( (Splash) element ).getMode().getName();
}
} );
tablelayout.setColumnData( c.getColumn(), new ColumnWeightData( 10, 100, false ) );
c.getColumn().setText( "Mode" );
}
{
TableViewerColumn c = new TableViewerColumn( v, SWT.NONE );
c.setLabelProvider( new ColumnLabelProvider() {
@Override
public String getText( final Object element ) {
return ( (Splash) element ).getHref();
}
} );
tablelayout.setColumnData( c.getColumn(), new ColumnWeightData( 90 ) );
c.getColumn().setText( "URL" );
}
tableContainer.setLayout( tablelayout );
v.setInput( task.getDeploy().getInfo().getSplash() );
Composite buttonComp = toolkit.createComposite( container );
buttonComp.setLayoutData( new GridData( GridData.BEGINNING, GridData.END, false, false ) );
buttonComp.setLayout( new GridLayout() );
{
Button b = toolkit.createButton( buttonComp, "Add ...", SWT.PUSH );
b.setLayoutData( new GridData( GridData.FILL, GridData.BEGINNING, false, false ) );
b.addSelectionListener( new SelectionAdapter() {
@Override
public void widgetSelected( final SelectionEvent e ) {
if ( handleAddSplash() ) {
v.setInput( task.getDeploy().getInfo().getSplash() );
v.setSelection( new StructuredSelection( task.getDeploy().getInfo().getSplash()
.get( task.getDeploy().getInfo().getSplash().size() - 1 ) ) );
}
}
} );
}
{
Button b = toolkit.createButton( buttonComp, "Remove", SWT.PUSH );
b.setLayoutData( new GridData( GridData.FILL, GridData.BEGINNING, false, false ) );
b.addSelectionListener( new SelectionAdapter() {
@Override
public void widgetSelected( final SelectionEvent e ) {
Splash value = (Splash) ( (IStructuredSelection) v.getSelection() ).getFirstElement();
if ( value != null ) {
if ( handleRemoveSplash( value ) ) {
v.setInput( getTask().getDeploy().getInfo().getSplash() );
}
}
else {
MessageDialog.openWarning( getSite().getShell(), "Warning", "Please select an entry" );
}
}
} );
}
}
{
toolkit.createLabel( sectionClient, "Webstart Icons:" ).setLayoutData( new GridData( GridData.BEGINNING, GridData.BEGINNING, false, false ) );
Composite container = toolkit.createComposite( sectionClient );
GridLayout gl = new GridLayout( 2, false );
gl.marginBottom = gl.marginHeight = gl.marginLeft = gl.marginRight = gl.marginTop = gl.marginWidth = 0;
container.setLayout( gl );
GridData gdContainer = new GridData( GridData.FILL_HORIZONTAL );
gdContainer.horizontalSpan = COLUMN_COUNT - 1;
container.setLayoutData( gdContainer );
Composite tableContainer = toolkit.createComposite( container );
Table t = toolkit.createTable( tableContainer, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER );
t.setHeaderVisible( true );
t.setLinesVisible( true );
GridData gdTable = new GridData( GridData.FILL_HORIZONTAL );
gdTable.heightHint = t.getItemHeight() * 5;
tableContainer.setLayoutData( gdTable );
TableColumnLayout tablelayout = new TableColumnLayout();
final TableViewer v = new TableViewer( t );
GridData gd = new GridData( GridData.FILL_HORIZONTAL );
gd.heightHint = t.getItemHeight() * 5;
v.getControl().setLayoutData( gd );
v.setContentProvider( ArrayContentProvider.getInstance() );
{
TableViewerColumn c = new TableViewerColumn( v, SWT.NONE );
c.setLabelProvider( new ColumnLabelProvider() {
@Override
public String getText( Object element ) {
return ( (Icon) element ).getDepth();
}
} );
tablelayout.setColumnData( c.getColumn(), new ColumnWeightData( 10, 50, false ) );
c.getColumn().setText( "Depth" );
}
{
TableViewerColumn c = new TableViewerColumn( v, SWT.NONE );
c.setLabelProvider( new ColumnLabelProvider() {
@Override
public String getText( Object element ) {
return ( (Icon) element ).getKind().getName();
}
} );
tablelayout.setColumnData( c.getColumn(), new ColumnWeightData( 10, 100, false ) );
c.getColumn().setText( "Kind" );
}
{
TableViewerColumn c = new TableViewerColumn( v, SWT.NONE );
c.setLabelProvider( new ColumnLabelProvider() {
@Override
public String getText( Object element ) {
return ( (Icon) element ).getWidth();
}
} );
tablelayout.setColumnData( c.getColumn(), new ColumnWeightData( 10, 50, false ) );
c.getColumn().setText( "Width" );
}
{
TableViewerColumn c = new TableViewerColumn( v, SWT.NONE );
c.setLabelProvider( new ColumnLabelProvider() {
@Override
public String getText( Object element ) {
return ( (Icon) element ).getHeight();
}
} );
tablelayout.setColumnData( c.getColumn(), new ColumnWeightData( 10, 50, false ) );
c.getColumn().setText( "Height" );
}
{
TableViewerColumn c = new TableViewerColumn( v, SWT.NONE );
c.setLabelProvider( new ColumnLabelProvider() {
@Override
public String getText( Object element ) {
return ( (Icon) element ).getHref();
}
} );
tablelayout.setColumnData( c.getColumn(), new ColumnWeightData( 60 ) );
c.getColumn().setText( "Url" );
}
tableContainer.setLayout( tablelayout );
v.setInput( task.getDeploy().getInfo().getIcon() );
Composite buttonComp = toolkit.createComposite( container );
buttonComp.setLayoutData( new GridData( GridData.BEGINNING, GridData.END, false, false ) );
buttonComp.setLayout( new GridLayout() );
{
Button b = toolkit.createButton( buttonComp, "Add ...", SWT.PUSH );
b.setLayoutData( new GridData( GridData.FILL, GridData.BEGINNING, false, false ) );
b.addSelectionListener( new SelectionAdapter() {
@Override
public void widgetSelected( final SelectionEvent e ) {
if ( handleAddIcon() ) {
v.setInput( task.getDeploy().getInfo().getIcon() );
v.setSelection( new StructuredSelection( task.getDeploy().getInfo().getIcon()
.get( task.getDeploy().getInfo().getIcon().size() - 1 ) ) );
}
}
} );
}
{
Button b = toolkit.createButton( buttonComp, "Remove", SWT.PUSH );
b.setLayoutData( new GridData( GridData.FILL, GridData.BEGINNING, false, false ) );
b.addSelectionListener( new SelectionAdapter() {
@Override
public void widgetSelected( final SelectionEvent e ) {
Icon value = (Icon) ( (IStructuredSelection) v.getSelection() ).getFirstElement();
if ( value != null ) {
if ( handleRemoveIcon( value ) ) {
v.setInput( task.getDeploy().getInfo().getIcon() );
}
}
else {
MessageDialog.openWarning( getSite().getShell(), "Warning", "Please select an entry" );
}
}
} );
}
}
{
toolkit.createLabel( sectionClient, "Additional META-INF files:" ).setLayoutData(
new GridData( GridData.BEGINNING, GridData.BEGINNING, false, false ) );
Composite container = toolkit.createComposite( sectionClient );
GridLayout gl = new GridLayout( 2, false );
gl.marginBottom = gl.marginHeight = gl.marginLeft = gl.marginRight = gl.marginTop = gl.marginWidth = 0;
container.setLayout( gl );
GridData gdContainer = new GridData( GridData.FILL_HORIZONTAL );
gdContainer.horizontalSpan = COLUMN_COUNT - 1;
container.setLayoutData( gdContainer );
Composite tableContainer = toolkit.createComposite( container );
Table t = toolkit.createTable( tableContainer, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER );
t.setHeaderVisible( true );
t.setLinesVisible( true );
GridData gdTable = new GridData( GridData.FILL_HORIZONTAL );
gdTable.heightHint = t.getItemHeight() * 5;
tableContainer.setLayoutData( gdTable );
TableColumnLayout tablelayout = new TableColumnLayout();
final TableViewer v = new TableViewer( t );
GridData gd = new GridData( GridData.FILL_HORIZONTAL );
gd.heightHint = t.getItemHeight() * 5;
v.getControl().setLayoutData( gd );
v.setContentProvider( ArrayContentProvider.getInstance() );
{
TableViewerColumn c = new TableViewerColumn( v, SWT.NONE );
c.setLabelProvider( new ColumnLabelProvider() {
@Override
public String getText( Object element ) {
return ( (KeyValuePair) element ).getKey();
}
} );
tablelayout.setColumnData( c.getColumn(), new ColumnWeightData( 33 ) );
c.getColumn().setText( "Folder" );
}
{
TableViewerColumn c = new TableViewerColumn( v, SWT.NONE );
c.setLabelProvider( new ColumnLabelProvider() {
@Override
public String getText( Object element ) {
return ( (KeyValuePair) element ).getValue();
}
} );
tablelayout.setColumnData( c.getColumn(), new ColumnWeightData( 67 ) );
c.getColumn().setText( "File" );
}
tableContainer.setLayout( tablelayout );
v.setInput( task.getFiles() );
Composite buttonComp = toolkit.createComposite( container );
buttonComp.setLayoutData( new GridData( GridData.BEGINNING, GridData.END, false, false ) );
buttonComp.setLayout( new GridLayout() );
{
Button b = toolkit.createButton( buttonComp, "Add ...", SWT.PUSH );
b.setLayoutData( new GridData( GridData.FILL, GridData.BEGINNING, false, false ) );
b.addSelectionListener( new SelectionAdapter() {
@Override
public void widgetSelected( final SelectionEvent e ) {
if ( handleAddMetaInfFile() ) {
v.setInput( task.getFiles() );
v.setSelection( new StructuredSelection( task.getFiles().get( task.getFiles().size() - 1 ) ) );
}
}
} );
}
{
Button b = toolkit.createButton( buttonComp, "Remove", SWT.PUSH );
b.setLayoutData( new GridData( GridData.FILL, GridData.BEGINNING, false, false ) );
b.addSelectionListener( new SelectionAdapter() {
@Override
public void widgetSelected( final SelectionEvent e ) {
KeyValuePair value = (KeyValuePair) ( (IStructuredSelection) v.getSelection() ).getFirstElement();
if ( value != null ) {
if ( handleRemoveMetaInfFile( value ) ) {
v.setInput( task.getFiles() );
}
}
else {
MessageDialog.openWarning( getSite().getShell(), "Warning", "Please select an entry" );
}
}
} );
}
}
{
toolkit.createLabel( sectionClient, "Fonts:" ).setLayoutData( new GridData( GridData.BEGINNING, GridData.BEGINNING, false, false ) );
Composite container = toolkit.createComposite( sectionClient );
GridLayout gl = new GridLayout( 2, false );
gl.marginBottom = gl.marginHeight = gl.marginLeft = gl.marginRight = gl.marginTop = gl.marginWidth = 0;
container.setLayout( gl );
GridData gdContainer = new GridData( GridData.FILL_HORIZONTAL );
gdContainer.horizontalSpan = COLUMN_COUNT - 1;
container.setLayoutData( gdContainer );
Composite tableContainer = toolkit.createComposite( container );
Table t = toolkit.createTable( tableContainer, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER );
t.setHeaderVisible( true );
t.setLinesVisible( true );
GridData gdTable = new GridData( GridData.FILL_HORIZONTAL );
gdTable.heightHint = t.getItemHeight() * 5;
tableContainer.setLayoutData( gdTable );
TableColumnLayout tablelayout = new TableColumnLayout();
final TableViewer v = new TableViewer( t );
GridData gd = new GridData( GridData.FILL_HORIZONTAL );
gd.heightHint = t.getItemHeight() * 5;
v.getControl().setLayoutData( gd );
final ArrayContentProvider cp = new ArrayContentProvider();
v.setContentProvider( cp );
{
IEMFValueProperty prop = EMFEditProperties.value( editingDomain, ParametersPackage.Literals.KEY_VALUE_PAIR__KEY );
TableViewerColumn c = new TableViewerColumn( v, SWT.NONE );
TableColumn tc = c.getColumn();
tc.setText( "Font name" );
c.setLabelProvider( new ColumnLabelProvider() {
@Override
public String getText( Object element ) {
return ( (KeyValuePair) element ).getKey();
}
} );
tablelayout.setColumnData( c.getColumn(), new ColumnWeightData( 33 ) );
}
{
IEMFValueProperty prop = EMFEditProperties.value( editingDomain, ParametersPackage.Literals.KEY_VALUE_PAIR__VALUE );
TableViewerColumn c = new TableViewerColumn( v, SWT.NONE );
TableColumn tc = c.getColumn();
tc.setText( "File" );
c.setLabelProvider( new ColumnLabelProvider() {
@Override