Commit 01d488ca authored by Jay Jay Billings's avatar Jay Jay Billings
Browse files

Added TaskLaunchDialog skeleton code.


Signed-off-by: default avatarJay Jay Billings <billingsjj@ornl.gov>
parent ada84325
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>July 1, 2014</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>July 1, 2014</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>July 1, 2014</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
</body>
</html>
\ No newline at end of file
......@@ -13,6 +13,7 @@ Require-Bundle: org.eclipse.ice.datastructures,
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.eclipse.core.runtime;version="3.5.0",
org.eclipse.ice.client.widgets,
org.eclipse.ice.iclient,
org.eclipse.ice.iclient.uiwidgets,
org.eclipse.ice.persistence.xml,
org.eclipse.ice.reflectivity,
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>July 1, 2014</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
</body>
</html>
\ No newline at end of file
......@@ -3,5 +3,7 @@ bin.includes = META-INF/,\
.,\
build.properties,\
plugin.xml,\
plugin_customization.ini
plugin_customization.ini,\
about.html,\
icons/
source.. = src/
......@@ -105,5 +105,32 @@
</contentTypeBinding>
</editor>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="toolbar:org.eclipse.ui.main.toolbar">
<toolbar
id="org.eclipse.ice.reflectivity.ui.toolbar"
label="Reflectivity Toolbar">
<command
commandId="org.eclipse.ice.reflectivity.ui.TaskLaunchHandler"
icon="icons/sns_small.png"
label="Reflectivity Task Launch Command"
style="push"
tooltip="Launch Reflectivity Tasks">
</command>
</toolbar>
</menuContribution>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
defaultHandler="org.eclipse.ice.reflectivity.ui.TaskLaunchHandler"
description="Reflectivity Task Launch Handler"
id="org.eclipse.ice.reflectivity.ui.TaskLaunchHandler"
name="Reflectivity Task Launch Handler">
</command>
</extension>
</plugin>
/*******************************************************************************
* Copyright (c) 2015 UT-Battelle, LLC.
* 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:
* Initial API and implementation and/or initial documentation -
* Jay Jay Billings
*******************************************************************************/
package org.eclipse.ice.reflectivity.ui;
import java.io.IOException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.osgi.framework.FrameworkUtil;
/**
* This is a custom JFace dialog that shows the Task Launcher for the
* Reflectivity tools.
*
* @author Jay Jay Billings
*
*/
public class TaskLaunchDialog extends Dialog {
/**
* The constructor
*
* @param parentShell
* The shell in which this dialog is drawn and which is also the
* shell of the parent application.
*/
public TaskLaunchDialog(Shell parentShell) {
super(parentShell);
}
/**
* This operation overrides Dialog.createButton so that no buttons are
* created.
*/
@Override
public Button createButton(Composite parent, int id, String label,
boolean defaultButton) {
return null;
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets
* .Composite)
*/
@Override
protected Control createDialogArea(Composite parent) {
// Local Declarations
Composite swtComposite = (Composite) super.createDialogArea(parent);
// Set the layout to one so that everything will stack
((GridLayout) swtComposite.getLayout()).numColumns = 2;
// Set the title of the dialog
getShell().setText("Reflectivity Quick Launch Utility");
// Create simulation launch button
Button modelRefButton = new Button(swtComposite, SWT.PUSH);
modelRefButton.setToolTipText("Create New Reflectivity Simulation");
GridData modelRefData = new GridData(GridData.CENTER, GridData.CENTER,
true, false);
modelRefButton.setLayoutData(modelRefData);
// Load the image if it is available
String imageString = null;
try {
// The URL for the file must be properly resolved by the file
// locator class because FrameworUtil only returns the path relative
// to the bundle running in the OSGi instance.
imageString = FileLocator.resolve(FrameworkUtil
.getBundle(getClass()).getEntry("icons/sns.png")).getPath();
// Create the image
Image image = new Image(swtComposite.getDisplay(), imageString);
// Set the button
modelRefButton.setImage(image);
} catch (IOException e) {
// Just set the text instead
modelRefButton.setText("Launch New Simulation");
}
// Create edit materials button
Button editMatsButton = new Button(swtComposite, SWT.PUSH);
editMatsButton.setToolTipText("Create or Edit Materials");
GridData editMatsData = new GridData(GridData.CENTER, GridData.CENTER,
true, false);
editMatsButton.setLayoutData(editMatsData);
// Load the image if it is available
imageString = null;
try {
// Exact same process as above
imageString = FileLocator.resolve(FrameworkUtil
.getBundle(getClass()).getEntry("icons/sns.png")).getPath();
Image image = new Image(swtComposite.getDisplay(), imageString);
editMatsButton.setImage(image);
} catch (IOException e) {
// Just set the text instead
editMatsButton.setText("Edit Materials");
}
return swtComposite;
}
}
/*******************************************************************************
* Copyright (c) 2015 UT-Battelle, LLC.
* 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:
* Initial API and implementation and/or initial documentation -
* Jay Jay Billings
*******************************************************************************/
package org.eclipse.ice.reflectivity.ui;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ice.iclient.IClient;
import org.eclipse.ui.handlers.HandlerUtil;
/**
* This class handles launch requests for the Reflectivity Task Launcher, which
* is just a little composite that draw stuff to the screen to make it easier to
* use the reflectivity tools.
*
* @author Jay Jay Billings
*
*/
public class TaskLaunchHandler extends AbstractHandler {
/**
* The ICE Client, which is used to perform the specified task.
*/
IClient client;
/**
* Constructor
*/
public TaskLaunchHandler() throws CoreException {
client = IClient.getClient();
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
* ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
TaskLaunchDialog dialog = new TaskLaunchDialog(
HandlerUtil.getActiveShell(event));
dialog.open();
return null;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment