本文整理匯總了Java中org.eclipse.jface.dialogs.MessageDialog.openInformation方法的典型用法代碼示例。如果您正苦於以下問題:Java MessageDialog.openInformation方法的具體用法?Java MessageDialog.openInformation怎麽用?Java MessageDialog.openInformation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.dialogs.MessageDialog
的用法示例。
在下文中一共展示了MessageDialog.openInformation方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: exportOperation
import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
/**
* Exports UI-operation data to external file
*
* @param file
* @param mappingSheetRow
* @param showErrorMessage
* @param list
* @throws ExternalTransformException
*/
public void exportOperation(File file, MappingSheetRow mappingSheetRow ,boolean showErrorMessage,List<GridRow> list) throws ExternalTransformException {
if (file!=null) {
try{
Object object=convertUIOperationToJaxb(mappingSheetRow, list);
marshal(ExternalOperations.class, file, object);
} catch (Exception exception) {
LOGGER.warn("Error ", exception);
if(showErrorMessage){
MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "Failed to export output fields - \n"+exception.getMessage());
}
return;
}
MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Information", "Operation exported sucessfully");
}
}
示例2: importExpression
import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
public ExpressionData importExpression(File file, ExpressionData expressionData,boolean showErrorMessage,
String componentName) {
if (file!=null) {
try (FileInputStream fileInputStream=new FileInputStream(file)){
ExternalExpressions externalExpression = (ExternalExpressions) ExternalOperationExpressionUtil.INSTANCE.unmarshal(fileInputStream,ExternalExpressions.class);
expressionData = convertToUIExpression(externalExpression.getExternalExpressions(),expressionData, componentName);
if(showErrorMessage && expressionData!=null){
MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Information", "Expression imported sucessfully");
}
} catch (Exception exception) {
LOGGER.warn("Error ", exception);
if(showErrorMessage){
MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "Failed to import expression - Invalid XML");
}
}
}
return expressionData;
}
示例3: exportOutputFields
import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
/**
* Exports UI-mapping data to external file
*
* @param file
* @param transformMapping
* @param showErrorMessage
* @param componentName
* @throws ExternalTransformException
*/
public void exportOutputFields(File file, TransformMapping transformMapping ,boolean showErrorMessage,String componentName) throws ExternalTransformException {
if (file!=null) {
try{
Object object=convertUiOutputFieldsToJaxb(transformMapping,componentName);
marshal(ExternalMappings.class, file, object);
} catch (Exception exception) {
LOGGER.warn("Error ", exception);
if(showErrorMessage){
MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "Failed to export output fields - \n"+exception.getMessage());
}
return;
}
MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Information", "Fields exported sucessfully");
}
}
示例4: importOperation
import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
public OperationClassData importOperation(File file, OperationClassData operationClassData ,boolean showErrorMessage,
String componentName) throws ExternalTransformException {
if (file!=null) {
try (FileInputStream fileInputStream=new FileInputStream(file)){
ExternalOperations externalOperation=(ExternalOperations) ExternalOperationExpressionUtil.INSTANCE.unmarshal(fileInputStream,ExternalOperations.class);
operationClassData=convertToUIOperation(operationClassData, externalOperation.getExternalOperations(), componentName);
if(operationClassData!=null && showErrorMessage){
MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Information", "Operation imported sucessfully");
}
} catch (Exception exception) {
LOGGER.warn("Error ", exception);
if(showErrorMessage){
MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "Failed to import operation - Invalid XML");
}
}
}
return operationClassData;
}
示例5: openSelection
import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
/**
* Pushes any previous run back into the UI
*/
protected void openSelection() {
final StatusBean [] beans = getSelection();
if (beans.length == 0) {
MessageDialog.openInformation(getViewSite().getShell(), "Please select a run", "Please select a run to open.");
return;
}
// TODO FIXME Change to IScanBuilderService not selections so that it works with e4.
// We fire a special object into the selection mechanism with the data for this run.
// It is then up to parts to respond to this selection and update their contents.
// We call fireSelection as the openRequest isn't in the table. This sets the workb
for (StatusBean bean : beans) {
selectionProvider.fireSelection(new StructuredSelection(new OpenRequest(bean)));
}
}
示例6: importExpression
import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
/**
* Imports UI-expression data from external file
*
* @param file
* @param mappingSheetRow
* @param showErrorMessage
* @param transformMapping
* @param componentName
* @return
*/
public MappingSheetRow importExpression(File file, MappingSheetRow mappingSheetRow, boolean showErrorMessage,
TransformMapping transformMapping, String componentName) {
if (file!=null) {
try (FileInputStream fileInputStream=new FileInputStream(file)){
ExternalExpressions externalExpression = (ExternalExpressions) unmarshal(fileInputStream,ExternalExpressions.class);
mappingSheetRow = convertToUIExpression(mappingSheetRow, externalExpression.getExternalExpressions(),transformMapping, componentName);
if(showErrorMessage && mappingSheetRow!=null){
MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Information", "Expression imported sucessfully");
}
} catch (Exception exception) {
LOGGER.warn("Error ", exception);
if(showErrorMessage){
MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error", "Failed to import expression - Invalid XML");
}
}
}
return mappingSheetRow;
}
示例7: updateEntity
import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
/**
* Update an OCCI entity.
* @param entity the entity to update.
*/
public void updateEntity(Entity entity)
{
Client jocciClient = getJocciClient(entity);
if(jocciClient == null) {
return;
}
// Create the jOCCI entity.
cz.cesnet.cloud.occi.core.Entity jocciEntity = newJocciEntity(entity);
if(jocciEntity == null) {
return;
}
try {
jocciEntity.setId(entity.getId());
} catch (InvalidAttributeValueException iave) {
reportException(iave);
return;
}
try {
// Update the OCCI resource.
boolean updated = jocciClient.update(jocciEntity);
if(updated) {
MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Update OCCI Entity", "Entity " + getLocation(entity) + " updated");
} else {
MessageDialog.openWarning(Display.getCurrent().getActiveShell(), "Update OCCI Entity", "Entity " + getLocation(entity) + " not updated");
}
} catch (CommunicationException ce) {
reportException(ce);
return;
}
}
示例8: createJimpleBreakpoint
import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
private void createJimpleBreakpoint() throws CoreException, BadLocationException {
IDocument document = getDocument();
IFile file = getFile();
int lineNumber = getLineNumber();
int offset = document.getLineOffset(lineNumber - 1);
int length = document.getLineInformation(lineNumber - 1).getLength();
int charStart = offset;
int charEnd = offset + length;
try {
String unitFqn = getUnitFqn(lineNumber - 1, offset, length);
IMarker m = file.createMarker(JIMPLE_BREAKPOINT_MARKER);
m.setAttribute(IMarker.LINE_NUMBER, getLineNumber());
m.setAttribute(IMarker.MESSAGE, "Unit breakpoint: " + file.getName() + " [Line "+getLineNumber()+"]");
m.setAttribute("Jimple.file", file.getProjectRelativePath().toPortableString());
m.setAttribute("Jimple.project", file.getProject().getName());
m.setAttribute("Jimple.unit.charStart", charStart);
m.setAttribute("Jimple.unit.charEnd", charEnd);
m.setAttribute("Jimple.unit.fqn", unitFqn);
JimpleBreakpointManager.getInstance().createBreakpoint(m);
} catch(UnitNotFoundException e) {
String msg = "The selected unit couldn't be found in our Jimple model. This might be a problem related to Jimple optimizations.";
MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Breakpoint could not be placed", msg);
}
}
示例9: open
import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
public void open(){
if(messageType==SWT.ERROR){
MessageDialog.setDefaultOrientation(SWT.NONE);
MessageDialog.openError(Display.getCurrent().getActiveShell(), title, message);
}
if(messageType==SWT.ICON_INFORMATION){
MessageDialog.openInformation(Display.getCurrent().getActiveShell(), title, message);
}
if(messageType==SWT.ICON_WARNING){
MessageDialog.openWarning(Display.getCurrent().getActiveShell(), title, message);
}
}
示例10: okPressed
import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
@Override
protected void okPressed() {
configProperty.setLookupKey(lookupKey);
configProperty.setDriverKey(driverKey);
if(!oldConfigProperty.equals(configProperty)){
propertyDialogButtonBar.enableApplyButton(true);
MessageDialog.openInformation(Display.getCurrent().getActiveShell(), Messages.INFORMATION, Messages.LOOKUP_PORT_CHANGE);
}
super.okPressed();
}
示例11: createActions
import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
private void createActions() {
sampleAction = new Action() {
public void run() {
MessageDialog.openInformation(null, "osets-eclipse-plugin", "Sample Action Executed");
}
};
sampleAction.setText("Sample Action");
sampleAction.setToolTipText("Sample Action tool tip");
sampleAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(IDE.SharedImages.IMG_OBJS_TASK_TSK));
}
示例12: openInformationMessageDialog
import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
protected final void openInformationMessageDialog(String title, String message) {
MessageDialog.openInformation(getActiveShell(), title, message);
}
示例13: print
import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
public void print ()
{
if ( Printer.getPrinterList ().length == 0 )
{
MessageDialog.openInformation ( this.shell, "No printer", "No installed printer could be found" );
return;
}
final PrintDialog dlg = new PrintDialog ( this.shell, SWT.APPLICATION_MODAL );
final PrinterData initialPd = Printer.getDefaultPrinterData ();
initialPd.orientation = PrinterData.LANDSCAPE;
dlg.setPrinterData ( initialPd );
final PrinterData pd = dlg.open ();
if ( pd != null )
{
final Printer printer = new Printer ( pd );
final ResourceManager rm = new DeviceResourceManager ( printer );
try
{
printer.startJob ( "Chart" );
printer.startPage ();
final GC gc = new GC ( printer );
try
{
final SWTGraphics g = new SWTGraphics ( gc, rm );
try
{
this.viewer.getChartRenderer ().paint ( g );
}
finally
{
g.dispose ();
}
}
finally
{
gc.dispose ();
}
printer.endPage ();
printer.endJob ();
}
finally
{
rm.dispose ();
printer.dispose ();
}
}
}
示例14: makeWarnDialog
import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
protected void makeWarnDialog ()
{
final Shell shell = PlatformUI.getWorkbench ().getActiveWorkbenchWindow ().getShell ();
MessageDialog.openInformation ( shell, Messages.WriteableComposite_wrongInput, String.format ( Messages.WriteableComposite_requiredInput, this.ceil, this.floor ) );
}
示例15: MessageDialogSuccessful
import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
public void MessageDialogSuccessful(IWorkbenchWindow window) {
MessageDialog.openInformation(window.getShell(), "ModelWriter Project Management",
"The URD document has been created successfully");
}