Tab5Utils.java
| Index Score | ||
|---|---|---|
![]() |
![]() |
omschaub.azcvsupdater.main |
![]() |
![]() |
AZCVSUpdater |
View: Reasons, Metrics, Source Code
These are the metrics that contribute to the Enerjy Score for this file, ranked by impact. So the metrics listed at the top influence the score to a greater extent that the metrics listed at the bottom.
/*
* Created on Feb 6, 2005
* Created by omschaub
*
*/
package omschaub.azcvsupdater.main;
import omschaub.azcvsupdater.utilities.AZCVSUpdaterVersionUtils;
import omschaub.azcvsupdater.utilities.DownloaderGeneric;
import omschaub.azcvsupdater.utilities.PluginVerCompare;
import omschaub.azcvsupdater.utilities.TrayAlert;
import org.eclipse.swt.SWT;
/**
* Utilities for Tab5
*
*/
public class Tab5Utils {
/*public void pulldown_menu(PluginInterface pluginInterface){
//PullDown Date View Changelog -- inside cvsgroup
final ChangeLogParser change_log = new ChangeLogParser();
Tab5.changelogDates = change_log.getDates(pluginInterface);
GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING );
gridData.horizontalSpan = 2;
Tab5.comboDates = new Combo(Tab5.cvsgroup, SWT.DROP_DOWN | SWT.READ_ONLY);
Tab5.comboDates.setLayoutData( gridData );
Tab5.comboDates.removeAll();
Tab5.comboDates.add("Choose Changelog View");
Tab5.comboDates.add("View Complete Changlog");
int cvsCounter=1;
while (Tab5.changelogDates[cvsCounter] != null){
Tab5.comboDates.add(Tab5.changelogDates[cvsCounter]);
cvsCounter++;
}
Tab5.comboDates.select(0);
Tab5.comboDates.removeListener( SWT.Selection,Tab5.menu_listener);
Tab5.readFrom = Tab5.comboDates.getItem(Tab5.comboDates.getSelectionIndex() );
Tab5.menu_listener = new Listener() {
public void handleEvent(Event arg0) {
readFrom = comboDates.getItem(comboDates.getSelectionIndex() );
try{
readTo = comboDates.getItem(comboDates.getSelectionIndex() + 1 );
}
catch (IllegalArgumentException e){
readTo = "asdfasdfasdfasdf";
//System.out.println("CAUGHT!");
}
if (readFrom.equalsIgnoreCase( "View Complete Changlog")){
comboDates.select(2);
readFrom = comboDates.getItem(comboDates.getSelectionIndex());
readTo = "asdfghasdfaljkshjlk";
}
if (readFrom.equalsIgnoreCase("Choose Changelog View")){
return;
}
//System.out.println("readFrom: " + readFrom + "index: "+ comboDates.getSelectionIndex());
//System.out.println("readTo: " + readTo);
change_log.Parser( display,pluginInterface,readTo,readFrom,comboDates);
comboDates.select(0);
comboDates.setEnabled(false);
}
};
comboDates.select(0);
comboDates.addListener(SWT.Selection,menu_listener);
}*/
public static void updatePluginVer(){
if(View.getDisplay() == null && View.getDisplay().isDisposed())
return;
View.getDisplay().asyncExec(new Runnable (){
public void run () {
if(Tab5.sfVersion_version != null && !Tab5.sfVersion_version.isDisposed()){
Tab5.sfVersion_version.setText(AZCVSUpdaterVersionUtils.readAZCVSUPversion(View.getPluginInterface()));
//String get_plugin_text;
}
if(View.INSERTED_VERSION.equals("empty")){
if(!PluginVerCompare.compare(AZCVSUpdaterVersionUtils.readAZCVSUPversion(View.getPluginInterface()),View.getPluginInterface().getPluginVersion())){
if(Tab5.plugin_update_question != null && !Tab5.plugin_update_question.isDisposed()){
Tab5.plugin_update_question.setText("Update not necessary");
}
if(View.getDisplay() == null && View.getDisplay().isDisposed())
return;
if(Tab5.plugin_update_question != null && !Tab5.plugin_update_question.isDisposed()){
Tab5.plugin_update_question.setForeground(View.getDisplay().getSystemColor(SWT.COLOR_DARK_GREEN));
}
//get_plugin_text = " Download and Install Latest Version ";
}
else{
Tab5.plugin_update_question.setText("Upgrade Available");
//Check for Plugin Setting and open tray alert if positive
if(View.getPluginInterface().getPluginconfig().getPluginBooleanParameter("TrayAlertPlugin",false)){
TrayAlert.newAzcvsupdater(AZCVSUpdaterVersionUtils.readAZCVSUPversion(View.getPluginInterface()));
}
if(View.getDisplay() == null && View.getDisplay().isDisposed())
return;
Tab5.plugin_update_question.setForeground(View.getDisplay().getSystemColor(SWT.COLOR_RED));
//Tab5.get_plugin.setText(" Download and Install Latest Version ");
Thread autoThread = new Thread()
{
public void run()
{
if(View.AUTO_ONCE){
if(View.getPluginInterface().getPluginconfig().getPluginBooleanParameter("plugin_auto_restart",false) ||
View.getPluginInterface().getPluginconfig().getPluginBooleanParameter("plugin_auto_insert",false)){
/* try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}*/
//Tab5.get_plugin.setText("Downloading...");
Tab5.get_plugin.setEnabled(false);
View.PLUGIN_AUTO_GO = true;
//DownloaderGeneric.pluginDownloader(View.getPluginInterface());
DownloaderGeneric.plugin_Downloader();
View.INSERTED_VERSION = AZCVSUpdaterVersionUtils.readAZCVSUPversion(View.getPluginInterface());
}
/*if(View.getPluginInterface().getPluginconfig().getPluginBooleanParameter("plugin_auto_restart",false)){
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
Tab5.get_plugin.setText("Downloading...");
Tab5.get_plugin.setEnabled(false);
View.PLUGIN_AUTO_GO = true;
//DownloaderGeneric.pluginDownloader(View.getPluginInterface());
DownloaderGeneric.plugin_Downloader();
}*/
}
}
};
if(View.INSERTED_VERSION.equals("empty"))
autoThread.run();
else if(!View.INSERTED_VERSION.equals(AZCVSUpdaterVersionUtils.readAZCVSUPversion(View.getPluginInterface()))){
autoThread.run();
}
}//End of Else
}//End of If "empty"
}
});
}
public static void auto_insert_finish(){
if(View.getDisplay() == null && View.getDisplay().isDisposed())
return;
View.getDisplay().asyncExec(new Runnable (){
public void run () {
Tab5.progressBar2.setVisible(false);
Tab5.composite_endbuttons.setVisible(false);
Tab5.get_plugin.setEnabled(false);
//Tab5.get_plugin.setText("Already Downloaded and Inserted");
Tab5.plugin_update_question.setForeground(View.getDisplay().getSystemColor(SWT.COLOR_DARK_GREEN));
Tab5.plugin_update_question.setText("New Version Downloaded and Inserted");
Tab5.composite_endbuttons.setVisible(false);
Tab5.web_stuff.layout(true);
}
});
}
//EOF
}
The table below shows all metrics for Tab5Utils.java.




