blob: 772e9e0e982f02cc7dcbf179236105e324ea5e17 [file] [log] [blame]
/**
*
*/
package com.gemstone.gemfire.mgmt.DataBrowser.ui.actions;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Widget;
import com.gemstone.gemfire.mgmt.DataBrowser.ui.PreferencesDlg;
import com.gemstone.gemfire.mgmt.DataBrowser.ui.internal.PrefsMgr;
/**
* @author mghosh
*
*/
public class Preferences extends AbstractDataBrowserAction implements
IRunnableWithProgress {
private static final String iconEnabled = null;
private static final String iconDisabled = null;
private static PrefsMgr prefMgr_ = new PrefsMgr();
/**
*
*/
public Preferences() {
// TODO Auto-generated constructor stub
}
// **********************************************************
//
// IRunnableWithProgress
//
// **********************************************************
/*
* (non-Javadoc)
*
* @see
* org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.
* runtime.IProgressMonitor)
*/
public void run(IProgressMonitor monitor) throws InvocationTargetException,
InterruptedException {
}
// **********************************************************
//
// AbstractDataBrowserAction stuff
//
// **********************************************************
/* (non-Javadoc)
* @see com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.AbstractDataBrowserAction#getDisabledIcon()
*/
@Override
public String getDisabledIcon() {
return iconDisabled;
}
/* (non-Javadoc)
* @see com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.AbstractDataBrowserAction#getEnabledIcon()
*/
@Override
public String getEnabledIcon() {
return iconEnabled;
}
/*
* (non-Javadoc)
*
* @see
* com.gemstone.gemfire.mgmt.DataBrowser.ui.actions.AbstractDataBrowserAction
* #getText()
*/
@Override
public String getText() {
return "Preferences...";
}
// **********************************************************
//
// IAction stuff
//
// **********************************************************
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#getDescription()
*/
@Override
public String getDescription() {
return "Displays the Preferences window";
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#getToolTipText()
*/
@Override
public String getToolTipText() {
return "Show the Preferences window";
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#isEnabled()
*/
@Override
public boolean isEnabled() {
// TODO Auto-generated method stub
return super.isEnabled();
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
super.run();
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event)
*/
@Override
public void runWithEvent(Event event) {
Shell shl = null;
Display dsply = event.display;
if( null != dsply ) {
shl = dsply.getActiveShell();
}
if( null == shl ) {
Widget w = event.widget;
if( null != w ) {
shl = w.getDisplay().getActiveShell();
}
}
PreferencesDlg dlg = new PreferencesDlg(shl, Preferences.prefMgr_);
dlg.open();
}
}