برنامه نویسی پیشرفته معرفی محیط برنامه نویسی eclipse 1.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Georgia Institute of Technology DrJava Appendix A Barb Ericson Georgia Institute of Technology May 2006.
معاونت درمان امور مامایی اردیبهشت 90. برای ثبت اطلاعات در برنامه نرم افزاری نظام مراقبت مرگ پریناتال ابتدا لازم است برنامه نرم افزار info-path وپرنیان.
Java Integrated Development Environments: ECLIPSE Part1 Installation.
Decision Tree.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Java Development Tools project.
فایل پردازی در C File based Programming in C. انواع فایل متنی –سرعت بالا –حجم کمتر –امکان دسترسی تصادفی –حفظ امنیت داده ها دودویی (باینری) –امکان باز.
Eclipse IDE. 2 IDE Overview An IDE is an Interactive Development Environment Different IDEs meet different needs BlueJ and DrJava are designed as teaching.
03 Using Eclipse. 2 IDE Overview An IDE is an Interactive Development Environment Different IDEs meet different needs BlueJ and DrJava are designed as.
Introduction to Eclipse. Overview Eclipse Background Obtaining and Installing Eclipse Creating a Workspaces / Projects Creating Classes Compiling and.
1 v1.6 08/02/2006 Overview of Eclipse Lectures 1.Overview 2.Installing and Running 3.Building and Running Java Classes 4.Refactoring 5.Debugging 6.Testing.
How to installHow to use You must have a pejvak Shortcut in your computers Desktop: You must have a pejvak Shortcut in your computers Desktop: double.
Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.
CPSC1301 Computer Science 1 Overview of Dr. Java.
Introduction to Eclipse CSC 216 Lecture 3 Ed Gehringer Using (with permission) slides developed by— Dwight Deugo Nesa Matic
9/2/ CS171 -Math & Computer Science Department at Emory University.
COMP519: Web Programming Autumn 2007 Perl Tutorial: The very beginning A basic Perl Program The first line Comments and statements Simple printing Running.
Database Laboratory: Session #4 Akram Shokri. DB-Lab 2 Lab Activity You must already created all tables You have to have inserted proper data in tables.
Development with Eclipse Software Engineering Prof. Werner Krandick.
تمام اسب ها همرنگ هستند! Basis: h = 1 We have only one horse. Clearly all horses in the set are the same color. Inductive hypothesis: In any set of up.
مظفر بگ محمدی دانشگاه ایلام Generics. کدهای عمومی 2 یکی از اهداف OOP ایجاد قابلیت نوشتن برنامه های عمومی با قابلیت استفاده ی مجدد است. کدهای چندریخت تا.
بسم الله الرحمن الرحیم. Visual Studio 2012 Performance Profiling Tools.
Eclipse 27-Apr-17.
Today Javadoc. Packages and static import. Viewing API source code. Upcoming Topics: –protected access modifier –Using the debugger in Eclipse –JUnit testing.
Java IDE Dwight Deugo Nesa Matic
تنظیم مودم Triz به حالت NAT
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Development with Eclipse
ATS Application Programming: Java Programming
Appendix A Barb Ericson Georgia Institute of Technology May 2006
نصب و پیکر بندی SQLServer 2008 R2
Eclipse 20-Sep-18.
تمرین هفتم بسم الله الرحمن الرحیم درس یادگیری ماشین محمدعلی کیوان راد
نکات بسیار مهم در مورد دانشگاه تبریز
ویژگی های DHCP جلوگیری از Conflict سرعت بخشیدن به کارها مدیریت متمرکز
آشنایی با میکروتیک عمادالدین بنگلی MTCNA.
بنام خدا زبان برنامه نویسی C (21814( Lecture 12 Selected Topics
SY800 router mode [AD-14-TB ].
آشنایی مقدماتی با نرم افزار Endnote X4
نکات بسیار مهم در مورد دانشگاه تبریز
اتصال به اتوماسیون اداری (چارگون)
دانشگاه علوم پزشکی شهید بهشتی
Route configuration for 5400W ADSL Router
خودآموز آسان ویکی‌پدیای فارسی
آموزش کرک کردن نرم افزار ACTIVE HDL
SE Dept.2 تهیه کنندگان: ملیحه اسکندری نسیبه پوتی
آشنایی مقدماتی با نرم افزار Endnote X4
برنامه نویسی پیشرفته مقدمات.
تنظیمات اینترنت اکسپلورر برایMIS
جزوه درس طراحی سیستمهای شی گرا
تنظیم مودم Level1 به حالت NAT
تنظیم مودم Level1 به حالت NAT
ASP.NET فرناز شریعت.
Introduction to Eclipse
راهنمای استفاده از ابزار Mailings در Ms Word
سال تولید ملی، حمایت از کار و سرمایه ایرانی
آشنایی مقدماتی با نرم افزار Endnote X4
بسم الله الرحمن الرحیم هرس درخت تصمیم Dr.vahidipour Zahra bayat
آشنایی مقدماتی با نرم افزار Endnote
کاربرد کامپیوتر در داروخانه
جستجوی منابع الکترونیک
به نام خدا Koha برنامه.
فصل ششم مدارهای ترتیبی.
Adode connect (وبینار)
مباني كامپيوتر و برنامه سازي Basics of Computer and Programming
مباني كامپيوتر و برنامه سازي Basics of Computer and Programming
طریقه ارسال اطلاعات به فیدا و دریافت شناسه فروشنده
آشنایی با فرایند داده کاوی در نرم افزار R گروه داده کاوی دایکه داود دوروش تابستان 6139.
Java IDE Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from.
Workshop for Programming And Systems Management Teachers
Presentation transcript:

برنامه نویسی پیشرفته معرفی محیط برنامه نویسی eclipse 1

فهرست نیازهای Eclipse نصب Eclipse ایجاد فضای کاری و پروژه ایجاد کلاسها کامپایل و اجرای برنامه خطایابی کد نمونه ای از قابلیتها خلاصه

Eclipse چیست؟ کد باز پشتیبانی از (plug-in) های دیگران محیط برنامه نویسی مجتمع شامل ابزارهای کد نویسی، کامپایل، اجرا و خطایابی پشتیبانی از زبانهای متعدد پشتسبانی خوب از C, C++ Python, PHP, Ruby, etc…

پیش نیازهای اجرای eclipse Eclipse به زبان جاوا نوشته شده است وبه JRE یا JDK برای اجرا نیاز دارد. JDK توصیه می شود.

دانلود و نصب Eclipse Eclipse را می توان از سایت زیر دانلود کرد: نسخه ی “Eclipse IDE for Java Developers” را دانلود کنید. فایل زیپ دانلود شده را در C:\eclipse\ استخراج کنید. برای اجرا، روی فایل C:\eclipse\eclipse.exe کلیک کنید. شما باید چیزی شبیه شکل زیر مشاهده کنید:

انتخاب فضای کار در Eclipse همه ی کدها در فضای کار ذخیره می شوند. می توان چندین فضای کار داشت. فضای کار مناسب را انتخاب کرده و دکمه ok را بزنید.

اجزای Eclipse Menubars Full drop down menus plus quick access to common functions Editor Pane This is where we edit our source code Perspective Switcher We can switch between various perspectives here Outline Pane This contains a hierarchical view of a source file Package Explorer Pane This is where our projects/files are listed Miscellaneous Pane Various components can appear in this pane – typically this contains a console and a list of compiler problems Task List Pane This contains a list of “tasks” to complete

ایجاد یک پروژه ی جدید تمام کدهای Eclipse به یک پروژه نیاز دارند. برای ایجاد یک پروژه: File  New  Java Project

ایجاد پروژه ی جدید (ادامه ) اسم پروژه را تایپ و روی Finish کلیک کنید.

ایجاد پروژه ی جدید (ادامه ) اسم پروژه ی جدید در محل مرورگر بسته های نرم افزاری ظاهر خواهد شد.

دایرکتوری src Eclipse بصورت خودکار یک دایرکتوری به اسم src برای نگهداری کدهای پروژه ایجاد می کند.

ایجاد کلاس برای ایجاد کلاس، روی دکمه ی new کلیک کرده و class را انتخاب کنید.

ایجاد کلاس (ادامه) اینکار باعث ظاهر شدن پنجره ی روبرو می شود. اطلاعات لازم را وارد کرده و روی دکمه ی Finish کلیک کنید.

کلاس ایجاد شده همانطور که می بینید اتفاقاتی رخ داده است: Directory structure for package and actual java file created automatically Source is loaded into the editor pane, already stubbed out Source displayed in a hierarchical fashion listing each method name

کامپایل کد یکی از خواص جالب eclipse کامپایل همزمان کد در هنگام کدنویسی است. Packages/Classes with errors are marked with a red X Often Eclipse may have suggestions on how to fix the problem – if so, a small light bulb will be displayed next to the line of offending code Error underlined with red squiggly line (just like spelling errors in many word processors) Methods with errors are marked with a red X Position in file is marked with a red line – 1 click allows you to jump to line with error The Problems tab will contain a tabular representation of all errors across all files of all open projects

مثالی از خطای کامپایل اگر روی لامپ کلیک کنیم، eclipse پیشنهاد می دهد که printn را به print یا println تغییر دهیم.

اجرای کد روی class کلیک راست کرده و Run As  Java Application را انتخاب کنید.

اجرای کد (ادامه) نتیجه ی اجرای کد در محل نشان داده شده ظاهر خواهد شد.

پیکر بندی اجرا برای اجرای گزینه های پیشرفته، روی class کلیک راست کرده و Run As  Run… را انتخاب کنید.

اجرای کد (ادامه) در این حالت می توانید موارد زیر را تغییر دهید: : آرگومانهای JVM آرگومانهای خط فرمان تنظیمات Classpath متغییرهای محیطی JVM مورد استفاده

اجرای دوباره ی کد برای اجرای دوباره ی کد در محل نشان داده شده کلیک کنید.

خطایابی (دیباگ) کد eclipse یک دیباگر خیلی خوب دارد. می توان نقاط توقف اجرای کد را با کلیک روی حاشیه ی سمت چپ ایجاد کرد. نقاط توقف با رنگ آبی نشان داده می شوند.

خطا یابی یک راه ساده برای ورود به مد خطایابی کلیک راست روی کلاس و انتخاب گزینه ی Debug As  Java Application است.

خطایابی اولین باری که سعی کنید کد را دیباگ کنید با پنجره ی زیر مواجه می شوید. Eclipse از شما می پرسد که آیا می خواهید یک منظر مناسب تر برای خطایابی را انتخاب کنید. بله را انتخاب کنید. Eclipse چندین منظر دارد و منظر پیش فرض منظر جاوا است.

Debug Perspective List of breakpoints These buttons allow you to step through the code Note new Debug perspective – click Java to return to normal Variables in scope are listed here along with their current values (by right clicking you can change values of variables as you program is running) Current high level location (class and method) This pane shows the current line of code we broke on Output console, just like in normal run mode

Sampling of Some Other Features Import organization Context assist Javadoc assist Getter/Setter generation Add unimplemented methods Exception handling Reminders Local history

Import Organization Eclipse can automatically include import statements for any classes you are using, just press Control + Shift + o (letter o)

Import Organization (continued) If the class is ambiguous (more than one in the API) then it will ask you to select the correct one

Import Organization (continued) Import statements automatically included and organized You can organize imports to clean them up at any time

Context Assist If you are typing and press a “.” character and pause a second, Eclipse will show you a list of all available methods for the class Prevents having to browse javadocs to see what methods are available Get context assist at any time by pressing Control + Space

Javadoc Assist Eclipse can also help generate javadoc comments for you, simply place the cursor before the method and then type “/**” then Enter

Javadoc Assist (continued) Eclipse will automatically generate a javadoc header for the method all stubbed out with the parameters, return type and exceptions

Getter/Setter Generation Eclipse can automatically generate getters and setters for member of a class…

Getter/Setter Generation (continued) To generate getters and setters, right click in the main pane, then select Source  Generate Getters and Setters

Getter/Setter Generation (continued) Here you can selectively choose members for which to generate getters and setters

Getter/Setter Generation (continued) Eclipse will then automatically generate the code for the getters and setters

Add Unimplemented Methods Eclipse can also stub out methods that need to be present as a result of implementing an interface…

Add Unimplemented Methods (continued) You can use the quick fix light bulb to add the interfaces unimplemented methods to the class

Add Unimplemented Methods (continued) Again Eclipse will go ahead and stub out the method for us

Exception Handling Eclipse will also pickup on unhandled exceptions

Exception Handling (continued) By clicking on the quick fix light bulb, Eclipse can suggest what to do to handle the exception

Exception Handling (continued) Eclipse can automatically add a “throws declaration” to the method signature

Exception Handling (continued) Alternately, Eclipse can also wrap the code inside a try/catch block

Tasks Eclipse allows you to insert reminders into your code and stores them for you to come back and revisit them Eclipse recognizes the following tags inside comments… –TODO –FIXME –XXX You can even add your own custom tasks through the preferences menu

Tasks (continued) To add a table of all reminders in all of your source code you can add the Tasks view by clicking on Window  Show View  Tasks

Tasks (continued) This neatly displays all tasks in a tabular form

Local History Eclipse maintains a local history of file revisions which can be accessed by right clicking on the class, then selecting Compare With  Local History…

Local History (continued) Previous saved revisions are displayed in the History pane, double click a revision to view in the built-in diff viewer

Summary Benefits Code completion Faster code/compile/run cycles (real time) Open source (free) Extensible (plugins) Disadvantages Pretty heavyweight Requires JRE Learning Curve

محتوی درس آشنایی با برنامه نویسی شی گرا (OOP) و طراحی شی گرا (OOD) آشنایی با زبان جاوا آشنایی با محیط برنامه نویسی Eclipse تاکید بر برنامه نویسی صحیح وب سایت درس: Version 9/1050