def hardwareModelIsMissingMessageBox(programs): for program in programs : if not program.getRepresenting(): msg = MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_WARNING|SWT.OK) msg.setText("Update or generate code") msg.setMessage("Warn : generate hardware model please.") msg.open() return False return True
def run(self): m = MessageBox(Display.getDefault().getActiveShell(), SWT.ICON_WARNING|SWT.OK) m.setText(text) m.setMessage(message) m.open()
try: input_path = input_path_parameter except NameError: input_path = '/media/sf_Dropbox/Projects/JUNIPER/WP5/libdag/xml/taskset.xml' import subprocess try: output = subprocess.check_output([dag_path, input_path]) except CalledProcessError as e: output = e.output from org.eclipse.swt.widgets import MessageBox from org.eclipse.swt.widgets import Display from org.eclipse.swt import SWT m = MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_ERROR|SWT.OK) m.setText("JuniperIDE") m.setMessage("Error running Schedulability analyser!") m.open() from tempfile import NamedTemporaryFile output_file = NamedTemporaryFile(delete=False) output_file.write(output) output_file.close() from org.modelio.api.modelio import Modelio from org.modelio.api.editor import EditorType from java.io import File Modelio.getInstance().getEditionService().openEditor(selectedElements.get(0), File(output_file.name), EditorType.TXTEditor, True) import os
def messageBox(s): parent = Display.getDefault().getActiveShell() child = Shell(parent, SWT.OK) mb = MessageBox (child, SWT.OK | SWT.ERROR) mb.setMessage(s) mb.open()