Commit f091be45 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

Implemented build stamp generator, committed missed new files

parent f88dd96e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -142,9 +142,10 @@ public class VDT {
    public static final String GENERATOR_ID_FILE_LIST     = "FileList"; 
    public static final String GENERATOR_ID_TOP_MODULE    = "TopModule"; 
    public static final String GENERATOR_ID_TOP_MODULES   = "TopModules"; 
    public static final String GENERATOR_ID_CURRENT_FILE  = "CurrentFile"; 
    public static final String GENERATOR_ID_OS_NAME       = "OS";
    public static final String GENERATOR_ID_SELECTED_FILE = "SelectedFile"; 
    public static final String GENERATOR_ID_CURRENT_FILE  = "CurrentFile"; 
    public static final String GENERATOR_ID_CURRENT_BASE  = "CurrentFileBase"; 
    public static final String GENERATOR_ID_CHOSEN_ACTION = "ChosenActionIndex"; 
    public static final String GENERATOR_ID_OS_NAME       = "OS";
    public static final String GENERATOR_ID_BUILD_STAMP   = "BuildStamp"; 
} // class VDT
+34 −0
Original line number Diff line number Diff line
/*******************************************************************************
 * Copyright (c) 2006 Elphel, Inc and Excelsior, LLC.
 * This file is a part of Eclipse/VDT plug-in.
 * Eclipse/VDT plug-in is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * Eclipse/VDT plug-in is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with Eclipse VDT plug-in; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *******************************************************************************/
package com.elphel.vdt.core.tools.generators;

import com.elphel.vdt.VDT;
import com.elphel.vdt.ui.variables.SelectedResourceManager;

public class BuildStampGenerator extends AbstractGenerator {
    public static final String NAME = VDT.GENERATOR_ID_BUILD_STAMP;
    public String getName() {
        return NAME;
    }
    
    protected String[] getStringValues() {
    	return new String[] {SelectedResourceManager.getDefault().getBuildStamp()};
    }
}

+36 −0
Original line number Diff line number Diff line
/*******************************************************************************
 * Copyright (c) 2006 Elphel, Inc and Excelsior, LLC.
 * This file is a part of Eclipse/VDT plug-in.
 * Eclipse/VDT plug-in is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * Eclipse/VDT plug-in is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with Eclipse VDT plug-in; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *******************************************************************************/
package com.elphel.vdt.core.tools.generators;

import com.elphel.vdt.VDT;
import com.elphel.vdt.ui.variables.SelectedResourceManager;

public class ChosenActionGenerator extends AbstractGenerator {
    public static final String NAME = VDT.GENERATOR_ID_CHOSEN_ACTION;
    public String getName() {
        return NAME;
    }
    
    protected String[] getStringValues() {
        int choice=SelectedResourceManager.getDefault().getChosenAction();
        return new String[] { ""+choice };
    }
} //ChosenActionGenerator


+55 −0
Original line number Diff line number Diff line
/*******************************************************************************
 * Copyright (c) 2006 Elphel, Inc and Excelsior, LLC.
 * This file is a part of Eclipse/VDT plug-in.
 * Eclipse/VDT plug-in is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your option)
 * any later version.
 *
 * Eclipse/VDT plug-in is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with Eclipse VDT plug-in; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *******************************************************************************/
package com.elphel.vdt.core.tools.generators;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.ui.IPageLayout;

import com.elphel.vdt.VDT;
import com.elphel.vdt.ui.variables.SelectedResourceManager;

public class SelectedFileGenerator extends AbstractGenerator {
    private static final String NAME = VDT.GENERATOR_ID_SELECTED_FILE;
//    private boolean menuMode=false; // managing menu items, not running tool

    public String getName() {
        return NAME;
    }
 /*   
    public CurrentFileGenerator(boolean menuMode){
    	super();
    	this.menuMode=menuMode;
    }
*/
    /*
    public void setMenuMode(boolean menuMode){
    	this.menuMode=menuMode;
    }
    */
    protected String[] getStringValues() {
    	IResource resource;
    	if (getMenuMode()) resource = SelectedResourceManager.getDefault().getViewSelectedResource(IPageLayout.ID_RES_NAV);
    	else          resource = SelectedResourceManager.getDefault().getSelectedResource();
        
        if((resource != null) && (resource.getType() == IResource.FILE))
            return new String[] { ((IFile)resource).getLocation().toOSString() };
       
        return new String[] { "" };
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -33,7 +33,8 @@ public class SimpleGeneratorRecognizer implements Recognizer {
        new SelectedFileGenerator(),
        new CurrentFileGenerator(),
        new CurrentFileBaseGenerator(),
        new ChosenActionGenerator()
        new ChosenActionGenerator(),
        new BuildStampGenerator()
    };
  
    public SimpleGeneratorRecognizer(){
Loading