Eclipse – Formatter e Save Action
Depois de ter falado sobre Code Templates para comentários no código, vou neste post falar sobre a formatação e como otimizar isso para lhe ajudar e não atrapalhar.
Muitos desenvolvedores tem problemas com o famoso Ctrl+Shift+F, que promete formatar seu código e muitas vezes acaba é deixando ele mais confuso.
Bem, o nosso padrão de código(se é que posso chamar assim) é muito diferente(ou um pouco depende) dos códigos dos gringos, ou seja, o Eclipse formata no padrão deles pode dizer assim ;).
Para resolver esse “problema” o desenvolvedor tem que fazer uma configuração simples, mas um pouco chata(considerada por alguns) mas no pior caso será feita apenas uma única vez ;).
Vá em Windows –> Preferences –> Java –> Code Style –> Formatter.
Vamos agora criar um novo profiler, clique em New e digite um nome para o seu novo profile.

Pronto, agora vamos personalizar, clique em editar.

Vou tentar falar um pouco sobre cada aba de opção.
Indentation
Nesta aba você vai selecionar a indentação em si e o tamanho dela, normalmente o tamanho da tab é 4.
Braces
Nesta aba você vai personalizar a posição das chaves(“{” , “}”).
White Space
Está é interessante, pois você poderá personalizar até os espaços em branco entre cada variável, método e assinaturas de todo tipo de objeto, desde strings até arrays e várias outras.
Blank Lines
Nesta aba você irá definir as quebras de linhas(linhas em branco) entres métodos, variáveis, pacotes e etc. Aqui você irá definir por exemplo que o espaço de linha entre a declaração de um package para um import seja de 2 linhas por exemplo.
New Lines
Nesta aba você define como um método vazio deverá ficar, se você deseja inserir uma nova linha neste método, definir também como um array declarado deverá ser exibido e identado, assim como uma annotation.
Control Statements
Esse é bem interessante mesmo, pois aqui você irá definir como seus else, IF, catch, while etc devem ser identados.
Line Wrapping
Neste você define o tamanho Maximo da coluna que uma linha pode comportar, como deve ser a identação de uma assinatura de um método, métodos declarados, enum, variáveis declaradas e etc.
Comments
Isso é referente a identação do Java Doc, blocos de comentários normais(//, /**/), qual o formato das tags HTML, espaço entre os textos do comentário e se desejar remover qualquer linha em branco que esteja no comentário.
Todas essa opções podem já serem visualizadas no código de exemplo ao lado de cada uma, facilitando assim a personalização.
Então supondo que você já criou e personalizou seu profile vamos agora tentar otimizar isso.
Para se utilizar do profile basta você executar o atalho dentro do código, que é o Ctrl + Shitf + F, pronto ele aplica a sua configuração personalizada.
Mas supondo que você criou um profile e quer sempre executar ele, fica meio chato você ficar sempre digitando o Ctrl+Shit+F correto ? Que tal otimizar isso ?
Save Actions
Vá em Windows –> Preferences –> Java –> Editor –> Save Actions.
Para ativar(caso não esteja) basta selecionar a opção “Perform the selected actions on save”.
Agora podemos adicionar uma formatação automática, selecione o Format source code e clique em Formatter.

Verifique se o seu profile está selecionado como profile ativo(Active Profile), clique em Ok e pronto, na próxima vez que você salvar(Ctrl + S) qualquer arquivo .java(classe) ele irá aplicar a(s) sua(s) configuração(ões) automaticamente.
Para definir como padrão para todos os integrantes da equipe, basta seguir os passos abaixo.
Vá em Windows –> Preferences –> Java –> Code Style –> Formatter –> Edit –> Export –> Salve seu profile.
Agora cada desenvolvedor irá poder importar toda a configuração de formatação de código, ou você mesmo poderá levar para onde quiser a sua formatação.
Simples não ?
Ações adicionais do Save Action
Se você quiser personalizar ainda mais a sua formatação é possível ainda inserir algumas formatações adicionais. Na tela de Save Actions temos o Configure onde você poderá definir mais configurações que serão executadas ao salvar qualquer classe Java.

Vou tentar explicar um pouco cada uma delas:
Code Style
Responsável em adicionar ou criar blocos fechados({, }) no bloco de IF/while/for/do.Definir se você quer parênteses em condições por exemplo:
(((i > 0) && (i < 10)) || (i == 50)) ou sem (i > 0 && i < 10 || i == 50).
Se quer adicionar o modificador final em todas os parâmetros onde seja necessário, e quais tipos de parâmetros(private, parameter, local variables).
Member Accesses
Usar o “this” em todos as variáveis e métodos locais ou somente onde for necessário. Como devem ser declarados os métodos e variáveis etc.
Unnecessary Code
Como o nome mesmo já diz, remove trechos de códigos desnecessários, como imports de classes que não existem dentre outras configurações.
Missing Code
Adiciona automaticamente as tags “@Override” e “@Deprecated” nos métodos.
Code Organizing
Organiza a ordem do métodos.
Bem essa são as formas simples de como otimizar o código, seja pela formatação dele ou até por simples comentários, mas essa é a intenção, não perder tempo com coisas simples e repetitivas ;).
Abraços e espero ter contribuído com este artigo para agilizar o processo de desenvolvimento.


This excellent website truly has all of the info I needed concerning this subject and didn’t know who to ask.
Here is my web blog; Kitchen Cabinet Malaysia
darknet market lists tor markets 2023
deep web drug url tor dark web
clonidine 25 mg
how to get on dark web dark market
dark web drug marketplace deep web markets
tor marketplace the dark internet
darknet markets darknet sites
This means no baths and no pool time. In Ayurveda hemorrhoids are referred to as Arsh or
Arsha Shoola which suggests the ache is like needle pricking.
So the common intake of Amla juice delays the indicators of premature aging like wrinkles,
high quality lines and darkish spots. Let’s see the benefits of Amla
juice for skin and amazing residence magnificence tips intimately.
4. Ice – Ice is the certainly one of extremely advisable house treatment for hemorrhoids treatment.
Diet and home remedies are recognized to be quite effective for the treatment of hemorrhoids.
Just a few of the various makes use of of castor oil include the remedy of bust cysts,
fibroids, and ovarian cysts, blockage of abdominal organs, pores and skin circumstances,
tiny benign cysts, and likewise attachments from surgical process.
Hence it helps to make the skin supple, delicate and youthful
in addition to tightens and tones pores and skin. Make ginger tea, add pieces of ginger in water and boil it for five to 10 minutes and drink 1-2 instances.
Spray a bit of water onto your face and use a cotton pad to wash the face,
you will notice that all of the makeup will likely be eliminated with the oil and you can be left
with clear healthy stunning skin.
My blog עיסוי אירוטי במרכז
black internet darknet sites
darknet marketplace darknet seiten
clonidine sale
Ahaa, its pleasant dialogue regarding this article here at this website, I have read all that,
so now me also commenting at this place.
I like the helpful info you provide in your articles.
I will bookmark your blog and check again here regularly.
I’m quite certain I will learn many new stuff right here!
Good luck for the next!
darknet market links dark market list
dark markets dark market list
purchase accutane with paypal
darknet links dark web market links
dark web market dark market link
dark web market dark market list
best darknet markets dark web links
deep web markets dark web market links
На сайте https://americandental.ru закажите звонок для того, чтобы записаться на консультацию в стоматологию в Москве. Все услуги выполняются под ключ, на работы даются гарантии. На портале вы сможете ознакомиться с расценками на различные виды работ. В стоматологии выполнят установку виниров, протезирование керамическими коронками, имплантацию. Вы сможете воспользоваться полным комплексом услуг как для взрослых, так и детей. Доступна консультация, а записаться можно на любое, наиболее комфортное время.
It’s not my first time to visit this site, i am visiting this web page dailly and obtain fastidious facts from here daily.
چه فصلی برای سفر به دبی مناسب است
Somebody essentially lend a hand to make seriously articles I’d
state. This is the very first time I frequented your website page and so far?
I amazed with the research you made to make this actual submit
extraordinary. Fantastic job!
Spot on with this write-up, I actually feel this web
site needs far more attention. I’ll probably be returning to read through more, thanks for the advice!
dark markets 2023 darknet site
На сайте https://www.parvenik.ru/ каждый желающий сможет приобрести не только качественный, натуральный веник, но и сопутствующие товары. К примеру, травы в мешочках, эфирные масла, травы в пучках и многое другое по доступным ценам. Чем больше вы закажете, тем выгодней будет ваша скидка. Материал для создания продукции использовался только натуральный, выращенный в экологически чистых и безопасных районах. Каждый месяц на определенные товары устанавливается скидка, что позволит приобрести все нужное и по хорошей цене.
free dark web dark markets
darknet market lists the dark internet
whoah this weblog is fantastic i like reading your articles.
Keep up the great work! You realize, lots of individuals are hunting
around for this information, you can help them greatly.
dark websites tor marketplace
I am regular reader, how are you everybody?
This piece of writing posted at this website
is really good.
darknet drug store dark net
dark net dark web search engines
Hello! I’m at work surfing around your blog from my new
iphone 4! Just wanted to say I love reading your blog and look forward to all
your posts! Keep up the fantastic work!
dark web sites deep web drug store
blackweb official website darknet market list
whoah this blog is excellent i love studying your articles.
Stay up the great work! You recognize, lots of persons are hunting round for this information, you could aid them greatly.
Here is my web site: Kitchen Cabinet Malaysia
dark web market links deep web drug store
onion market tor markets links
dark market onion how to get on dark web
darknet sites dark market list
dark markets black internet
На сайте https://vibortv.ru/ вы сможете ознакомиться с полезной информацией, рекомендациями, которые касаются того, как правильно выбрать телевизор. Вы узнаете о том, что означают определенные термины и понятия, о том, какая диагональ подходит именно для вашего случая. Для того чтобы насладиться четкой картинкой, лучше выбирать диагональ побольше. Именно от размера зависит четкость картинки и качество изображения. Есть описание технологий QLED и OLED, их различия. Все рекомендации помогут принять правильное решение.
tor markets links dark web search engines
how to access dark web dark market 2023
Due to the high cost of the operating system and office utilities, licensed software is not available to everyone kms activator windows 11 – and modern security systems can be very difficult to circumvent.
dark web access darknet drug links