PDT Eclipse to auto upload on save

前端 未结 7 535
情歌与酒
情歌与酒 2020-12-17 04:55

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.

7条回答
  •  死守一世寂寞
    2020-12-17 05:31

    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!

提交回复
热议问题