Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
283 views
in Technique[技术] by (71.8m points)

lamp - PDT Eclipse to auto upload on save

I am migrating from a Dreamweaver forced working environment to a free-of-choice one. That said I must say I was rather enthusiastic about being able to use Dreamweaver PDT. However I have come to rely very heavily on the use of the "auto upload on save" function.

I am developing LAMP but oriented to a Windows base majority so I really must run Windows native and test heavy for IE, all projects work smooth on FF and Safari, IE's really the bottleneck. On the other hand I like to have my project served by a clone of the server so I have a Virtual machine on windows running Linux that works as my Dev Server.

As you can tell the auto-update on save works like a charm.

I've dug up some of the documentation and I've also Google quite a bit and found nothing (besides Aptana) to suit my needs. I am looking in the wrong direction or isn't there really something like this for Eclipse?

Thank you in advance!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

After some months of using different set ups I've come to use a combination that's perfect for my needs and though I should share.

Eclipse running Aptana as plug-in.

All the power of Eclipse and all the usability of Dreamweaver plus some nice Aptana goodies. That said, after installing Aptana as a plug-in just create a new file under the /scripts directory (or put that file into a project you'll never close) and the following code inside:

/* 
 * Menu: gMan > Upload On Save 
 * Kudos: Ingo Muschenetz 
 * License: EPL 1.0 
 * Listener: commandService().addExecutionListener(this); 
 * DOM: http://localhost/com.aptana.ide.syncing.doms
 * DOM: http://download.eclipse.org/technology/dash/update/org.eclipse.eclipsemonkey.lang.javascript 
 */  

function commandService() 
{ 
   var commandServiceClass = Packages.org.eclipse.ui.commands.ICommandService; 
   var commandService = Packages.org.eclipse.ui.PlatformUI.getWorkbench().getAdapter(commandServiceClass);
   return commandService; 
} 

function preExecute(commandId, event) {}

function postExecuteSuccess(commandId, returnValue) 
{ 
   if (commandId == "org.eclipse.ui.file.save") 
   { 
       sync.uploadCurrentEditor(); 
   } 
}

function notHandled(commandId, exception) {} 

function postExecuteFailure(commandId, exception) {}

So, if the project your working on has a syncronize connection active on each and every save you'll have the file uploaded to the server.

Hope it saves you some time!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...