eclipse plugin: add basics for eclipse product

This commit is contained in:
Timotei Dolean 2010-07-22 17:35:44 +00:00
parent dc034343e6
commit ef0c8d6ec2
9 changed files with 195 additions and 11 deletions

View file

@ -1,11 +1,11 @@
source.. = src/
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
.,\
*.xml,\
icons/,\
templates/,\
templatesIndex.txt
src.includes = templatesIndex.txt,\
templates/
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
.,\
*.xml,\
icons/,\
templates/,\
templatesIndex.txt
src.includes = templatesIndex.txt,\
templates/
source.. = src/

View file

@ -240,6 +240,7 @@
</extension>
<extension
point="org.eclipse.ui.perspectiveExtensions">
<!--
<perspectiveExtension
targetID="org.eclipse.jdt.ui.JavaPerspective">
@ -493,5 +494,43 @@
name="name">
</editor>
</extension>
<extension
id="Wesnoth_Eclipse_Plugin.application"
point="org.eclipse.core.runtime.applications">
<application
icon="icons/wesnoth-icon_16.png"
thread="main"
visible="true">
<run
class="wesnoth_eclipse_plugin.product.Application">
</run>
</application>
</extension>
<extension
id="product"
point="org.eclipse.core.runtime.products">
<product
application="Wesnoth_Eclipse_Plugin.application"
name="Wesnoth User Made Content IDE">
<property
name="appName"
value="Wesnoth User Made Content IDE">
</property>
<property
name="preferenceCustomization"
value="plugin_customization.ini">
</property>
</product>
</extension>
<extension
id="Wesnoth_Eclipse_Plugin.perspectives"
point="org.eclipse.ui.perspectives">
<perspective
class="wesnoth_eclipse_plugin.product.WMLPerspective"
icon="icons/wesnoth_editor-icon_16.png"
id="Wesnoth_Eclipse_Plugin.product.perspective"
name="Default Perspective">
</perspective>
</extension>
</plugin>

View file

@ -0,0 +1,13 @@
org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=true
org.eclipse.ui/initialFastViewBarLocation=bottom
#org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
org.eclipse.ui/HELP_CONTENTS_ACTION_TEXT
# new-style tabs by default
org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
# put the perspective switcher on the top right
org.eclipse.ui/DOCK_PERSPECTIVE_BAR=topRight
# show progress on startup
org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = true

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 KiB

View file

@ -0,0 +1,40 @@
package wesnoth_eclipse_plugin.product;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
public class Application implements IApplication
{
@Override
public Object start(IApplicationContext context) throws Exception
{
Display display = PlatformUI.createDisplay();
try {
int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
if (returnCode == PlatformUI.RETURN_RESTART)
return IApplication.EXIT_RESTART;
else
return IApplication.EXIT_OK;
} finally {
display.dispose();
}
}
@Override
public void stop()
{
if (!PlatformUI.isWorkbenchRunning())
return;
final IWorkbench workbench = PlatformUI.getWorkbench();
final Display display = workbench.getDisplay();
display.syncExec(new Runnable() {
public void run() {
if (!display.isDisposed())
workbench.close();
}
});
}
}

View file

@ -0,0 +1,21 @@
package wesnoth_eclipse_plugin.product;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
super(configurer);
}
@Override
protected void makeActions(IWorkbenchWindow window) {
}
@Override
protected void fillMenuBar(IMenuManager menuBar) {
}
}

View file

@ -0,0 +1,28 @@
package wesnoth_eclipse_plugin.product;
import org.eclipse.ui.application.IWorkbenchConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
private static final String PERSPECTIVE_ID = "Wesnoth_Eclipse_Plugin.product.perspective"; //$NON-NLS-1$
@Override
public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
return new ApplicationWorkbenchWindowAdvisor(configurer);
}
@Override
public String getInitialWindowPerspectiveId() {
return PERSPECTIVE_ID;
}
@Override
public void initialize(IWorkbenchConfigurer configurer)
{
super.initialize(configurer);
configurer.setSaveAndRestore(true);
}
}

View file

@ -0,0 +1,31 @@
package wesnoth_eclipse_plugin.product;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
super(configurer);
}
@Override
public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
return new ApplicationActionBarAdvisor(configurer);
}
@Override
public void preWindowOpen() {
IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
configurer.setShowMenuBar(true);
configurer.setShowProgressIndicator(true);
configurer.setShowStatusLine(true);
configurer.setShowPerspectiveBar(true);
configurer.setShowFastViewBars(true);
// configurer.setInitialSize(new Point(400, 300));
// configurer.setShowCoolBar(false);
// configurer.setShowStatusLine(false);
}
}

View file

@ -0,0 +1,12 @@
package wesnoth_eclipse_plugin.product;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
public class WMLPerspective implements IPerspectiveFactory
{
@Override
public void createInitialLayout(IPageLayout layout)
{
}
}