راهنمای تکمیل کد و راهنمای ابزار

راهنمای تکمیل کد و راهنمای ابزار

راهنمای تکمیل کد و راهنمای ابزار
تکمیل کد
هنگام تایپ کد جاوا در پنجره ویرایشگر روش، ممکن است برای تکمیل کدهای جزئی پیشنهادهایی درخواست شود. لیست تکمیل های ممکن در یک لیست تکمیل جداگانه که باز می شود نشان داده می شود. در برخی شرایط، هنگامی که یک ورودی در لیست انتخاب می شود، اطلاعات دقیق در یک پنجره جداگانه ظاهر می شود. تکمیل کد همیشه می تواند با میانبر صفحه کلید Ctrl+Space (یا Ctrl+/) درخواست شود. وقتی نقطه ای را تایپ می کنید به طور خودکار ظاهر می شود زیرا معمولاً می خواهید هنگام دسترسی به یک فیلد بین روش های موجود یکی را انتخاب کنید.
Application Builder از انواع پیشنهادات تکمیلی زیر پشتیبانی می کند.
عبارات جدید : یک مثال ساده فشار دادن Ctrl+Space بدون وارد کردن چیزی است، همانطور که در زیر نشان داده شده است.
لیست تکمیل شامل فیلدهای عضو (به عنوان مثال، appFeat یا model ) و متدهای عضو (به عنوان مثال، callGuiCommand ) است که می توان آنها را فراخوانی کرد. شما می توانید یک تکمیل را به دو روش انتخاب کنید:
با استفاده از کلیدهای جهت دار برای انتخاب یک ورودی در لیست و فشار دادن کلید Tab برای تأیید انتخاب.
در حال تایپ مقداری متن فهرست به‌طور خودکار به‌روزرسانی می‌شود تا فقط تکمیل‌هایی که با متن شروع می‌شوند حفظ شوند. برای مثال، اگر appF را تایپ کنید ، فقط appFeat باقی می ماند. سپس می توانید برای تایید انتخاب، Tab را فشار دهید.
عبارات جزئی : اگر ابتدای نام متغیر، فیلد یا روش را وارد کنید و Ctrl+Space را فشار دهید، تکمیل‌های پیشنهادی نشان داده می‌شوند.
فقط متغیرهایی که با پیشوند ra مطابقت دارند نشان داده می شوند. این مثال نشان می دهد که متغیرهای محلی نیز در پیشنهادات تکمیل ظاهر می شوند.
اعضای کلاس : اگر متغیر یا عبارتی را وارد کنید که به یک کلاس جاوای شناخته شده برای شی مدل حل می‌شود، می‌توانید مانند شکل زیر، پیشنهادات تکمیلی را برای اعضای کلاس دریافت کنید.
همانطور که در زیر نشان داده شده است، این تکمیل برای زنجیره های تماس نیز کار می کند.
اعضای کلاس در تکالیف و اعلان‌ها : در تکالیف و اعلان‌های متغیر، می‌توان از نوع مورد انتظار برای فیلتر کردن لیست تکمیل‌ها استفاده کرد. فقط تکمیل‌هایی که نوع مشابهی در سمت چپ بیانیه انتساب دارند نشان داده می‌شوند.
Tags in the model object: When the expression to complete can be resolved to a concrete entity in the embedded model, completions are available for the methods in the model object API that take a first argument that is a tag in a list, as shown.
The list above comes from an application whose embedded model contains two plot groups (pg1 and pg2). The completion list contains both the tags and the names of the corresponding plot groups. To transfer only the tag to the code, choose a completion in the list and then press Tab.
Types in the model object when creating new entities: When the expression to complete can be resolved to a concrete entity in the embedded model, completions are available for operation types in the model object when creating a new node.
Property names: When the expression to complete can be resolved to a concrete entity in the embedded model, completions are available for property names used as first arguments to the get and set operations. These are available for most features in the model object.
The example above shows the properties that are available for the plot group pg1 in the embedded model. If you select an entry in the list, you see the property’s description and its data type. When available, you may also see a link to the documentation and a set of allowed values. The allowed values appear if the set of allowed values is a finite array of strings.
Property values: When the expression to complete can be resolved to a concrete entity in the embedded model, completions are available for property values used as second arguments in the set operations that are available for most features in the model object.
If you select an entry in the list, you see the property value’s description and a link to the documentation, if available.
TOOLTIPS FOR CODE IN THE METHOD EDITOR
When hovering over different parts of the code for a method, tooltips appear to provide information about that part of the code. The following tooltips appear for different parts of the code:
Property Names
When you hover over a property name for a model or application object property, you get information about the property, similar to what you see for the property when code completion is used. For example, if you hover over numerical in model.result().numerical(“gev1”).setResult();, you see the following tooltip.
Model Entities
If you hover over the same property’s model entity name, “gev1” in this case, you see the following tooltip with information about the purpose of the model entity.
Declarations
For variables defined under Declarations in the Application Builder tree, the variable’s description appears as the tooltip when you hover above them. In this case, it is the string variable inXpolRatio.
Shortcuts
For shortcuts to form objects, also defined under Declarations, the description and the corresponding Java code appear in the tooltip. In this case, it is for the shortcut with the name labelinXpolRatio.
PREFERENCES FOR CODE GENERATION AND COMPLETION
In the Methods page under Application Builder in the Preferences dialog box, you can specify options for code generation and completion.
The Close brackets automatically check box is selected by default. The software then automatically inserts a corresponding closing bracket if you type a {[, or ( character. Clear the check box to disable the addition of closing brackets.
The Generate compact code using ‘with’ statements check box is selected by default. The generated code uses with statements to set a target to use with the coming calls to set()setIndex()getString(), and so on, which makes the code more compact. Clear the check box if you prefer to use the full code without the use of with statements.