Eclipse Plug-in Development

Slides:



Advertisements
Similar presentations
In this example I will all of the IT majors. I start by clicking the Contact Info for Majors by GPA and Hours button of the shared reports form.
Advertisements

© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 7: Chapter 4: Slide 1 Unit 7 Decisions (Cont.) and Message Boxes Chapter.
Contensis Training How do I Create a new Web Page.
Tutorial 10 Programming with JavaScript
1 org.eclipse.ui.texteditor-api l Provides a framework for text editors obeying to the desktop rules. org.eclipse.ui.texteditor.
A.How to create string controls and indicators B.Some string functions C.How to perform file input and output operations D.How to format text files for.
Microsoft PowerPoint 97 Quick Start Tutorial Click here to start.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
More on Regular Expressions Regular Expressions More character classes \s matches any whitespace character (space, tab, newline etc) \w matches.
WORKING WITH MACROS CHAPTER 10 WORKING WITH MACROS.
JFace 吳昆澤. UI framework for plug-ins JFace provides classes for handling common UI programming tasks: Viewers handle the drudgery of populating, sorting,
Met Alert Tool (MAT). Introduction What is MAT? –Met Alert Tool (MAT) monitors and alerts the user to weather conditions exceeding thresholds (for example,
Tutorial 10 Programming with JavaScript. XP Objectives Learn the history of JavaScript Create a script element Understand basic JavaScript syntax Write.
Present by Wu Kun-Tse Simplifying Preference Pages with Field Editors.
Input & Output Functions JavaScript is special from other languages because it can accept input and produce output on the basis of that input in the same.
Go Animate Tutorial. Home Sign Up Click Sign Up.
Common Dialogs.  What is a Common Dialog/Why use them?  Open Dialog  Save File As Dialog  Color Dialog  Font Dialog  Print Dialog.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Graphical User Interface Components Version 1.1. Obectives Students should understand how to use these basic Form components to create a Graphical User.
Creating and Using Dialogs ● A dialog is a box that pops up and prompts the user for a value or informs them of something ● One way: directly create objects.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Millennium Circulation & Reserves Enhancements Phase II, Release 2002.
JavaScript and AJAX 2nd Edition Tutorial 1 Programming with JavaScript.
Module 3: Creating Windows-based Applications. Overview Creating the Main Menu Creating and Using Common Dialog Boxes Creating and Using Custom Dialog.
CIS 338: Dialog Boxes Dr. Ralph D. Westfall April, 2011.
Excel Tutorial 8 Developing an Excel Application
Eclipse.
Data Validation and Protecting Workbook
Eclipse Plug-in Development
Synchronizing Text & Objects
[First Name] [Last Name] [Date]
[First Name] [Last Name] [Date]
To view your master work in a browser you do this:
Module 6: Creating Web Pages and Working with Channels
Eclipse Plug-in Development
Presentation title goes here
Predefined Dialog Boxes
Presentation title goes here
Eclipse Plug-in Development
Eclipse Plug-in Development
A1 Student Posters Posters Print Services  Robinson Library  University of Newcastle  phone: Introduction The.
<ELLIIT Project Name>
Copyright © 2006 Thomas P. Skinner
Presentation title.
Presentation title.
Eclipse Plug-in Development
Access Tutorial 1 Creating a Database
Poster Title Heading Heading Heading Heading Heading Heading
2016 REPORTING The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
2016 REPORT.
Message, Input, and Confirm Dialogs
Eclipse Plug-in Development
A0 PowerPoint Poster Posters at Print Services Robinson Library, Newcastle University • • phone Introduction.
Lesson 2 Attaching a Document.
Module 8: Creating Windows-based Applications
2016 REPORT.
Please send any images as a separate file
Eclipse Plug-in Development
A1 Student Posters Posters at Print Services  Robinson Library  University of Newcastle  phone: Introduction.
T A R S E L I T L I S S T O TEMPLATE – SUBTITLE
[First Name] [Last Name] [Date]
201X REPORT.
目 录 The quick brown fox. 目 录 The quick brown fox.
[First Name] [Last Name] [Date]
[First Name] [Last Name] [Date]
Lab 03 – Linked List.
2016 REPORT.
Personal Annual Summary CLICK TO ADD UP TITLE HERE
Presentation transcript:

Eclipse Plug-in Development SWT/JFace Development Part 5 Dialogs, Wizards and Actions 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) Contents Dialogs in SWT/JFace SWT Dialogs JFace Dialogs Wizards Wizard Page Action Actions Contribution Item Menu Manager ToolBar contribution item 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) SWT Dialogs ColorDialog ColorDialog dialog = new ColorDialog(shell); dialog.setRGB(new RGB(0, 125, 0)); RGB result = dialog.open(); 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) SWT Dialogs DirectoryDialog DirectoryDialog dialog = new DirectoryDialog(shell); dialog.setText("Foxes vs. Dogs"); dialog.setMessage("A qiuick brown fox jumps over the laze dog."); dialog.setFilterPath("C:"); String open = dialog.open(); 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) SWT Dialogs FileDialog Open FileDialog openDialog = new FileDialog(shell, SWT.OPEN | SWT.MULTI); openDialog.setText("Open File Dialog"); openDialog.setFilterExtensions(new String[] { "*.jpg;*.png;*.gif", "*.*" }); openDialog.setFilterPath("C:"); String open = openDialog.open(); 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) SWT Dialogs FileDialog Save FileDialog saveDialog = new FileDialog(shell, SWT.SAVE); saveDialog.setText("Save File Dialog"); saveDialog.setFilterExtensions(new String[] { "*.txt" }); saveDialog.setFileName("new_file"); saveDialog.setFilterPath("C:"); saveDialog.setOverwrite(true); saveDialog.open(); 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) SWT Dialogs FontDialog FontDialog dialog = new FontDialog(shell); dialog.setEffectsVisible(true); FontData open = dialog.open(); 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) SWT Dialogs PrintDialog PrintDialog dialog = new PrintDialog(shell); dialog.setStartPage(1); dialog.setEndPage(3); dialog.setPrintToFile(true); dialog.open(); 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) SWT Dialogs MessageBox ICON_ERROR, ICON_INFORMATION, ICON_QUESTION, ICON_WARNING, ICON_WORKING OK, OK | CANCEL YES | NO, YES | NO | CANCEL RETRY | CANCEL ABORT | RETRY | IGNORE MessageBox box = new MessageBox(shell, SWT.RETRY | SWT.IGNORE | SWT.ABORT | SWT.ICON_QUESTION); box.setText("Foxes vs. Dogs"); box.setMessage("A quick brown fox jumps over the lazy dog?"); int result = box.open(); 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) JFace Dialogs 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) JFace Dialogs InputDialog InputDialog inputDialog = new InputDialog(shell, "Input Dialog Tutorial", "Input value", "Hello World", null); inputDialog.open(); 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) JFace Dialogs Message Dialog MessageDialog.openConfirm(shell, "Confirm", "Please confirm"); MessageDialog.openError(shell, "Error", "Error occured"); MessageDialog.openInformation(shell, "Info", "Info for you"); MessageDialog.openQuestion(shell, "Question", "Really, really?"); MessageDialog.openWarning(shell, "Warning", "I am warning you!"); MessageDialog dialog = new MessageDialog(shell, "My Title", null, "My message", MessageDialog.ERROR, new String[] { "First", "Second", "Third" }, 0); int result = dialog.open(); System.out.println(result); 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) JFace Dialogs ErrorDialog ErrorDialog.openError(shell, “title”, “message”, IStatus ); ErrorDialog.openError(shell, “title”, “message”, IStatus, displayMask); 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) JFace Dialogs Extending Dialog public class Dialog1 extends Dialog {…} protected Control createDialogArea(Composite parent) { return super.createDialogArea(parent); } protected void configureShell(Shell newShell) { super.configureShell(newShell); } protected Point getInitialSize() { return super.getInitialSize(); } 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) JFace Dialogs TitleAreaDialog TitleAreaDialog dialog = new TitleAreaDialog(shell) { protected void configureShell(Shell newShell) { super.configureShell(newShell); newShell.setText("TitleAreaDialog Tutorial"); } protected Control createDialogArea(Composite parent) { Composite dialogArea = (Composite) super .createDialogArea(parent); // add your contents here setTitle("Add yout TITLE here"); setMessage("Add your MESSAGE here"); return dialogArea; }; dialog.open(); 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) JFace Dialogs WizardDialog dialog = new WizardDialog(shell, new MyWizard()); dialog.open(); WizardDialog Wizard Wizard Page public class MyWizard extends Wizard { public MyWizard() { setWindowTitle("Wizard Dialog Tutorial"); } public void addPages() { addPage(new WizardPage1()); public boolean performFinish() { return false; public class WizardPage1 extends WizardPage { protected WizardPage1() { super("WizardPage1"); } public void createControl(Composite parent) { Label control = new Label(parent, SWT.NONE); control.setText("Page1"); setControl(control); setTitle("Page1 Title"); setMessage("Page1 Message"); 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) JFace Dialogs WizardDialog Wizard Wizard Page 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) JFace Actions Contribution Manager 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) JFace Actions Contribution Item 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) JFace Actions IAction Styles: AS_UNSPECIFIED AS_PUSH_BUTTON AS_CHECK_BOX AS_DROP_DOWN_MENU AS_RADIO_BUTTON text imageDescriptor toolTipText run() 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) JFace Actions Example MenuManager manager = new MenuManager(); manager.add(new Action("Push", IAction.AS_PUSH_BUTTON) { }); manager.add(new Separator()); manager.add(new Action("CheckBox1", IAction.AS_CHECK_BOX) { manager.add(new Action("CheckBox2", IAction.AS_CHECK_BOX) { Menu menu = manager.createContextMenu(shell); shell.setMenu(menu); 12/9/2018 Soyatec (http://www.soyatec.com)

Skype: jin.liu.soyatec Email: jin.liu@soyatec.com Any Questions? Skype: jin.liu.soyatec Email: jin.liu@soyatec.com 12/9/2018 Soyatec (http://www.soyatec.com)

Soyatec (http://www.soyatec.com) The end 12/9/2018 Soyatec (http://www.soyatec.com)